Revision c699b640
Added by koszko over 1 year ago
test/unit/test_basic.py | ||
---|---|---|
26 | 26 |
""" |
27 | 27 |
for proto in ['http://', 'https://']: |
28 | 28 |
driver.get(proto + 'gotmyowndoma.in') |
29 |
element = driver.find_element_by_tag_name('title') |
|
30 |
title = driver.execute_script('return arguments[0].innerText;', element) |
|
29 |
title = driver.execute_script( |
|
30 |
'return document.getElementsByTagName("title")[0].innerText;' |
|
31 |
) |
|
31 | 32 |
assert "Schrodinger's Document" in title |
32 | 33 |
|
33 | 34 |
def test_script_loader(execute_in_page, load_into_page): |
... | ... | |
39 | 40 |
page='https://gotmyowndoma.in') |
40 | 41 |
|
41 | 42 |
assert execute_in_page('returnval(TYPE_PREFIX.VAR);') == '_' |
43 |
|
|
44 |
@pytest.mark.ext_data({}) |
|
45 |
def test_webextension(driver, webextension): |
|
46 |
""" |
|
47 |
A trivial test case that verifies a test WebExtension created and installed |
|
48 |
by the `webextension` fixture works and redirects specially-constructed URLs |
|
49 |
to its test page. |
|
50 |
""" |
|
51 |
heading = driver.execute_script( |
|
52 |
'return document.getElementsByTagName("h1")[0].innerText;' |
|
53 |
) |
|
54 |
assert "Extension's options page for testing" in heading |
Also available in: Unified diff
facilitate creating and installing WebExtensions during tests
It is now possible to more conveniently test WebExtension APIs code by wrapping it into a test WebExtension and temporarily installing in the driven browser.