本文整理汇总了Python中addons_site.AddonsDetailsPage.click_to_write_review方法的典型用法代码示例。如果您正苦于以下问题:Python AddonsDetailsPage.click_to_write_review方法的具体用法?Python AddonsDetailsPage.click_to_write_review怎么用?Python AddonsDetailsPage.click_to_write_review使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addons_site.AddonsDetailsPage
的用法示例。
在下文中一共展示了AddonsDetailsPage.click_to_write_review方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_new_review_is_saved
# 需要导入模块: from addons_site import AddonsDetailsPage [as 别名]
# 或者: from addons_site.AddonsDetailsPage import click_to_write_review [as 别名]
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)