def test_feedback_can_be_filtered_by_platform(self, mozwebqa):
        """This testcase covers # 15215 in Litmus.

        1. Verify that the selected platform is the only one to appear in the list and is selected
        2. Verify that the number of messages in the platform list is plus or minus 15 for the number of messages returned
        3. Verify that the platform appears in the URL
        4. Verify that the platform for all messages on the first page of results is correct

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()
        feedback_pg.product_filter.select_product('firefox')

        platform_name = "OS X"
        platform = feedback_pg.platform_filter.platform(platform_name)
        platform_message_count = platform.message_count
        platform_code = platform.code
        platform.click()

        total_message_count = feedback_pg.total_message_count
        message_count_difference = total_message_count - platform_message_count

        Assert.equal(len(feedback_pg.platform_filter.platforms), 1)
        Assert.true(
            feedback_pg.platform_filter.platform(platform_name).is_selected)
        # TODO refactor if unittest-zero receives an Assert.within_range method
        Assert.less_equal(message_count_difference, 15)
        Assert.greater_equal(message_count_difference, -15)
        Assert.equal(feedback_pg.platform_from_url, platform_code)
        [
            Assert.equal(message.platform, platform_name)
            for message in feedback_pg.messages
        ]
    def test_feedback_can_be_filtered_by_platform(self, mozwebqa):
        """This testcase covers # 15215 in Litmus.

        1. Verify that the selected platform is the only one to appear in the list and is selected
        2. Verify that the number of messages in the platform list is plus or minus 15 for the number of messages returned
        3. Verify that the platform appears in the URL
        4. Verify that the platform for all messages on the first page of results is correct

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()
        feedback_pg.product_filter.select_product('firefox')
        feedback_pg.product_filter.select_version('--')

        platform_name = "Mac OS X"
        platform = feedback_pg.platform_filter.platform(platform_name)
        platform_message_count = platform.message_count
        platform_code = platform.code
        platform.click()

        total_message_count = feedback_pg.total_message_count.replace(',', '')
        message_count_difference = int(total_message_count) - int(platform_message_count)

        Assert.equal(len(feedback_pg.platform_filter.platforms), 1)
        Assert.true(feedback_pg.platform_filter.platform(platform_name).is_selected)
        # TODO refactor if unittest-zero receives an Assert.within_range method
        Assert.less_equal(message_count_difference, 15)
        Assert.greater_equal(message_count_difference, -15)
        Assert.equal(feedback_pg.platform_from_url, platform_code)
        [Assert.equal(message.platform, platform_name) for message in feedback_pg.messages]
Example #3
0
 def test_that_featured_personas_exist_on_the_home(self, mozwebqa):
     """
     Test for Litmus29698.
     https://litmus.mozilla.org/show_test.cgi?id=29698
     """
     home_page = Home(mozwebqa)
     Assert.equal(home_page.featured_personas_title, u'Featured Personas See all \xbb', 'Featured Personas region title doesn\'t match')
     Assert.less_equal(home_page.featured_personas_count, 6)
Example #4
0
 def test_that_featured_personas_exist_on_the_home(self, mozwebqa):
     """
     Test for Litmus29698.
     https://litmus.mozilla.org/show_test.cgi?id=29698
     """
     home_page = Home(mozwebqa)
     Assert.equal(home_page.featured_personas_title, u'Featured Personas See all \xbb', 'Featured Personas region title doesn\'t match')
     Assert.less_equal(home_page.featured_personas_count, 6)
Example #5
0
 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.header.site_navigation_menu("Personas").click()
     Assert.true(personas_page.is_the_current_page)
     Assert.less_equal(personas_page.featured_personas_count, 6)
Example #6
0
 def test_the_featured_themes_section(self, mozwebqa):
     """
     Test for Litmus 15392.
     https://litmus.mozilla.org/show_test.cgi?id=15392
     """
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     Assert.true(themes_page.is_the_current_page)
     Assert.less_equal(themes_page.featured_themes_count, 6)
 def test_less_equal_fail_int_message(self):
     try:
         Assert.less_equal(2, 1, "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
 def test_less_equal_success(self):
     Assert.less_equal("1", "2")
     Assert.less_equal(1, 2)
     Assert.less_equal("1", "1")
     Assert.less_equal(1, 1)
 def test_less_equal_fail_string_message(self):
     try:
         Assert.less_equal("2", "1", "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
Example #10
0
 def test_less_equal_fail_int_message(self):
     try:
         Assert.less_equal(2, 1, "message")
     except AssertionError, e:
         pass
Example #11
0
 def test_the_featured_themes_section(self, mozwebqa):
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     Assert.true(themes_page.is_the_current_page)
     Assert.less_equal(themes_page.featured_themes_count, 6)
Example #12
0
 def test_less_equal_fail_string(self):
     try:
         Assert.less_equal("2", "1")
     except AssertionError, e:
         pass 
Example #13
0
 def test_less_equal_fail_int(self):
     try:
         Assert.less_equal(2, 1)
     except AssertionError, e:
         pass
Example #14
0
def test_generate_random_int_args():
    maxvalue = 1
    random_int = randomness.generate_random_int(maxvalue)
    Assert.greater_equal(random_int, 0)
    Assert.less_equal(random_int, maxvalue)
Example #15
0
def test_generate_random_int_args():
    maxvalue = 1
    random_int = randomness.generate_random_int(maxvalue)
    Assert.greater_equal(random_int, 0)
    Assert.less_equal(random_int, maxvalue)
Example #16
0
 def test_the_featured_themes_section(self, mozwebqa):
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     Assert.true(themes_page.is_the_current_page)
     Assert.less_equal(themes_page.featured_themes_count, 6)
Example #17
0
    def test_book_flight_should_succeed(self):
        home_page = HomePage(self.driver).open_home_page()
        book_flight = home_page.header.book_flight()
        book_flight.book_flight_daparture()

        Assert.less_equal(book_flight._first_price, book_flight._second_price)
Example #18
0
 def test_less_equal_fail_int_message(self):
     try:
         Assert.less_equal(2, 1, "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
Example #19
0
 def test_less_equal_fail_string_message(self):
     try:
         Assert.less_equal("2", "1", "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
Example #20
0
 def test_less_equal_success(self):
     Assert.less_equal("1", "2")
     Assert.less_equal(1, 2)
     Assert.less_equal("1", "1")
     Assert.less_equal(1, 1)