예제 #1
0
    def test_description_find_replace(self):
        """ Tests that find and replace works
        special case '$'
        """
        expected_descriptions_1 = [
            'invisible shoes $10',
            'invisible shoes $10',
            'invisible shoes $10',
        ]
        expected_descriptions_2 = [
            'invisible shoes 10 Kč (not $)',
            'invisible shoes 10 Kč (not $)',
            'invisible shoes 10 Kč (not $)',
        ]

        operation = 'Find & Replace'

        select_listings_to_edit(self.driver, operation)
        d = self.driver
        bp = BulkPage(d)

        input_find_field = bp.operation_input_find_description()
        input_replace_field = bp.operation_input_replace_description()

        send_keys(input_find_field, 'gloves')
        send_keys(input_replace_field, 'shoes $10')
        click(bp.operation_apply())

        descriptions = bp.listing_descriptions()
        assert descriptions == expected_descriptions_1

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

        # check '$' can be replaced
        bp.select_operation(operation)
        input_find_field = bp.operation_input_find_description()
        input_replace_field = bp.operation_input_replace_description()

        send_keys(input_find_field, '$10')
        send_keys(input_replace_field, '10 Kč (not $)')
        click(bp.operation_apply())

        descriptions = bp.listing_descriptions()
        assert descriptions == expected_descriptions_2

        apply_class = bp.operation_apply().get_attribute('class')
        assert 'inactive' in apply_class.split(' ')
예제 #2
0
    def test_description_delete(self):
        """ Tests that delete works
        """
        expected_descriptions = [
            'visible gloves',
            'visible gloves',
            'visible gloves',
        ]

        select_listings_to_edit(self.driver, 'Delete')
        d = self.driver
        bp = BulkPage(d)

        input_field = bp.operation_input_description()
        send_keys(input_field, 'in')
        click(bp.operation_apply())

        descriptions = bp.listing_descriptions()
        assert descriptions == expected_descriptions

        apply_class = bp.operation_apply().get_attribute('class')
        assert 'inactive' in apply_class.split(' ')
예제 #3
0
    def test_description_add_after(self):
        """ Tests that correct text can be added after
        """
        expected_descriptions = [
            'invisible gloves hello',
            'invisible gloves hello',
            'invisible gloves hello',
        ]

        select_listings_to_edit(self.driver, 'Add After')
        d = self.driver
        bp = BulkPage(d)

        input_field = bp.operation_input_description()
        send_keys(input_field, ' hello')
        click(bp.operation_apply())

        descriptions = bp.listing_descriptions()
        assert descriptions == expected_descriptions

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