diff --git a/decide/authentication/tests.py b/decide/authentication/tests.py index 34d24fa6d3..eeb7db3ded 100644 --- a/decide/authentication/tests.py +++ b/decide/authentication/tests.py @@ -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("test1@yopmail.com") + # 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("test1@yopmail.com") + 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("test1@yopmail.com") + 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') \ No newline at end of file