本文整理汇总了Python中addons_site.AddonsDetailsPage类的典型用法代码示例。如果您正苦于以下问题:Python AddonsDetailsPage类的具体用法?Python AddonsDetailsPage怎么用?Python AddonsDetailsPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AddonsDetailsPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_icon_locator
def test_icon_locator(self, testsetup): #broken in impala
#Firebug icon
#image_url = "https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1843-32.png?modified=1300780225"
#Tab Mix Plus icon
tab_mix_plus_page = AddonsDetailsPage(testsetup, "Tab Mix Plus")
image_url = "https://gs1.adn.edgecastcdn.net/801237/addons-cdn.allizom.org/en-US/firefox/images/addon_icon/1122-32.png?modified=1305054615" #?modified=1305054615"
Assert.true(tab_mix_plus_page.is_element_present("css=input[type=img], [src=" + image_url + "]"))
示例2: 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
amo_home_page = AddonsHomePage(mozwebqa)
credentials = mozwebqa.credentials['default']
amo_home_page.header.click_login()
addons_login_page = AddonsLoginPage(mozwebqa)
addons_login_page.login(credentials['email'], credentials['password'])
Assert.true(amo_home_page.header.is_user_logged_in)
# Step 2 - Load any addon detail page
details_page = AddonsDetailsPage(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, credentials['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)
示例3: test_that_reviews_are_displayed
def test_that_reviews_are_displayed(self, mozwebqa):
""" Test for Litmus 9890"""
amo_details_page = AddonsDetailsPage(mozwebqa, "Firebug")
Assert.true(amo_details_page.is_review_title_visible())
Assert.equal(amo_details_page.review_title, "Reviews")
Assert.true(amo_details_page.has_reviews)
Assert.not_none(re.search('(\w+\s*){1,}', amo_details_page.review_details))
示例4: test_that_release_notes_are_displayed
def test_that_release_notes_are_displayed(self, testsetup):
""" Test for Litmus 9890"""
amo_details_page = AddonsDetailsPage(testsetup, "Firebug")
Assert.true(amo_details_page.are_release_notes_visible())
Assert.equal(amo_details_page.release_notes, "Release Notes")
Assert.not_none(re.match('\w+', amo_details_page.version_number))
#check that the release number matches the the version number at the top of the page
Assert.not_none(re.search(amo_details_page.version_number, amo_details_page.release_version))
示例5: test_that_version_information_is_displayed
def test_that_version_information_is_displayed(self, mozwebqa):
""" Test for Litmus 9890"""
amo_details_page = AddonsDetailsPage(mozwebqa, "Firebug")
Assert.true(amo_details_page.is_version_information_heading_visible())
Assert.equal(amo_details_page.version_information_heading, "Version Information")
Assert.not_none(re.search('\w+', amo_details_page.release_version))
# check that the release number matches the the version number at the top of the page
Assert.not_none(re.search(amo_details_page.version_number, amo_details_page.release_version))
示例6: test_report_abuse_link_popup
def test_report_abuse_link_popup(self, testsetup):
"""
Litmus 25730
https://litmus.mozilla.org/show_test.cgi?id=25730
"""
amo_details_page = AddonsDetailsPage(testsetup, "Firebug")
amo_details_page.click_report_abuse_link()
Assert.true(amo_details_page.is_report_abuse_send_report_button_visible())
Assert.equal(amo_details_page.report_abuse_send_report_button, "Send Report")
示例7: test_that_external_link_leads_to_addon_website
def test_that_external_link_leads_to_addon_website(self, testsetup):
""" Litmus 11809
https://litmus.mozilla.org/show_test.cgi?id=11809 """
# Step 1 - Open AMO homepage
# Step 2 - Open Adblock Plus details page
details_page = AddonsDetailsPage(testsetup, 'Adblock Plus')
website_link = details_page.website
Assert.true(website_link != '')
# Step 3 - Follow external website link
details_page.click_website_link()
Assert.true(website_link in details_page.get_url_current_page())
示例8: test_that_review_usernames_are_clickable
def test_that_review_usernames_are_clickable(self, testsetup):
"""
Litmus 4842
https://litmus.mozilla.org/show_test.cgi?id=4842
"""
addon_name = 'firebug'
amo_detail_page = AddonsDetailsPage(testsetup, addon_name)
for review in amo_detail_page.reviews():
username = review.username
amo_user_page = review.click_username()
Assert.equal(username, amo_user_page.username)
AddonsDetailsPage(testsetup, addon_name)
示例9: test_navigating_to_other_addons_by_the_same_author_when_there_are_less_than_five_other_addons
def test_navigating_to_other_addons_by_the_same_author_when_there_are_less_than_five_other_addons(self, testsetup):
"""
Litmus 11926
https://litmus.mozilla.org/show_test.cgi?id=1192"""
addon_with_less_than_five_addons_by_the_same_author = 'adblock-plus'
amo_detail_page = AddonsDetailsPage(testsetup, addon_with_less_than_five_addons_by_the_same_author)
addons = amo_detail_page.other_addons_link_list()
Assert.true(len(addons) < 5)
for i in range(amo_detail_page.other_addons_link_list_count):
amo_detail_page.click_other_addon_by_this_author(addons[i])
print addons[i]
Assert.true(amo_detail_page.name.startswith(addons[i].rstrip('.')))
AddonsDetailsPage(testsetup, addon_with_less_than_five_addons_by_the_same_author)
示例10: test_navigating_to_other_addons_by_the_same_author_when_there_are_more_than_four_other_addons
def test_navigating_to_other_addons_by_the_same_author_when_there_are_more_than_four_other_addons(self, testsetup):
"""
Litmus 11926
https://litmus.mozilla.org/show_test.cgi?id=1192"""
addon_with_more_than_four_addons_by_the_same_author = 'firebug'
amo_detail_page = AddonsDetailsPage(testsetup, addon_with_more_than_four_addons_by_the_same_author)
addons = amo_detail_page.other_addons_dropdown_values
Assert.true(len(addons) > 4)
for i in range(len(addons) - 1, 0, -1): # Not checking the first item in the drop-down https://bugzilla.mozilla.org/show_bug.cgi?id=660706
amo_detail_page.select_other_addons_dropdown_value(addons[i])
print addons[i]
Assert.true(amo_detail_page.name.startswith(addons[i].rstrip('.')))
AddonsDetailsPage(testsetup, addon_with_more_than_four_addons_by_the_same_author)
示例11: test_details_more_images
def test_details_more_images(self, testsetup):
"""
Litmus 4846
https://litmus.mozilla.org/show_test.cgi?id=4846
"""
amo_detail_page = AddonsDetailsPage(testsetup, 'firebug')
image_viewer = amo_detail_page.click_addon_image()
Assert.true(image_viewer.is_visible)
image_viewer.close()
Assert.false(image_viewer.is_visible)
additional_images_count = amo_detail_page.additional_images_count
for i in range(1, additional_images_count):
image_viewer = amo_detail_page.click_additional_image(i)
Assert.equal(i + 1, image_viewer.current_image)
Assert.true(image_viewer.is_visible)
image_viewer.close()
Assert.false(image_viewer.is_visible)
image_viewer = amo_detail_page.click_additional_image(1)
Assert.true(image_viewer.is_visible)
for i in range(2, image_viewer.total_images_count + 1):
Assert.true(image_viewer.is_visible)
Assert.equal(i, image_viewer.current_image)
Assert.true(image_viewer.is_close_visible)
Assert.equal("Image %s of %s" % (i, additional_images_count + 1), image_viewer.current_number)
if not i == image_viewer.total_images_count:
image_viewer.click_next()
Assert.false(image_viewer.is_next_link_visible)
Assert.true(image_viewer.is_previous_link_visible)
for i in range(image_viewer.total_images_count, 0, -1):
Assert.true(image_viewer.is_visible)
Assert.equal(i, image_viewer.current_image)
Assert.true(image_viewer.is_close_visible)
Assert.equal("Image %s of %s" % (i, additional_images_count + 1), image_viewer.current_number)
if not i == 1:
image_viewer.click_previous()
Assert.true(image_viewer.is_next_link_visible)
Assert.false(image_viewer.is_previous_link_visible)
image_viewer.close()
Assert.false(image_viewer.is_visible)
示例12: test_get_author_children_locators
def test_get_author_children_locators(self, testsetup): #ok in impala
tab_mix_plus_page = AddonsDetailsPage(testsetup, "Tab Mix Plus")
i = 1
author_list = [ tab_mix_plus_page.get_text("//h4[@class='author']/a[%i]" % (i+1))
for i in range(tab_mix_plus_page.selenium.get_xpath_count("//h4[@class='author']/a")) ]
#These tests are for Firebug data
#Assert.equal(5, len(author_locator))
#Assert.equal("Joe Hewitt",self.selenium.get_text("//h4[@class='author']/a[1]"))
#Assert.equal("johnjbarton",self.selenium.get_text("//h4[@class='author']/a[2]"))
#Assert.equal("robcee",self.selenium.get_text("//h4[@class='author']/a[3]"))
#Assert.equal("FirebugWorkingGroup",self.selenium.get_text("//h4[@class='author']/a[4]"))
#Assert.equal("Jan Odvarko",self.selenium.get_text("//h4[@class='author']/a[5]"))
#These tests are for
Assert.equal(2, len(author_list))
Assert.equal("onemen",author_list[0])
Assert.equal("Gary Reyes",author_list[1])
示例13: test_author_group_locator
def test_author_group_locator(self, testsetup): #ok in impala
tab_mix_plus_page = AddonsDetailsPage(testsetup, "Tab Mix Plus")
Assert.true(tab_mix_plus_page.is_element_present("//h4[@class='author']/a"))
示例14: test_that_about_this_addon_is_displayed
def test_that_about_this_addon_is_displayed(self, mozwebqa):
""" Test for Litmus 9890"""
amo_details_page = AddonsDetailsPage(mozwebqa, "Firebug")
Assert.true(amo_details_page.is_about_addon_visible())
Assert.equal(amo_details_page.about_addon, "About this Add-on")
Assert.not_none(re.match('(\w+\s*){3,}', amo_details_page.description))
示例15: test_that_summary_is_displayed
def test_that_summary_is_displayed(self, mozwebqa):
""" Test for Litmus 9890"""
amo_details_page = AddonsDetailsPage(mozwebqa, "Firebug")
Assert.true(amo_details_page.is_summary_visible())
# check that the summary is not empty
Assert.not_none(re.match('(\w+\s*){3,}', amo_details_page.summary))