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: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

:microscope: - experimental

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

## [2.9.0]
- :rocket: added capability to execute script on electron main process
Expand Down
66 changes: 33 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qavajs/steps-playwright",
"version": "2.9.0",
"version": "2.10.0",
"description": "qavajs steps to interact with playwright",
"main": "./index.js",
"scripts": {
Expand All @@ -27,17 +27,17 @@
"homepage": "https://github.com/qavajs/steps-playwright#readme",
"devDependencies": {
"@cucumber/cucumber": "^12.2.0",
"@qavajs/console-formatter": "^1.0.0",
"@qavajs/core": "^2.6.0",
"@qavajs/html-formatter": "^0.18.1",
"@qavajs/console-formatter": "^1.1.1",
"@qavajs/core": "^2.7.0",
"@qavajs/html-formatter": "^1.0.0",
"@qavajs/memory": "^1.10.2",
"@qavajs/validation": "^1.3.0",
"@qavajs/webstorm-adapter": "^8.0.0",
"@types/express": "^5.0.3",
"@types/node": "^24.3.1",
"@types/node": "^24.5.1",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"electron": "^38.0.0",
"electron": "^38.1.2",
"express": "^5.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.2",
Expand Down
6 changes: 4 additions & 2 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ When('I open {value} url', async function (url: MemoryValue): Promise<void> {
* @param {string} alias - element to type
* @param {string} value - value to type
* @example I type 'wikipedia' to 'Google Input'
* @example I type 'wikipedia' into 'Google Input'
*/
When('I type {value} to {playwrightLocator}', async function (value: MemoryValue, locator: Locator): Promise<void> {
When('I type {value} (in)to {playwrightLocator}', async function (value: MemoryValue, locator: Locator): Promise<void> {
const typeValue = await value.value()
await locator.fill(typeValue);
});
Expand All @@ -27,8 +28,9 @@ When('I type {value} to {playwrightLocator}', async function (value: MemoryValue
* @param {string} alias - element to type
* @param {string} value - value to type
* @example I type 'wikipedia' chars to 'Google Input'
* @example I type 'wikipedia' chars into 'Google Input'
*/
When('I type {value} chars to {playwrightLocator}', async function (value: MemoryValue, locator: Locator) {
When('I type {value} chars (in)to {playwrightLocator}', async function (value: MemoryValue, locator: Locator) {
const typeValue = await value.value();
await locator.pressSequentially(typeValue);
});
Expand Down
2 changes: 1 addition & 1 deletion src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type MemoryValue, When } from '@qavajs/core';
* Save text of element to memory
* @param {string} locator - element to get value
* @param {string} key - key to store value
* @example I save text of '#1 of Search Results' as 'firstSearchResult'
* @example I save text of 'Search Results (1)' as 'firstSearchResult'
*/
When('I save text of {playwrightLocator} as {value}', async function (locator: Locator, key: MemoryValue) {
key.set(await locator.innerText());
Expand Down
18 changes: 14 additions & 4 deletions test-e2e/features/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,24 @@ Feature: actions
And I click '{$x}, {$y}' coordinates in 'Body'
Then I expect text of 'Action' to be equal 'Button4'

Scenario: type
When I type 'test value' to 'Input'
Scenario Outline: type (<word>)
When I type 'test value' <word> 'Input'
Then I expect text of 'Action' to be equal 'test value'

Scenario: type chars
When I type 'test value' chars to 'Input'
Examples:
| word |
| to |
| into |

Scenario Outline: type chars (<word>)
When I type 'test value' chars <word> 'Input'
Then I expect text of 'Action' to be equal 'test value'

Examples:
| word |
| to |
| into |

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