Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    def test_that_add_a_review_button_works(self, mozwebqa):
        """
        Litmus 25729
        https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25729
        """
        # Step 1: Addons Home Page loads and Addons Details loads
        home_page = Home(mozwebqa)

        # Step 2:user logs in to submit a review
        home_page.login()
        Assert.true(home_page.header.is_user_logged_in)

        # Step 3: user loads an addon details page and clicks write a review button
        details_page = Details(mozwebqa, "Firebug")
        review_box = details_page.click_to_write_review()
        Assert.true(review_box.is_review_box_visible)