|
@@ -1,4 +1,6 @@
|
|
|
+import pytest
|
|
|
from nicegui import ui
|
|
|
+from selenium.common.exceptions import NoSuchElementException
|
|
|
|
|
|
from .user import User
|
|
|
|
|
@@ -24,6 +26,9 @@ def test_keyboard_after_startup(user: User):
|
|
|
|
|
|
user.open('/')
|
|
|
assert not any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
+ with pytest.raises(NoSuchElementException):
|
|
|
+ user.selenium.find_element_by_tag_name('span')
|
|
|
user.click('activate keyboard')
|
|
|
assert any(s.endswith('keyboard.js') for s in user.get_attributes('script', 'src'))
|
|
|
- assert user.selenium.find_element_by_tag_name('span')
|
|
|
+ user.sleep(1)
|
|
|
+ assert user.selenium.find_element_by_tag_name('span') # FIXME: ptw fails (which is correct) while pytest does not
|