Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
:beetle: - bugfix
:x: - deprecation

## [0.41.3]
- :rocket: added _I type {string} chars to {string}_ step

## [0.41.2]
- :rocket: replaced deprecated type() method with fill()

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qavajs/steps-playwright",
"version": "0.41.2",
"version": "0.41.3",
"description": "steps to interact with playwright",
"main": "./index.js",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ When('I type {string} to {string}', async function (value: string, alias: string
await element.fill(typeValue);
});

/**
* Type text to element sending fine-grained keyboard events
* @param {string} alias - element to type
* @param {string} value - value to type
* @example I type 'wikipedia' chars to 'Google Input'
*/
When('I type {string} chars to {string}', async function (value: string, alias: string) {
const element = await getElement(alias);
const typeValue = await getValue(value);
await element.pressSequentially(typeValue);
});

/**
* Click element
* @param {string} alias - element to click
Expand Down
4 changes: 4 additions & 0 deletions test-e2e/features/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Feature: actions
When I type 'test value' to 'Input'
Then I expect text of 'Action' to be equal 'test value'

Scenario: type chars
When I type 'test value' chars to 'Input'
Then I expect text of 'Action' to be equal 'test value'

Scenario: clear
When I type 'test value' to 'Input'
When I clear 'Input'
Expand Down