|
|
@ -1,7 +1,7 @@ |
|
|
|
""" Test the help page. """ |
|
|
|
""" Test the help page. """ |
|
|
|
|
|
|
|
|
|
|
|
from vasl_templates.webapp.tests.utils import \ |
|
|
|
from vasl_templates.webapp.tests.utils import \ |
|
|
|
init_webapp, select_menu_option, find_child, find_children |
|
|
|
init_webapp, select_menu_option, find_child, find_children, wait_for, wait_for_elem |
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- |
|
|
|
# --------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
@ -23,9 +23,26 @@ def test_help( webapp, webdriver ): |
|
|
|
|
|
|
|
|
|
|
|
# show the help |
|
|
|
# show the help |
|
|
|
select_menu_option( "show_help" ) |
|
|
|
select_menu_option( "show_help" ) |
|
|
|
webdriver.switch_to.frame( find_child( "#tabs-help iframe" ) ) |
|
|
|
|
|
|
|
assert "everyone's favorite scenario" in webdriver.page_source |
|
|
|
|
|
|
|
webdriver.switch_to.default_content() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# make sure that the HELP tab is now visible |
|
|
|
# make sure that the HELP tab is now visible |
|
|
|
assert "tabs-help" in get_tabs() |
|
|
|
assert "tabs-help" in get_tabs() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# check what's in the help iframe |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# switch to the frame |
|
|
|
|
|
|
|
webdriver.switch_to.frame( find_child( "#tabs-help iframe" ) ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# check that the content loaded OK |
|
|
|
|
|
|
|
assert "everyone's favorite scenario" in webdriver.page_source |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# check that the license loaded OK |
|
|
|
|
|
|
|
elem = wait_for_elem( 2, "a.ui-tabs-anchor[href='#helptabs-license']" ) |
|
|
|
|
|
|
|
assert elem.is_displayed() |
|
|
|
|
|
|
|
wait_for( 2, lambda: "GNU AFFERO GENERAL PUBLIC LICENSE" in webdriver.page_source ) |
|
|
|
|
|
|
|
assert "Version 3" in webdriver.page_source |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finally: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# switch back to the main window |
|
|
|
|
|
|
|
webdriver.switch_to.default_content() |
|
|
|