Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Jun 11, 2024
1 parent 87b186f commit d689846
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions splinter/driver/webdriver/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ def down(self, key: str) -> None:
key_value = getattr(Keys, key)

chain = ActionChains(self.driver)
chain.key_down(key_value)
chain.perform()
chain.key_down(key_value).perform()

def up(self, key: str) -> None:
key_value = getattr(Keys, key)

chain = ActionChains(self.driver)
chain.key_up(key_value)
chain.perform()
chain.key_up(key_value).perform()

def press(self, key: str, delay: int = 0) -> None:
key_pattern = key.split("+")
Expand Down
4 changes: 4 additions & 0 deletions tests/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def test_element_press_tab(self):

elem.press("TAB")

raise Exception(self.browser.driver.switch_to.active_element)

assert next_elem == self.browser.driver.switch_to.active_element

@skip_if_zope
Expand All @@ -51,4 +53,6 @@ def test_element_press_combo(self):
elem = self.browser.find_by_css("[name='q']")
elem.press("SHIFT+a+b+c+BACKSPACE")

raise Exception(elem.text)

assert elem.text == "AB"

0 comments on commit d689846

Please sign in to comment.