Skip to content

Commit

Permalink
EGCETSII#43-fix: selenium tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JSnow11 committed Jan 9, 2022
1 parent e7edfb0 commit 8314788
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions decide/administration/seleniumT.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import time
import random

'''
README:
'''README:
Para poder ejecutar este test, se debe crear un superusuario
con el siguiente comando:
Expand Down Expand Up @@ -76,8 +75,8 @@ def incorrect_log_in(driver, cont):
By.XPATH, '//*[@id="content"]/div/form/button').click()
time.sleep(1)
elemento = driver.find_element(
By.XPATH, '//*[@id="content"]/div/form/div[2]/p')
error_text = 'Unable to log in with provided credentials.'
By.XPATH, '//*[@id="Notifications"]/div/div/div[2]')
error_text = 'ERRORS: non_field_errors:Unable to log in with provided credentials.'
if elemento.text == error_text:
print("Test correctamente realizado\n")
return cont
Expand Down Expand Up @@ -132,7 +131,7 @@ def make_staff(driver, cont):
time.sleep(2)
driver.find_element(
By.XPATH, '//*[@id="actions"]/div/button[5]').click()
#driver.find_element(By.XPATH, '')
# driver.find_element(By.XPATH, '')
print("Test correctamente realizado\n")

return cont
Expand All @@ -153,7 +152,7 @@ def make_superuser(driver, cont):
driver.find_element(
By.XPATH, '//*[@id="actions"]/div/button[6]').click()
# print(element)
#driver.find_element(By.XPATH, '')
# driver.find_element(By.XPATH, '')
print("Test correctamente realizado\n")
return cont
except Exception as e:
Expand Down Expand Up @@ -383,3 +382,6 @@ def tally_voting(driver, cont):
cont2 = delete_voting(driver, cont2)
print("Se han realizado los test de Votings")
print("Se han encontrado: " + str(cont2) + " errores \n\n")

print("TESTS FINISHED")
print("Se han encontrado: " + str(cont + cont2) + " errores \n\n")

0 comments on commit 8314788

Please sign in to comment.