Exemplo n.º 1
0
def i_expect_the_top_result_to_contain_the_string_search_term(step, search_term):
    wd = Driver.instance(step)
    assert isinstance(wd, Driver)
    for i in range(5):
        try:
            results = wd.find_elements_by_class_name("rc")
            top_result = results[0]
            break
        except IndexError:
            sleep(1)
            continue
    else:
        raise
    tools.assert_true(search_term in top_result.text, u"could not find {0} in {1}".format(search_term, top_result.text))
Exemplo n.º 2
0
def i_expect_the_top_result_to_contain_the_string_search_term(
        step, search_term):
    wd = Driver.instance(step)
    assert isinstance(wd, Driver)
    for i in range(5):
        try:
            results = wd.find_elements_by_class_name('rc')
            top_result = results[0]
            break
        except IndexError:
            sleep(1)
            continue
    else:
        raise
    tools.assert_true(
        search_term in top_result.text,
        u'could not find {0} in {1}'.format(search_term, top_result.text))
Exemplo n.º 3
0
def i_submit_the_search(step):
    wd = Driver.instance(step)
    search_box = wd.find_element_by_id("gbqfq")
    search_box.send_keys("\n")
Exemplo n.º 4
0
def i_type_search_term_into_the_search_box(step, search_term):
    wd = Driver.instance(step)
    search_box = wd.find_element_by_id("gbqfq")
    search_box.send_keys(search_term)
Exemplo n.º 5
0
def i_expect_the_url_to_become_url(step, url):
    wd = Driver.instance(step)
    tools.assert_equal(wd.current_url[: len(url)], url)
Exemplo n.º 6
0
def i_open_url_in_my_web_browser(step, url):
    wd = Driver.instance(step)
    wd.get(url)
Exemplo n.º 7
0
def i_submit_the_search(step):
    wd = Driver.instance(step)
    search_box = wd.find_element_by_id('gbqfq')
    search_box.send_keys('\n')
Exemplo n.º 8
0
def i_type_search_term_into_the_search_box(step, search_term):
    wd = Driver.instance(step)
    search_box = wd.find_element_by_id('gbqfq')
    search_box.send_keys(search_term)
Exemplo n.º 9
0
def i_expect_the_url_to_become_url(step, url):
    wd = Driver.instance(step)
    tools.assert_equal(wd.current_url[:len(url)], url)
Exemplo n.º 10
0
def i_open_url_in_my_web_browser(step, url):
    wd = Driver.instance(step)
    wd.get(url)