Skip to content

Commit 6c346d4

Browse files
committed
[JS] Adding keyboard tests
1 parent 1f5975e commit 6c346d4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

examples/javascript/actionsApi/keysTest.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ suite(function(env) {
3838
const textField = driver.findElement(By.id("textInput"));
3939
assert.deepStrictEqual('Ab', await textField.getAttribute('value'))
4040
});
41+
42+
it('sendKeys', async function() {
43+
await driver.get('https://www.selenium.dev/selenium/web/single_text_input.html');
44+
45+
await driver.actions()
46+
.sendKeys('abc')
47+
.perform();
48+
49+
const textField = driver.findElement(By.id("textInput"));
50+
assert.deepStrictEqual('abc', await textField.getAttribute('value'))
51+
});
52+
53+
it('Designated Element', async function() {
54+
await driver.get('https://www.selenium.dev/selenium/web/single_text_input.html');
55+
await driver.findElement(By.tagName("body")).click();
56+
57+
const textField = await driver.findElement(By.id("textInput"));
58+
await driver.actions()
59+
.sendKeys(textField, 'Selenium!')
60+
.perform();
61+
62+
assert.deepStrictEqual('Selenium!', await textField.getAttribute('value'))
63+
});
4164
});
4265
});
4366

0 commit comments

Comments
 (0)