Skip to content

Commit

Permalink
teste da história 17 com action
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlosesposito22 committed Nov 10, 2024
1 parent 47026c2 commit c1fc8ba
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions site_cc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4599,7 +4599,7 @@ def setUpClass(cls):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
#chrome_options.add_argument("--headless")
chrome_options.add_argument("--window-size=1920,1080")
cls.driver = webdriver.Chrome(options=chrome_options)

Expand All @@ -4619,7 +4619,7 @@ def tearDown(self):
subprocess.run(['python', 'manage.py', 'deletemodalidades'], check=True)
super().tearDown()

def test_01_enquete_visivel_moderador(self):
def t1est_01_enquete_visivel_moderador(self):
driver = self.driver

# 1. Registro do moderador
Expand Down Expand Up @@ -4786,7 +4786,7 @@ def test_01_enquete_visivel_moderador(self):
self.assertIsNotNone(logout, "Botão de logout não encontrado.")
logout.click()

def test_02_criar_enquete_valida(self):
def t1est_02_criar_enquete_valida(self):
driver = self.driver

# 1. Registro do moderador
Expand Down Expand Up @@ -5186,13 +5186,14 @@ def test_03_visualizar_e_votoUnico(self):
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.ID, "enquetesModal"))
)

# 3. Clique na primeira (e única) enquete disponível
primeira_enquete = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, "button[data-enquete-id]"))
)
primeira_enquete.click()
####################
action = ActionChains(driver)
time.sleep(2)
primeira_enquete = driver.find_element(By.CSS_SELECTOR, "button[data-enquete-id]")
time.sleep(2)
action.move_to_element(primeira_enquete).click().perform()
time.sleep(2)
####################

opcoes = driver.find_elements(By.CSS_SELECTOR, "input[name='opcao_id']")
opcoes[0].click()
Expand Down Expand Up @@ -5285,7 +5286,7 @@ def setUpClass(cls):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
#chrome_options.add_argument("--headless")
chrome_options.add_argument("--window-size=1920,1080")
cls.driver = webdriver.Chrome(options=chrome_options)

Expand All @@ -5305,13 +5306,7 @@ def tearDown(self):
subprocess.run(['python', 'manage.py', 'deletemodalidades'], check=True)
super().tearDown()






def teste1(self):

driver = self.driver

# 1. Registro do moderador
Expand Down Expand Up @@ -5376,7 +5371,7 @@ def teste1(self):
driver.execute_script("document.getElementById('create-btn').removeAttribute('disabled');")
time.sleep(2)
findForm5.click()
time.sleep(1)
time.sleep(3)

time.sleep(3)
btnCriarEnquete = driver.find_element(By.NAME, "criar-enquete")
Expand Down Expand Up @@ -5414,7 +5409,7 @@ def teste1(self):

botao_criar_enquete = driver.find_element(By.ID, "save-enquete")
assert botao_criar_enquete is not None, "Botão 'save-enquete' não encontrado"
driver.execute_script("arguments[0].click();", btnCriarEnquete)
botao_criar_enquete.click()
time.sleep(2)

ver_resultados = driver.find_element(By.ID, "listarResultadosEnquetes")
Expand Down

0 comments on commit c1fc8ba

Please # to comment.