Ejemplo n.º 1
0
    def test_create_valid_new_user(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'], mock_user['password'],
                                      mock_user['password'], mock_user['email'], mock_user['realname'])
        Assert.equal(create_account_pg.get_user_created_message, 'Login successful')
        Assert.equal(create_account_pg.get_user_welcome_message, 'Welcome, ' + mock_user['username'] + '!')
Ejemplo n.º 2
0
    def test_email_required_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'], mock_user['password'],
                                      mock_user['password'], '', mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(create_account_pg.get_error_message_text.index('No email address'))
Ejemplo n.º 3
0
    def test_passwords_mismatch_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'], mock_user['password'],
                                      'blah', mock_user['email'], mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(create_account_pg.get_error_message_text.index('The passwords you entered do not match.'))
Ejemplo n.º 4
0
    def test_user_already_exists_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user('gbh', mock_user['password'],
                                      mock_user['password'], mock_user['email'], mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(create_account_pg.get_error_message_text.index(
            'Username entered already in use. Please choose a different name.'))
Ejemplo n.º 5
0
    def test_valid_email_required_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'], mock_user['password'],
                                      mock_user['password'], 'notValidEmail', mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(create_account_pg.get_error_message_text.index('The email address cannot be accepted as '
                                                                   'it appears to have an invalid format. Please '
                                                                   'enter a well-formatted address or empty that field.'))
Ejemplo n.º 6
0
    def test_email_required_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'],
                                      mock_user['password'],
                                      mock_user['password'], '',
                                      mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(
            create_account_pg.get_error_message_text.index('No email address'))
Ejemplo n.º 7
0
    def test_passwords_mismatch_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'],
                                      mock_user['password'], 'blah',
                                      mock_user['email'],
                                      mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(
            create_account_pg.get_error_message_text.index(
                'The passwords you entered do not match.'))
Ejemplo n.º 8
0
    def test_create_valid_new_user(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'],
                                      mock_user['password'],
                                      mock_user['password'],
                                      mock_user['email'],
                                      mock_user['realname'])
        Assert.equal(create_account_pg.get_user_created_message,
                     'Login successful')
        Assert.equal(create_account_pg.get_user_welcome_message,
                     'Welcome, ' + mock_user['username'] + '!')
Ejemplo n.º 9
0
    def test_user_already_exists_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user('gbh', mock_user['password'],
                                      mock_user['password'],
                                      mock_user['email'],
                                      mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(
            create_account_pg.get_error_message_text.index(
                'Username entered already in use. Please choose a different name.'
            ))
Ejemplo n.º 10
0
    def test_valid_email_required_error(self, mozwebqa):
        mock_user = MockUser()
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        create_account_pg.click_create_account_link()
        create_account_pg.create_user(mock_user['username'],
                                      mock_user['password'],
                                      mock_user['password'], 'notValidEmail',
                                      mock_user['realname'])
        Assert.true(create_account_pg.is_error_message_present)
        Assert.true(
            create_account_pg.get_error_message_text.index(
                'The email address cannot be accepted as '
                'it appears to have an invalid format. Please '
                'enter a well-formatted address or empty that field.'))