Skip to content

Commit 1924b7b

Browse files
added _I type {string} chars to {string}_ step (#96)
1 parent d2e916f commit 1924b7b

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
88
:beetle: - bugfix
99
:x: - deprecation
1010

11+
## [0.41.3]
12+
- :rocket: added _I type {string} chars to {string}_ step
13+
1114
## [0.41.2]
1215
- :rocket: replaced deprecated type() method with fill()
1316

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/steps-playwright",
3-
"version": "0.41.2",
3+
"version": "0.41.3",
44
"description": "steps to interact with playwright",
55
"main": "./index.js",
66
"scripts": {

src/actions.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ When('I type {string} to {string}', async function (value: string, alias: string
3535
await element.fill(typeValue);
3636
});
3737

38+
/**
39+
* Type text to element sending fine-grained keyboard events
40+
* @param {string} alias - element to type
41+
* @param {string} value - value to type
42+
* @example I type 'wikipedia' chars to 'Google Input'
43+
*/
44+
When('I type {string} chars to {string}', async function (value: string, alias: string) {
45+
const element = await getElement(alias);
46+
const typeValue = await getValue(value);
47+
await element.pressSequentially(typeValue);
48+
});
49+
3850
/**
3951
* Click element
4052
* @param {string} alias - element to click

test-e2e/features/actions.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Feature: actions
2929
When I type 'test value' to 'Input'
3030
Then I expect text of 'Action' to be equal 'test value'
3131

32+
Scenario: type chars
33+
When I type 'test value' chars to 'Input'
34+
Then I expect text of 'Action' to be equal 'test value'
35+
3236
Scenario: clear
3337
When I type 'test value' to 'Input'
3438
When I clear 'Input'

0 commit comments

Comments
 (0)