Ejemplo n.º 1
0
    def test_create_tag_multi_over(self):
        """ Tests that multiple tags can be created in bulk edit, but no more than 13
        """
        expected_tags_01 = [
            ['Tag01'],
            ['Tag01'],
            ['Tag01', 'AAA', 'BBB', 'CCC'],
        ]

        expected_tags_02 = [
            [
                'Tag01', '00', '01', '02', '03', '04', '05', '06', '07', '08',
                '09', '10', '11'
            ],
            [
                'Tag01', '00', '01', '02', '03', '04', '05', '06', '07', '08',
                '09', '10', '11'
            ],
            [
                'Tag01', 'AAA', 'BBB', 'CCC', '00', '01', '02', '03', '04',
                '05', '06', '07', '08'
            ],
        ]

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

        # deselect 2, 3
        bp.click_on_listings(
            ['Second something 1235 (2)', 'Third something LG-512a (3)'])

        # append AAA BBB CCC tags to the 1st listing
        send_keys(bp.operation_input(), 'AAA,BBB   ,CCC')
        click(bp.operation_apply())

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

        tag_names = bp.tag_names()
        assert tag_names == expected_tags_01

        # select 2, 3 again
        bp.click_on_listings(
            ['Second something 1235 (2)', 'Third something LG-512a (3)'])
        send_keys(
            bp.operation_input(),
            '00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15')
        click(bp.operation_apply())

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

        tag_names = bp.tag_names()
        assert tag_names == expected_tags_02
Ejemplo n.º 2
0
    def test_create_tag_special_chars(self):
        """ Tests that a tag can be created in bulk edit with czech chars, but not special chars
        """
        expected_tags = [
            ['Tag01', 'žvýkačky'],
            ['Tag01', 'žvýkačky'],
            ['Tag01', 'žvýkačky'],
        ]

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

        send_keys(bp.operation_input(), 'žvýkačky')
        click(bp.operation_apply())

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

        tag_names = bp.tag_names()
        assert tag_names == expected_tags

        send_keys(bp.operation_input(), 'me@site')
        err = bp.error_baloon()
        assert err == "Tag can only include spaces, letters, hyphens, and numbers"
Ejemplo n.º 3
0
    def test_delete_tag(self):
        """ Tests that tags can be deleted in bulk
        """

        expected_tags = [
            [],
            [],
            [],
        ]

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

        tag_field = bp.operation_input()
        click(tag_field)
        send_keys(tag_field, 'Tag')
        send_keys(tag_field, '01')
        click(bp.operation_apply())

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

        tag_names = bp.tag_names()
        assert tag_names == expected_tags
Ejemplo n.º 4
0
    def test_delete_single_tag(self):
        """ Tests that single tag can be deleted
        """

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

        row = bp.listing_row('First something 1234 (1)')
        tag_names = bp.tag_names(row)
        assert tag_names == ['Tag01']

        tags = bp.tag_elements(row)
        close_icon = tags[0].find_element_by_css_selector('span.close')
        click(close_icon)
        sleep(2)

        tag_names = bp.tag_names(row)
        assert tag_names == []

        titles = bp.listing_rows_texts_sorted()
        assert titles[0] == "First something 1234 (1)\n13 remaining"
Ejemplo n.º 5
0
    def test_create_tag_normal(self):
        """ Tests that a tag can be created in bulk edit
        """
        expected_tags = [
            ['Tag01', 'AAA'],
            ['Tag01', 'AAA'],
            ['Tag01', 'AAA'],
        ]

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

        send_keys(bp.operation_input(), 'AAA')
        click(bp.operation_apply())

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

        tag_names = bp.tag_names()
        assert tag_names == expected_tags