예제 #1
0
    def test_bulk_edit_view_listings_checked(self):
        """ Tests that the bulk edit view shows the listings checked on all pages
        """
        d = self.driver
        pg = MainPage(d)
        bp = BulkPage(d)

        pg.select_filter_tab('Active')
        sleep(1)

        # check all
        click(pg.listing_select_all_checkbox())
        assert pg.edit_listings_button().text == 'Edit 102 Listings'

        # clck the Edit Listings
        click(pg.edit_listings_button())
        sleep(1)

        # check the listings 1st page
        listing_rows = bp.listing_rows()
        assert len(listing_rows) == 25
        for listing_row in listing_rows:
            row_class = listing_row.get_attribute('class')
            assert 'selected' in row_class.split(' ')

        click(bp.next_page_button())
        sleep(2)

        # check the listings 2nd page
        listing_rows = bp.listing_rows()
        assert len(listing_rows) == 50
        for listing_row in listing_rows:
            row_class = listing_row.get_attribute('class')
            assert 'selected' in row_class.split(' ')
예제 #2
0
    def test_pagination_buttons_bulk_page(self):
        """ Tests the paging cannot go beyond end
        """

        d = self.driver
        mp = MainPage(d)
        pg = BulkPage(d)
        mp.select_listings_to_edit('ALL')

        # Following part is exactly the same as for the MainPage,
        # but it uses controls that are defined in BulkPage
        prev_page = pg.prev_page_button()
        assert prev_page.is_displayed() is False

        next_page = pg.next_page_button()
        assert next_page.text == 'Show 1 - 51 of 102'

        click(next_page)
        sleep(2)
        next_page = pg.next_page_button()
        assert next_page.text == 'Show 26 - 76 of 102'

        click(next_page)
        sleep(2)
        next_page = pg.next_page_button()
        assert next_page.text == 'Show 51 - 101 of 102'

        click(next_page)
        sleep(2)
        next_page = pg.next_page_button()
        assert next_page.text == 'Show 76 - 102 of 102'

        click(next_page)
        sleep(2)
        next_page = pg.next_page_button()
        assert next_page.is_displayed() is False

        prev_page = pg.prev_page_button()
        assert prev_page.text == 'Show 51 - 101 of 102'

        click(prev_page)
        sleep(2)
        prev_page = pg.prev_page_button()
        assert prev_page.text == 'Show 26 - 76 of 102'

        click(prev_page)
        sleep(2)
        prev_page = pg.prev_page_button()
        assert prev_page.text == 'Show 1 - 51 of 102'

        click(prev_page)
        sleep(2)
        prev_page = pg.prev_page_button()
        assert prev_page.is_displayed() is False

        next_page = pg.next_page_button()
        assert next_page.text == 'Show 26 - 76 of 102'