|
@@ -3,27 +3,17 @@ from nicegui import ui
|
|
from .user import User
|
|
from .user import User
|
|
|
|
|
|
|
|
|
|
-def test_joystick_dependency(user: User):
|
|
|
|
- @ui.page('/')
|
|
|
|
- def page():
|
|
|
|
- ui.joystick()
|
|
|
|
-
|
|
|
|
- user.open('/')
|
|
|
|
- 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):
|
|
|
|
|
|
+def test_keyboard_before_startup(user: User):
|
|
@ui.page('/')
|
|
@ui.page('/')
|
|
def page():
|
|
def page():
|
|
ui.keyboard()
|
|
ui.keyboard()
|
|
|
|
|
|
user.open('/')
|
|
user.open('/')
|
|
assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
|
+ assert user.selenium.find_element_by_tag_name('span')
|
|
|
|
|
|
|
|
|
|
-def test_keyboard_dependency_after_startup(user: User):
|
|
|
|
|
|
+def test_keyboard_after_startup(user: User):
|
|
@ui.page('/')
|
|
@ui.page('/')
|
|
def page():
|
|
def page():
|
|
def add_keyboard():
|
|
def add_keyboard():
|
|
@@ -36,3 +26,4 @@ def test_keyboard_dependency_after_startup(user: User):
|
|
assert not any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
assert not any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
user.click('activate keyboard')
|
|
user.click('activate keyboard')
|
|
assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
|
+ assert user.selenium.find_element_by_tag_name('span')
|