Skip to content

Commit 5926066

Browse files
Merge pull request #31 from qavajs/into-preposition
added `into` preposition to type and type chars steps
2 parents 0f7fd9c + a4ad7c0 commit 5926066

File tree

8 files changed

+38
-25
lines changed

8 files changed

+38
-25
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1010
:pencil: - chore
1111
:microscope: - experimental
1212

13+
## [Unreleased]
14+
- :rocket: added `into` preposition to type and type chars steps
15+
1316
## [3.4.0]
1417
- :rocket: added `electron` world property to interact with main electron process
1518
- :rocket: added step to interact with electron app menu

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ npm install @qavajs/playwright
88
```
99

1010
## Configuration
11-
cucumber.ts
11+
create `config.ts`
1212
```typescript
1313
import Memory from './memory';
1414
import App from './page_object';
@@ -29,7 +29,7 @@ import { defineCucumber } from '@qavajs/playwright';
2929

3030
export default defineConfig({
3131
testDir: defineCucumber({
32-
config: 'test-e2e/config.ts',
32+
config: 'config.ts',
3333
profile: 'smoke'
3434
}),
3535
...

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"homepage": "https://github.com/qavajs/playwright#readme",
2727
"devDependencies": {
2828
"@types/express": "^5.0.3",
29-
"@types/node": "^24.3.1",
30-
"electron": "^38.0.0",
29+
"@types/node": "^24.5.2",
30+
"electron": "^38.1.2",
3131
"express": "^5.1.0",
3232
"ts-node": "^10.9.2",
3333
"typescript": "^5.9.2"

src/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ When('I open {value} url', async function (this: QavajsPlaywrightWorld, url: Mem
1919
* @param {string} value - value to type
2020
* @example I type 'wikipedia' to 'Google Input'
2121
*/
22-
When('I type {value} to {locator}', async function (this: QavajsPlaywrightWorld, type: MemoryValue, locator: Locator) {
22+
When('I type {value} (in)to {locator}', async function (this: QavajsPlaywrightWorld, type: MemoryValue, locator: Locator) {
2323
await locator.fill(await type.value());
2424
});
2525

@@ -29,7 +29,7 @@ When('I type {value} to {locator}', async function (this: QavajsPlaywrightWorld,
2929
* @param {string} value - value to type
3030
* @example I type 'wikipedia' chars to 'Google Input'
3131
*/
32-
When('I type {value} chars to {locator}', async function (this: QavajsPlaywrightWorld, type: MemoryValue, locator: Locator) {
32+
When('I type {value} chars (in)to {locator}', async function (this: QavajsPlaywrightWorld, type: MemoryValue, locator: Locator) {
3333
await locator.pressSequentially(await type.value());
3434
});
3535

src/memory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MemoryValue } from './types';
88
* Save text of element to memory
99
* @param {string} alias - element to get value
1010
* @param {string} key - key to store value
11-
* @example I save text of '#1 of Search Results' as 'firstSearchResult'
11+
* @example I save text of 'Search Results (1)' as 'firstSearchResult'
1212
*/
1313
When('I save text of {locator} as {value}', async function (locator: Locator, key: MemoryValue) {
1414
const value = await locator.innerText();

src/validations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Then('I expect {locator} {state}', async function (locator: Locator, expect: Sta
2121
* @param {string} alias - element to get text
2222
* @param {string} validationType - validation
2323
* @param {string} value - expected result
24-
* @example I expect text of '#1 of Search Results' equals to 'google'
25-
* @example I expect text of '#2 of Search Results' does not contain 'yahoo'
24+
* @example I expect text of 'Search Results (1)' equals to 'google'
25+
* @example I expect text of 'Search Results (2)' does not contain 'yahoo'
2626
*/
2727
Then(
2828
'I expect text of {locator} {validation} {value}',

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)