Skip to content

Commit

Permalink
Merge pull request #24 from Decide-Part-Rota/Rota3-004
Browse files Browse the repository at this point in the history
Rota3 004
  • Loading branch information
MRomalde authored Dec 13, 2022
2 parents dcdf6ff + f6009c8 commit b7f798b
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions decide/authentication/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,72 @@ def test_simpleIncorrectAgeRegister(self):

print(self.live_server_url)

self.assertEqual(self.driver.title, 'Register')

def test_simpleIncorrectSexRegister(self):
self.driver.get(f'{self.live_server_url}/authentication/registerForm/')
self.driver.find_element(By.ID,'id_username').send_keys("test1")
self.driver.find_element(By.ID,'id_password1').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_password2').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_email').send_keys("[email protected]")
# Probar un register con sexo invalida
self.driver.find_element(By.ID,'id_sex').send_keys("Helicoptero")
self.driver.find_element(By.ID,'id_age').send_keys("0")
self.driver.find_element(By.ID,'id_status').send_keys("Soltero")
self.driver.find_element(By.ID,'id_country').send_keys("Andorra")
self.driver.find_element(By.ID,'id_button').send_keys(Keys.ENTER)

print(self.live_server_url)

self.assertEqual(self.driver.title, 'Register')

def test_simpleIncorrectStatusRegister(self):
self.driver.get(f'{self.live_server_url}/authentication/registerForm/')
self.driver.find_element(By.ID,'id_username').send_keys("test1")
self.driver.find_element(By.ID,'id_password1').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_password2').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_email').send_keys("[email protected]")
self.driver.find_element(By.ID,'id_sex').send_keys("Mujer")
self.driver.find_element(By.ID,'id_age').send_keys("0")
# Probar un register con estado invalida
self.driver.find_element(By.ID,'id_status').send_keys("Con novia")
self.driver.find_element(By.ID,'id_country').send_keys("Andorra")
self.driver.find_element(By.ID,'id_button').send_keys(Keys.ENTER)

print(self.live_server_url)

self.assertEqual(self.driver.title, 'Register')

def test_simpleIncorrectCountryRegister(self):
self.driver.get(f'{self.live_server_url}/authentication/registerForm/')
self.driver.find_element(By.ID,'id_username').send_keys("test1")
self.driver.find_element(By.ID,'id_password1').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_password2').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_email').send_keys("[email protected]")
self.driver.find_element(By.ID,'id_sex').send_keys("Mujer")
self.driver.find_element(By.ID,'id_age').send_keys("0")
self.driver.find_element(By.ID,'id_status').send_keys("Con novia")
# Probar un register con sexo invalida
self.driver.find_element(By.ID,'id_country').send_keys("Sevilla")
self.driver.find_element(By.ID,'id_button').send_keys(Keys.ENTER)

print(self.live_server_url)

self.assertEqual(self.driver.title, 'Register')

def test_simpleIncorrectMailRegister(self):
self.driver.get(f'{self.live_server_url}/authentication/registerForm/')
self.driver.find_element(By.ID,'id_username').send_keys("test1")
self.driver.find_element(By.ID,'id_password1').send_keys("complexpassword")
self.driver.find_element(By.ID,'id_password2').send_keys("complexpassword")
# Probar un register con mail invalido
self.driver.find_element(By.ID,'id_email').send_keys("miEmail")
self.driver.find_element(By.ID,'id_sex').send_keys("Mujer")
self.driver.find_element(By.ID,'id_age').send_keys("0")
self.driver.find_element(By.ID,'id_status').send_keys("Con novia")
self.driver.find_element(By.ID,'id_country').send_keys("Sevilla")
self.driver.find_element(By.ID,'id_button').send_keys(Keys.ENTER)

print(self.live_server_url)

self.assertEqual(self.driver.title, 'Register')

0 comments on commit b7f798b

Please sign in to comment.