Пример #1
0
def test_verify_autosuggestion(browser, phrase='panda'):

    search_page = DuckDuckGoSearchPage(browser)

    # Load duckduckgo.com page
    search_page.load()

    # Write phrase in search textbox
    search_page.write_search_phrase(phrase)

    as_table = search_page.autosuggestion_table()
    matches = [match for match in as_table if match in match]

    assert len(matches) == len(as_table)
Пример #2
0
def test_check_autosuggestion(browser, phrase='panda'):

    search_page = DuckDuckGoSearchPage(browser)
    result_page = DuckDuckGoResultPage(browser)

    # Load duckduckgo.com page
    search_page.load()

    # Write phrase in search textbox
    search_page.write_search_phrase(phrase)

    # Search by clicking on first autosuggestion and return its text
    as_first = search_page.search_by_autosuggestion()

    # Check if results pertain to clicked autosuggestion
    titles = result_page.result_link_titles()
    matches = [t for t in titles if as_first.lower() in t.lower()]
    assert len(matches) > 0