|
@@ -9,10 +9,9 @@ def test_joystick_dependency(user: User):
|
|
|
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)
|
|
|
- user.sleep(2) # NOTE we need to sleep here so the js timeout error is printed (start pytest with -s to see it)
|
|
|
+ sources = user.get_attributes('script', 'src')
|
|
|
+ assert any(s.endswith('joystick.js') for s in sources)
|
|
|
+ assert any(s.endswith('nipplejs.min.js') for s in sources)
|
|
|
|
|
|
|
|
|
def test_keyboard_dependency_before_startup(user: User):
|
|
@@ -22,16 +21,18 @@ def test_keyboard_dependency_before_startup(user: User):
|
|
|
|
|
|
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_keyboard_dependency_after_startup(user: User):
|
|
|
@ui.page('/')
|
|
|
def page():
|
|
|
- ui.button('activate keyboard', on_click=lambda: ui.keyboard())
|
|
|
+ def add_keyboard():
|
|
|
+ with row:
|
|
|
+ ui.keyboard()
|
|
|
+ row = ui.row()
|
|
|
+ ui.button('activate keyboard', on_click=add_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)
|