Ejemplo n.º 1
0
def test_create_collection_with_only_symbols_name(selenium, base_url):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    collections.create.set_name('<<!§')
    assert collections.create.create_button_disabled.is_displayed()
Ejemplo n.º 2
0
def test_create_collection_with_empty_custom_url(selenium, base_url):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    collections.create.set_name('collection name')
    collections.create.slug_label_element.clear()
    assert collections.create.create_button_disabled.is_displayed()
Ejemplo n.º 3
0
def test_create_collection_empty_name(selenium, base_url):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    assert collections.create.create_button_disabled.is_displayed()
    collections.create.set_slug('abc')
    assert collections.create.create_button_disabled.is_displayed()
Ejemplo n.º 4
0
def test_create_collection_with_invalid_symbols_in_url(selenium, base_url,
                                                       variables):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    collections.create.set_name('abc')
    collections.create.set_slug('^_^')
    collections.create.save_collection()
    assert (variables['collection_invalid_custom_url_warning']
            in collections.create.warning_text)
Ejemplo n.º 5
0
def test_create_collection(selenium, base_url, variables, wait):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    # using random strings to make sure we're always getting a unique URL,
    # which is constructed from the name of the collection
    name = reusables.get_random_string(15)
    collections.create.set_name(name)
    description = variables['collection_description']
    collections.create.set_description(description)
    collections.create.save_collection()
    collections.collection_detail.wait_for_details_to_load()
    # checks that the collection was created with the input given
    wait.until(
        lambda _: name == collections.collection_detail.collection_name,
        message=f'Expected collection name "{name}" was not displayed',
    )
    assert description == collections.collection_detail.collection_description.text
Ejemplo n.º 6
0
def test_create_collection_with_already_used_url(selenium, base_url,
                                                 variables):
    collections = Collections(selenium,
                              base_url).open().wait_for_page_to_load()
    collections.login('collection_user')
    collections.click_create_collection()
    collections.create.set_name('abc')
    collections.create.slug_label_element.clear()
    collections.create.set_slug('abc')
    collections.create.save_collection()
    collections.collection_detail.wait_for_details_to_load()
    # go back and try to create another collection with different name, but same URL
    collections.driver.get(
        'https://addons.allizom.org/en-US/firefox/collections/')
    collections.click_create_collection()
    collections.create.set_name('def')
    collections.create.slug_label_element.clear()
    collections.create.set_slug('abc')
    collections.create.save_collection()
    assert variables[
        'collection_reused_url_warning'] in collections.create.warning_text