Skip to content

Commit

Permalink
edit existing testcase for multi input devices
Browse files Browse the repository at this point in the history
  • Loading branch information
kkb912002 committed Mar 19, 2024
1 parent 324a656 commit 3ab9f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions py/test/selenium/webdriver/common/interactions_tests.py
Expand Up @@ -207,15 +207,14 @@ def test_sending_keys_to_element(driver, pages):
assert "abc" == e.get_attribute("value")


def test_can_send_keys_between_clicks(driver, pages):
def test_can_perform_actions_with_multiple_devices(driver, pages):
"""
For W3C, ensures that the correct number of pauses are given to the other
input device.
"""
pages.load("javascriptPage.html")
keyup = driver.find_element(By.ID, "keyUp")
keydown = driver.find_element(By.ID, "keyDown")
ActionChains(driver).click(keyup).send_keys("foobar").click(keydown).perform()
ActionChains(driver).click(keyup).scroll_by_amount(0, 100).send_keys("foobar").perform()

assert "foobar" == keyup.get_attribute("value")

Expand Down
Expand Up @@ -193,18 +193,21 @@ def test_sending_keys_to_element_with_keyboard(driver, pages):
assert "abc" == e.get_attribute("value")


def test_can_send_keys_between_clicks_with_keyboard(driver, pages):
def test_can_perform_actions_with_multiple_input_devices(driver, pages):
"""
For W3C, ensures that the correct number of pauses are given to the other
input device.
"""
pages.load("javascriptPage.html")
keyup = driver.find_element(By.ID, "keyUp")
keydown = driver.find_element(By.ID, "keyDown")

mouse = PointerInput(interaction.POINTER_MOUSE, "test mouse")
key_board = KeyInput("test keyboard")
wheel = WheelInput("test wheel")

devices = [mouse, key_board, wheel]

ActionChains(driver, devices=[key_board]).click(keyup).send_keys("foobar").click(keydown).perform()
ActionChains(driver, devices=devices).click(keyup).scroll_by_amount(0, 100).send_keys("foobar").perform()

assert "foobar" == keyup.get_attribute("value")

Expand Down

0 comments on commit 3ab9f78

Please sign in to comment.