Example #1
0
    def test_createaccount_url(self):
        """ Tests that the /createaccount url leads to Create Account tab
        """
        d = self.driver
        d.get(self.login_url_https + "createAccount")
        sleep(2)
        cap = CreateAccountPage(d)

        assert cap.submit_button().text == 'Create Account'
Example #2
0
    def test_create_account(self, test_whitespaces):
        """ Tests that the user can create an account and log in with it
        """
        d = self.driver
        cap = CreateAccountPage(d)
        self.stop_all()
        self.set_etsy_testcase('listings_09')
        run_sql('AUTH', 'auth_01', retry=2)
        self.restart_all()

        # go to create account page
        d.get(self.login_url_https + "createAccount")
        sleep(1)

        # create account
        send_keys(cap.firstname(), 'Test')
        send_keys(cap.lastname(), 'User')
        email_text = '*****@*****.**'
        if test_whitespaces == Whitespaces.yes:
            # the case when whitespaces are around email in input field
            email_text = '   ' + email_text + ' '
        send_keys(cap.email(), email_text)
        send_keys(cap.password(), 'secret123')
        send_keys(cap.password2(), 'secret123')
        click(cap.submit_button())

        # check DB
        db_data = run_sql('AUTH', 'select_test_user', True)
        assert db_data == [['Test', 'User']]

        # log in using the new account
        d.delete_all_cookies()
        lp = LoginPage(d)
        lp.login(user='******',
                 password='******',
                 page=self.login_url_http)
        mp = MainPage(d)
        assert mp.is_displayed(), 'Login failed, main page is not displayed'