|
@@ -58,39 +58,6 @@ def test_creating_new_page_after_startup(user: User):
|
|
|
user.should_see('page created after startup')
|
|
|
|
|
|
|
|
|
-def test_automatic_loading_of_joystick_dependency(user: User):
|
|
|
- @ui.page('/')
|
|
|
- def page():
|
|
|
- ui.joystick()
|
|
|
-
|
|
|
- user.open('/')
|
|
|
- srcs = user.get_attributes('script', 'src')
|
|
|
- assert any(s.endswith('joystick.js') for s in srcs)
|
|
|
- assert any(s.endswith('nipplejs.min.js') for s in srcs)
|
|
|
-
|
|
|
-
|
|
|
-def test_automatic_loading_of_keyboard_dependency_before_startup(user: User):
|
|
|
- @ui.page('/')
|
|
|
- def page():
|
|
|
- ui.keyboard()
|
|
|
-
|
|
|
- user.open('/')
|
|
|
- assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
- user.sleep(2) # NOTE we need to sleep here so the js timeout error is printed (start pytest with -s to see it)
|
|
|
-
|
|
|
-
|
|
|
-def test_automatic_loading_of_keyboard_dependency_after_startup(user: User):
|
|
|
- @ui.page('/')
|
|
|
- def page():
|
|
|
- ui.button('activate keyboard', on_click=lambda: ui.keyboard())
|
|
|
-
|
|
|
- user.open('/')
|
|
|
- assert not any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
- user.click('activate keyboard')
|
|
|
- assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
- user.sleep(2) # NOTE we need to sleep here so the js timeout error is printed (start pytest with -s to see it)
|
|
|
-
|
|
|
-
|
|
|
def test_shared_and_individual_pages(user: User):
|
|
|
@ui.page('/individual_page')
|
|
|
def individual_page():
|