Beispiel #1
0
class BZW_43(BaseTest):
    def test_incorrect_data(self):
        self.open_sign_in_page()
        self.fill_incorrect_password_and_sign_in()
        self.fill_email_without_sign_at_and_sign_in()
        self.fill_email_with_domain_only()
        self.fill_email_with_spaces_at_the_beginning()
        self.logout()

    @step
    def open_sign_in_page(self):
        self.page = SignIn(driver)
        self.page.open()
        eq_(self.page.is_title(), True, "Incorrect title")

    @step
    def fill_incorrect_password_and_sign_in(self):
        self.page = self.page.sign_in(username, password + '111')
        eq_(self.page.is_title(), True, "Failed to stay on the 'Sign in' page")
        eq_(self.page.verify_do_not_match_message(), True, "Failed to display 'Email and password don't match' message")

    @step
    def fill_email_without_sign_at_and_sign_in(self):
        self.page = self.page.sign_in(string.replace(username, "@", "."), password)
        eq_(self.page.is_title(), True, "Failed to stay on the 'Sign in' page")

    @step
    def fill_email_with_domain_only(self):
        self.page = self.page.sign_in("@blazemeter.com", password)
        eq_(self.page.is_title(), True, "Failed to stay on the 'Sign in' page")

    @step
    def fill_email_with_spaces_at_the_beginning(self):
        self.page = self.page.sign_in('      ' + username, password)
        if driver.name.__contains__('firefox'):
            eq_(SignIn(driver).is_title(), True, "Failed to stay on the Sign In page")
        else:
            eq_(AppMain(driver).is_title(), True, "Failed to login")

    @step
    def logout(self):
        if driver.name.__contains__('chrome'):
            self.page = self.page.logout()
            eq_(self.page.is_title(), True, "User is not logout")