|
@@ -65,8 +65,8 @@ def test_automatic_loading_of_joystick_dependency(user: User):
|
|
|
|
|
|
user.open('/')
|
|
user.open('/')
|
|
srcs = user.get_attributes('script', 'src')
|
|
srcs = user.get_attributes('script', 'src')
|
|
- assert any(('joystick.js' in s) for s in srcs)
|
|
|
|
- assert any(('nipplejs.min.js' in s) for s in srcs)
|
|
|
|
|
|
+ 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):
|
|
def test_automatic_loading_of_keyboard_dependency_before_startup(user: User):
|
|
@@ -75,12 +75,11 @@ def test_automatic_loading_of_keyboard_dependency_before_startup(user: User):
|
|
ui.keyboard()
|
|
ui.keyboard()
|
|
|
|
|
|
user.open('/')
|
|
user.open('/')
|
|
- assert any(('keyboard.js' in s) for s in user.get_attributes('script', 'src'))
|
|
|
|
|
|
+ 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)
|
|
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):
|
|
def test_automatic_loading_of_keyboard_dependency_after_startup(user: User):
|
|
-
|
|
|
|
@ui.page('/')
|
|
@ui.page('/')
|
|
def page():
|
|
def page():
|
|
ui.button('activate keyboard', on_click=lambda: ui.keyboard())
|
|
ui.button('activate keyboard', on_click=lambda: ui.keyboard())
|
|
@@ -93,23 +92,22 @@ def test_automatic_loading_of_keyboard_dependency_after_startup(user: User):
|
|
|
|
|
|
|
|
|
|
def test_shared_and_individual_pages(user: User):
|
|
def test_shared_and_individual_pages(user: User):
|
|
-
|
|
|
|
@ui.page('/individual_page')
|
|
@ui.page('/individual_page')
|
|
def individual_page():
|
|
def individual_page():
|
|
- ui.label(f'your individual page with uuid {uuid4()}')
|
|
|
|
|
|
+ ui.label(f'individual page with uuid {uuid4()}')
|
|
|
|
|
|
@ ui.page('/shared_page', shared=True)
|
|
@ ui.page('/shared_page', shared=True)
|
|
def shared_page():
|
|
def shared_page():
|
|
- ui.label(f'a shared page with uuid {uuid4()}')
|
|
|
|
|
|
+ ui.label(f'shared page with uuid {uuid4()}')
|
|
|
|
|
|
user.open('/shared_page')
|
|
user.open('/shared_page')
|
|
- uuid1 = user.find('a shared page').text.split(' ')[-1]
|
|
|
|
|
|
+ uuid1 = user.find('shared page').text.split()[-1]
|
|
user.open('/shared_page')
|
|
user.open('/shared_page')
|
|
- uuid2 = user.find('a shared page').text.split(' ')[-1]
|
|
|
|
|
|
+ uuid2 = user.find('shared page').text.split()[-1]
|
|
assert uuid1 == uuid2
|
|
assert uuid1 == uuid2
|
|
|
|
|
|
user.open('/individual_page')
|
|
user.open('/individual_page')
|
|
- uuid1 = user.find('your individual page').text.split(' ')[-1]
|
|
|
|
|
|
+ uuid1 = user.find('individual page').text.split()[-1]
|
|
user.open('/individual_page')
|
|
user.open('/individual_page')
|
|
- uuid2 = user.find('your individual page').text.split(' ')[-1]
|
|
|
|
|
|
+ uuid2 = user.find('individual page').text.split()[-1]
|
|
assert uuid1 != uuid2
|
|
assert uuid1 != uuid2
|