Пример #1
0
    def test_too_large_and_small_bulk_photo(self):
        """"edit bulk photo. Add too large picture more than 1500px height or width
        error bubble should be displayed and disapper after few seconds
        than try to upload too small picture of size len than 50px height or width"""

        d = self.driver
        bp = BulkPage(d)

        # add small photo
        bp.select_photo(0, full_path('small.png'))
        assert bp.error_baloon_pictures() == ['Height and width must each be at least 50px']

        # add too large photo
        bp.select_photo(0, full_path('too_big.jpg'))
        assert bp.error_baloon_pictures() == ['Height and width must each be at most 3000px']
Пример #2
0
    def test_bulk_photo(self):
        """ Tests photos can be added, replaced, deleted
        """

        d = self.driver
        bp = BulkPage(d)

        # add bulk photos
        bp.select_photo(0, full_path('onion.jpg'))
        bp.select_photo(1, full_path('bunny.jpeg'))
        click(bp.operation_apply())

        apply_class = bp.operation_apply().get_attribute('class')
        assert 'inactive' in apply_class.split(' ')

        # add individual photos
        row = bp.listing_row('Second something 1235 (2)')
        photos = bp.row_photo_elements(row)
        bp.select_image(photos[2], full_path('jmeter.png'))
        bp.select_image(photos[3], full_path('ario.png'))

        # replace images
        bp.select_operation('Replace')
        bp.select_photo(3, full_path('mail.png'))
        click(bp.operation_apply())

        apply_class = bp.operation_apply().get_attribute('class')
        assert 'inactive' in apply_class.split(' ')

        # delete images
        bp.select_operation('Delete')
        photos = bp.bulk_photo_elements()
        click(photos[2])
        click(bp.operation_apply())

        apply_class = bp.operation_apply().get_attribute('class')
        assert 'inactive' in apply_class.split(' ')