Rodja Trappe 2 years ago
parent
commit
c215383589
2 changed files with 2 additions and 5 deletions
  1. 1 1
      tests/test_dialog.py
  2. 1 4
      tests/test_keyboard.py

+ 1 - 1
tests/test_dialog.py

@@ -42,6 +42,6 @@ def test_await_dialog(screen: Screen):
     screen.click('Open')
     screen.click('No')
     screen.click('Open')
-    ActionChains(screen.selenium).send_keys(Keys.ESCAPE).perform()
+    screen.type(Keys.ESCAPE)
     screen.wait(0.5)
     assert results == ['Yes', 'No', None]

+ 1 - 4
tests/test_keyboard.py

@@ -1,4 +1,3 @@
-from selenium.webdriver.common.action_chains import ActionChains
 from selenium.webdriver.common.by import By
 
 from nicegui import ui
@@ -13,7 +12,5 @@ def test_keyboard(screen: Screen):
     screen.open('/')
     assert screen.selenium.find_element(By.ID, keyboard.id)
     screen.wait(1.0)
-    ActionChains(screen.selenium) \
-        .send_keys('t') \
-        .perform()
+    screen.type('t')
     screen.should_contain('t, KeyboardAction(keydown=False, keyup=True, repeat=False)')