def test_del_user_exists(self):
     """Deleting an existing user"""
     name, email, password = get_data()
     with allure.step('delete existing user'):
         response = self.client.del_user(user=name)
     with allure.step('Check status code'):
         assert response.status_code == 404
Exemple #2
0
 def test_incorrect_email(self):
     """Incorrect user email"""
     user, email, password = get_data(email=get_incorrect_email)
     with allure.step('reg user'):
         self.reg_page.reg(user=user, password=password, email=email)
     with allure.step('check correct response'):
         assert "Invalid email address" in self.driver.page_source
Exemple #3
0
 def test_incorrect_username_length(self):
     """Incorrect username length"""
     user, email, password = get_data(name=get_incorrect_name)
     with allure.step('reg user'):
         self.reg_page.reg(user=user, password=password, email=email)
     with allure.step('check correct response'):
         assert "Incorrect username length" in self.driver.page_source
Exemple #4
0
 def test_incorrect_login(self):
     """Incorrect login """
     name, _, password = get_data()
     with allure.step('login'):
         self.login_page.login(user=name, password=password)
     with allure.step('check correct response'):
         assert 'Invalid username or password'
     with allure.step('check database'):
         assert self.sql_builder.get_record_by_name(name) == -1
Exemple #5
0
 def test_two_empty_fields(self):
     user, _, password = get_data()
     with allure.step('reg user'):
         self.reg_page.reg(user=user,
                           password=password,
                           rpassword='',
                           email='')
     with allure.step('check correct response'):
         assert "{'email': ['Incorrect email length', 'Invalid email address'], 'password': ['Passwords must match']}" not in self.driver.page_source
Exemple #6
0
 def test_two_wrong_fields(self):
     """Two fields are incorrect"""
     user, email, password = get_data(name=get_incorrect_name)
     with allure.step('reg user'):
         self.reg_page.reg(user=user,
                           password=password,
                           rpassword=password + '1',
                           email=email)
     with allure.step('check correct response'):
         assert "{'username': ['Incorrect username length'], 'password': ['Passwords must match']}" not in self.driver.page_source
Exemple #7
0
 def test_diff_passwords(self):
     """Password fields don't match"""
     user, email, password = get_data()
     with allure.step('reg user'):
         self.reg_page.reg(user=user,
                           password=password,
                           rpassword=password + '1',
                           email=email)
     with allure.step('check correct response'):
         assert "Passwords must match" in self.driver.page_source
def data():
    return get_data()