Skip to content

Commit db5a139

Browse files
added into preposition to type and type chars steps (#163)
1 parent ad37830 commit db5a139

File tree

6 files changed

+60
-47
lines changed

6 files changed

+60
-47
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1414

1515
:microscope: - experimental
1616

17-
## [Unreleased]
17+
## [2.10.0]
1818
- :rocket: added step to interact with electron app menu
1919
```gherkin
2020
When I click 'Test > Open Page' electron menu
2121
```
22+
- :rocket: added `into` preposition to type and type chars steps
2223

2324
## [2.9.0]
2425
- :rocket: added capability to execute script on electron main process

package-lock.json

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/steps-playwright",
3-
"version": "2.9.0",
3+
"version": "2.10.0",
44
"description": "qavajs steps to interact with playwright",
55
"main": "./index.js",
66
"scripts": {
@@ -27,17 +27,17 @@
2727
"homepage": "https://github.com/qavajs/steps-playwright#readme",
2828
"devDependencies": {
2929
"@cucumber/cucumber": "^12.2.0",
30-
"@qavajs/console-formatter": "^1.0.0",
31-
"@qavajs/core": "^2.6.0",
32-
"@qavajs/html-formatter": "^0.18.1",
30+
"@qavajs/console-formatter": "^1.1.1",
31+
"@qavajs/core": "^2.7.0",
32+
"@qavajs/html-formatter": "^1.0.0",
3333
"@qavajs/memory": "^1.10.2",
3434
"@qavajs/validation": "^1.3.0",
3535
"@qavajs/webstorm-adapter": "^8.0.0",
3636
"@types/express": "^5.0.3",
37-
"@types/node": "^24.3.1",
37+
"@types/node": "^24.5.1",
3838
"@vitest/coverage-v8": "^3.2.4",
3939
"@vitest/ui": "^3.2.4",
40-
"electron": "^38.0.0",
40+
"electron": "^38.1.2",
4141
"express": "^5.1.0",
4242
"ts-node": "^10.9.2",
4343
"typescript": "^5.9.2",

src/actions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ When('I open {value} url', async function (url: MemoryValue): Promise<void> {
1616
* @param {string} alias - element to type
1717
* @param {string} value - value to type
1818
* @example I type 'wikipedia' to 'Google Input'
19+
* @example I type 'wikipedia' into 'Google Input'
1920
*/
20-
When('I type {value} to {playwrightLocator}', async function (value: MemoryValue, locator: Locator): Promise<void> {
21+
When('I type {value} (in)to {playwrightLocator}', async function (value: MemoryValue, locator: Locator): Promise<void> {
2122
const typeValue = await value.value()
2223
await locator.fill(typeValue);
2324
});
@@ -27,8 +28,9 @@ When('I type {value} to {playwrightLocator}', async function (value: MemoryValue
2728
* @param {string} alias - element to type
2829
* @param {string} value - value to type
2930
* @example I type 'wikipedia' chars to 'Google Input'
31+
* @example I type 'wikipedia' chars into 'Google Input'
3032
*/
31-
When('I type {value} chars to {playwrightLocator}', async function (value: MemoryValue, locator: Locator) {
33+
When('I type {value} chars (in)to {playwrightLocator}', async function (value: MemoryValue, locator: Locator) {
3234
const typeValue = await value.value();
3335
await locator.pressSequentially(typeValue);
3436
});

src/memory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { type MemoryValue, When } from '@qavajs/core';
55
* Save text of element to memory
66
* @param {string} locator - element to get value
77
* @param {string} key - key to store value
8-
* @example I save text of '#1 of Search Results' as 'firstSearchResult'
8+
* @example I save text of 'Search Results (1)' as 'firstSearchResult'
99
*/
1010
When('I save text of {playwrightLocator} as {value}', async function (locator: Locator, key: MemoryValue) {
1111
key.set(await locator.innerText());

test-e2e/features/actions.feature

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,24 @@ Feature: actions
2525
And I click '{$x}, {$y}' coordinates in 'Body'
2626
Then I expect text of 'Action' to be equal 'Button4'
2727

28-
Scenario: type
29-
When I type 'test value' to 'Input'
28+
Scenario Outline: type (<word>)
29+
When I type 'test value' <word> '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'
32+
Examples:
33+
| word |
34+
| to |
35+
| into |
36+
37+
Scenario Outline: type chars (<word>)
38+
When I type 'test value' chars <word> 'Input'
3439
Then I expect text of 'Action' to be equal 'test value'
3540

41+
Examples:
42+
| word |
43+
| to |
44+
| into |
45+
3646
Scenario: clear
3747
When I type 'test value' to 'Input'
3848
When I clear 'Input'

0 commit comments

Comments
 (0)