本文整理汇总了Python中pages.home.Home类的典型用法代码示例。如果您正苦于以下问题:Python Home类的具体用法?Python Home怎么用?Python Home使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Home类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_edit_event
def test_edit_event(self, mozwebqa):
home_page = Home(mozwebqa)
home_page.login()
events_page = home_page.header.click_events_link()
events_page.filter_for("New Event")
event_detail_page = events_page.click_filtered_event()
edit_event_page = event_detail_page.click_edit_event_button()
#Edit newly created event
edit_event_page.edit_event_name("Edited Event title")
edit_event_page.edit_event_description("Updated and changed description goes here")
edit_event_page.edit_event_venue("SFO Commons")
edit_event_page.edit_event_city("San Francisco")
edit_event_page.edit_event_country("United Kingdom")
edit_event_page.edit_start_month("5")
edit_event_page.edit_start_day("28")
edit_event_page.select_random_start_year()
edit_event_page.edit_end_month("12")
edit_event_page.edit_end_day("29")
edit_event_page.edit_event_category()
edit_event_page.edit_estimated_attendance("400")
edit_event_page.edit_event_success_metric("25")
edit_event_page.edit_event_metric("2")
edit_event_page.edit_event_success_metric2("200")
edit_event_page.edit_event_metric2("1")
edit_event_page.edit_event_goals()
event_detail_page = edit_event_page.click_save_event_button()
Assert.true(event_detail_page.is_event_saved_message_visible)
Assert.equal('Edited Event title', event_detail_page.name)
示例2: test_that_clicking_on_theme_name_loads_its_detail_page
def test_that_clicking_on_theme_name_loads_its_detail_page(self, mozwebqa):
"""test for litmus 15363"""
home_page = Home(mozwebqa)
themes_page = home_page.click_themes()
theme_name = themes_page.addon_name(1)
theme_page = themes_page.click_on_first_addon()
Assert.contains(theme_name, theme_page.addon_title)
示例3: test_that_new_review_is_saved
def test_that_new_review_is_saved(self, mozwebqa):
""" Litmus 22921
https://litmus.mozilla.org/show_test.cgi?id=22921 """
# Step 1 - Login into AMO
home_page = Home(mozwebqa)
home_page.login()
Assert.true(home_page.is_the_current_page)
Assert.true(home_page.header.is_user_logged_in)
# Step 2 - Load any addon detail page
details_page = Details(mozwebqa, 'Adblock Plus')
# Step 3 - Click on "Write review" button
write_review_block = details_page.click_to_write_review()
# Step 4 - Write a review
body = 'Automatic addon review by Selenium tests'
write_review_block.enter_review_with_text(body)
write_review_block.set_review_rating(1)
review_page = write_review_block.click_to_save_review()
# Step 5 - Assert review
review = review_page.review()
Assert.equal(review.rating, 1)
Assert.equal(review.author, mozwebqa.credentials['default']['name'])
date = datetime.now().strftime("%B %d, %Y")
# there are no leading zero-signs on day so we need to remove them too
date = date.replace(' 0', ' ')
Assert.equal(review.date, date)
Assert.equal(review.text, body)
示例4: test_that_category_names_are_correct
def test_that_category_names_are_correct(self, mozwebqa):
"""Test for Litmus 25795"""
expected_categories = [
"Alerts & Updates",
"Appearance",
"Bookmarks",
"Download Management",
"Feeds, News & Blogging",
"Games & Entertainment",
"Language Support",
"Photos, Music & Videos",
"Privacy & Security",
"Shopping",
"Social & Communication",
"Tabs",
"Web Development",
"Other"]
# Get actual categories
home_page = Home(mozwebqa)
categories = home_page.categories()
# Catch extra/missing categories with a simple count check
Assert.equal(len(categories), len(expected_categories))
# Check the categories that are there against the expected list
for category in categories:
Assert.contains(category.name, expected_categories)
示例5: test_that_clicking_on_a_subcategory_loads_expected_page
def test_that_clicking_on_a_subcategory_loads_expected_page(self, mozwebqa):
"""test for litmus 15949"""
home_page = Home(mozwebqa)
themes_page = home_page.click_themes()
selected_category = themes_page.themes_category
amo_category_page = themes_page.click_on_first_category()
Assert.equal(selected_category, amo_category_page.title)
示例6: test_the_featured_personas_section
def test_the_featured_personas_section(self, mozwebqa):
""" Test for Litmus 15392
https://litmus.mozilla.org/show_test.cgi?id=15392"""
home_page = Home(mozwebqa)
personas_page = home_page.click_personas()
Assert.true(personas_page.is_the_current_page)
Assert.equal(6, personas_page.featured_personas_count)
示例7: test_themes_subcategory_page_breadcrumb
def test_themes_subcategory_page_breadcrumb(self, mozwebqa):
home_page = Home(mozwebqa)
themes_page = home_page.click_themes()
selected_category = themes_page.themes_category
amo_category_page = themes_page.click_on_first_category()
expected_breadcrumb = "Add-ons for Firefox Themes %s" % selected_category
Assert.equal(expected_breadcrumb, amo_category_page.breadcrumb)
示例8: test_hide_email_checkbox_works
def test_hide_email_checkbox_works(self, mozwebqa):
home_page = Home(mozwebqa)
home_page.login()
Assert.true(home_page.is_the_current_page)
Assert.true(home_page.header.is_user_logged_in)
view_profile_page = home_page.header.click_view_profile()
initial_state = view_profile_page.is_email_field_present
edit_profile_page = home_page.header.click_edit_profile()
edit_profile_page.change_hide_email_state()
edit_profile_page.click_update_account()
view_profile_page = home_page.header.click_view_profile()
final_state = view_profile_page.is_email_field_present
try:
Assert.not_equal(initial_state, final_state, 'The initial and final states are the same. The profile change failed.')
if final_state is True:
credentials = mozwebqa.credentials['default']
Assert.equal(credentials['email'], view_profile_page.email_value, 'Actual value is not equal with the expected one.')
except Exception as exception:
Assert.fail(exception.msg)
finally:
if initial_state != final_state:
edit_profile_page = home_page.header.click_edit_profile()
edit_profile_page.change_hide_email_state()
edit_profile_page.click_update_account()
view_profile_page = home_page.header.click_view_profile()
Assert.equal(view_profile_page.is_email_field_present, initial_state, 'Could not restore profile to initial state.')
示例9: test_create_event
def test_create_event(self, mozwebqa):
home_page = Home(mozwebqa)
home_page.login()
events_page = home_page.header.click_events_link()
create_event_page = events_page.click_create_event_button()
#Create event with all required fields
create_event_page.set_event_name("New Event")
create_event_page.set_event_description("Fairly long description is required")
create_event_page.set_event_venue("Mozilla office")
create_event_page.set_event_venue_map()
create_event_page.set_event_city("Mountain View")
create_event_page.select_event_country("Antarctica")
create_event_page.select_start_month("3")
create_event_page.select_start_day("14")
create_event_page.select_random_start_year()
create_event_page.select_end_month("11")
create_event_page.select_end_day("22")
create_event_page.select_end_year("2022")
create_event_page.set_event_category()
create_event_page.select_estimated_attendance("100")
create_event_page.set_event_success_metric("10")
create_event_page.set_event_metric("2")
create_event_page.set_event_success_metric2("20")
create_event_page.set_event_metric2("3")
create_event_page.set_event_goals()
event_detail_page = create_event_page.click_save_event_button()
Assert.true(event_detail_page.is_event_saved_message_visible)
Assert.equal('New Event', event_detail_page.name)
示例10: test_that_five_star_rating_increments
def test_that_five_star_rating_increments(self, mozwebqa):
""" Litmus 22920
https://litmus.mozilla.org/show_test.cgi?id=22920 """
# Step 1 - Login into AMO
home_page = Home(mozwebqa)
home_page.login()
Assert.true(home_page.header.is_user_logged_in)
# Step 2 - Go to add-ons listing page sorted by rating
extensions_home_page = home_page.click_to_explore('Top Rated')
# Step 3 - Pick an addon with no reviews
extensions_home_page.go_to_last_page()
addon = extensions_home_page.extensions[-1] # the last one is without rating
addon_name = addon.name
details_page = Details(mozwebqa, addon_name)
# Step 4 - Click on the "Write review" button
write_review_block = details_page.click_to_write_review()
# Step 5 - Add review with 1-star rating
body = 'Automatic addon review by Selenium tests'
write_review_block.enter_review_with_text(body)
write_review_block.set_review_rating(5)
write_review_block.click_to_save_review()
# Step 6 - Ensure rating increased by one
details_page = Details(mozwebqa, addon_name)
new_rating_counter = details_page.get_rating_counter(5)
Assert.equal(new_rating_counter, 1)
示例11: test_create_event
def test_create_event(self, mozwebqa):
home = Home(mozwebqa)
home.go_to_homepage()
Assert.false(home.is_user_loggedin)
home.login()
Assert.true(home.is_user_loggedin)
events = Events(mozwebqa)
示例12: test_admin_login_logout
def test_admin_login_logout(self, mozwebqa):
home_page = Home(mozwebqa)
home_page.login()
home_page.select_org(home_page.org).click()
home_page.header.click_logout()
Assert.true(home_page.is_username_field_present)
Assert.true(home_page.is_password_field_present)
示例13: test_searching_for_collections_returns_results
def test_searching_for_collections_returns_results(self, mozwebqa):
"""Litmus 17352
https://litmus.mozilla.org/show_test.cgi?id=17352"""
home_page = Home(mozwebqa)
amo_collection_page = home_page.click_collections()
amo_search_results_page = amo_collection_page.search_for('web')
Assert.true(amo_search_results_page.result_count > 0)
示例14: test_that_extensions_link_loads_extensions_page
def test_that_extensions_link_loads_extensions_page(self, mozwebqa):
"""
Litmus 25746
https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25746
"""
home_page = Home(mozwebqa)
extensions_page = home_page.click_extensions()
Assert.true(extensions_page.is_the_current_page)
示例15: test_menu_items
def test_menu_items(self, mozwebqa):
home = Home(mozwebqa)
home.go_to_homepage()
for menu_item in home.header.main_menu:
Assert.contains(menu_item.text, self._menu_items)