本文整理汇总了Python中pages.start_page.StartPage.login_with_credentials方法的典型用法代码示例。如果您正苦于以下问题:Python StartPage.login_with_credentials方法的具体用法?Python StartPage.login_with_credentials怎么用?Python StartPage.login_with_credentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.start_page.StartPage
的用法示例。
在下文中一共展示了StartPage.login_with_credentials方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_new_account_creation
# 需要导入模块: from pages.start_page import StartPage [as 别名]
# 或者: from pages.start_page.StartPage import login_with_credentials [as 别名]
def test_new_account_creation(self, mozwebqa):
start_page = StartPage(mozwebqa)
credentials = start_page.get_new_persona_credentials()
home_page = start_page.login_with_credentials(credentials)
Assert.true(home_page.is_user_logged_in)
logged_out = home_page.logout()
Assert.false(logged_out.is_user_logged_in)
logged_in = logged_out.login_with_credentials(credentials)
Assert.true(logged_in.is_user_logged_in)
示例2: test_verify_layout_logged_in_user
# 需要导入模块: from pages.start_page import StartPage [as 别名]
# 或者: from pages.start_page.StartPage import login_with_credentials [as 别名]
def test_verify_layout_logged_in_user(self, mozwebqa):
start_page = StartPage(mozwebqa)
credentials = start_page.get_new_persona_credentials()
home_page = start_page.login_with_credentials(credentials)
edit_page = home_page.click_profile()
Assert.true(edit_page.is_stats_section_visible())
Assert.true(edit_page.is_stats_ranking_visible())
Assert.not_none(edit_page.stats_ranking, 'Stats rankings is null')
Assert.true(edit_page.is_stats_banners_visible())
Assert.not_none(edit_page.stats_banners, 'Stats banners is null')
Assert.true(edit_page.is_stats_clicks_visible())
Assert.not_none(edit_page.stats_clicks, 'Stats clicks is null')
Assert.true(edit_page.is_milestones_section_visible())
Assert.true(edit_page.is_newsletter_form_visible())
示例3: test_edit_profile_change_display_name
# 需要导入模块: from pages.start_page import StartPage [as 别名]
# 或者: from pages.start_page.StartPage import login_with_credentials [as 别名]
def test_edit_profile_change_display_name(self, mozwebqa):
new_username = "Testbot: %s" % (datetime.now())
start_page = StartPage(mozwebqa)
credentials = start_page.get_new_persona_credentials()
home_page = start_page.login_with_credentials(credentials)
profile_page = home_page.click_profile()
# verify changing username, update username to include a timestamp
profile_page.update_profile_name(new_username)
actual_username = profile_page.profile_username
Assert.equal(actual_username , new_username,
"Failed: username on profile page failed to update. Expected: '%s' \
, but returned '%s'" %
(new_username, actual_username))
leader_board_page = profile_page.click_leaderboard_link()
Assert.equal(leader_board_page.username, new_username.upper(),
"Failed: username in header of leaderboard failed to update. \
Expected '%s', but returned '%s'" %
(new_username.upper(), leader_board_page.username))
# verify username persists after logging out and then logging back in
logged_out = profile_page.logout()
home_page = logged_out.login_with_credentials(credentials)
profile_page = home_page.click_profile()
actual_username = profile_page.profile_username
Assert.equal(actual_username, new_username,
"Failed: update to username did not persist after logout. \
Expected '%s', but returned '%s'" %
(new_username, actual_username))
# verify user can leave username field empty
profile_page.update_profile_name("")
actual_username = profile_page.profile_username
Assert.equal(actual_username, "Affiliate",
"Failed: leaving username blank should default profile username \
to 'Affiliate'. Expected 'Affiliate', but returned '%s'" %
actual_username)
示例4: test_edit_profiles_website
# 需要导入模块: from pages.start_page import StartPage [as 别名]
# 或者: from pages.start_page.StartPage import login_with_credentials [as 别名]
def test_edit_profiles_website(self, mozwebqa):
start_page = StartPage(mozwebqa)
new_url = 'http://wiki.mozilla.org/' + datetime.utcnow().strftime("%s")
credentials = start_page.get_new_persona_credentials()
home_page = start_page.login_with_credentials(credentials)
profile_page = home_page.click_profile()
# update profile website to include a timestamp
profile_page.update_profile_website(new_url)
actual_website = profile_page.profile_website
Assert.equal(actual_website, new_url,
"update to website on profile edit page. \
Expected '%s' but returned '%s'" %
(new_url, actual_website))
# verify username persists after logging out and then logging back in
logged_out = profile_page.logout()
home_page = logged_out.login_with_credentials(credentials)
profile_page = home_page.click_profile()
actual_website = profile_page.profile_website
Assert.equal(actual_website, new_url,
"update to website did not persist after logout. \
Expected '%s', but returned '%s'" %
(new_url, actual_website))
# verify user can leave website field empty
profile_page.update_profile_website("")
actual_website = profile_page.profile_website
Assert.equal(actual_website, "",
"user can't set website URL to an empty string. \
Expected '', returned '%s'" %
actual_website)