Skip to content

Commit 5ddc819

Browse files
added support of memory values in _I click '$value' text in 'collection' collection_ (#37)
1 parent bc73167 commit 5ddc819

File tree

8 files changed

+115
-78
lines changed

8 files changed

+115
-78
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 0.0.17
22
- :rocket: added _I force click_ step
3+
- :beetle: added support of memory values in _I click '$value' text in 'collection' collection_
34

45
## 0.0.16
56
- :beetle: fixed optional params templates in wait steps

package-lock.json

Lines changed: 94 additions & 68 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
@@ -23,11 +23,11 @@
2323
},
2424
"homepage": "https://github.com/qavajs/steps-playwright#readme",
2525
"devDependencies": {
26-
"@cucumber/cucumber": "^9.0.1",
27-
"@qavajs/cli": "^0.0.19",
28-
"@qavajs/console-formatter": "^0.2.0",
26+
"@cucumber/cucumber": "^9.1.0",
27+
"@qavajs/cli": "^0.0.20",
28+
"@qavajs/console-formatter": "^0.2.1",
2929
"@qavajs/memory": "^1.2.0",
30-
"@qavajs/po-playwright": "^0.0.7",
30+
"@qavajs/po-playwright": "^0.0.8",
3131
"@qavajs/webstorm-adapter": "^8.0.0",
3232
"@qavajs/xunit-formatter": "^0.0.3",
3333
"@types/chai": "^4.3.4",
@@ -38,8 +38,8 @@
3838
"typescript": "^5.0.2"
3939
},
4040
"dependencies": {
41-
"@playwright/test": "^1.31.2",
41+
"@playwright/test": "^1.32.1",
4242
"@qavajs/validation": "^0.0.4",
43-
"playwright": "^1.31.2"
43+
"playwright": "^1.32.1"
4444
}
4545
}

src/actions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ When('I select {int}(st|nd|rd|th) option from {string} dropdown', async function
184184
* @param {string} expectedText - text to click
185185
* @param {string} alias - collection to search text
186186
* @example I click 'google' text in 'Search Engines' collection
187+
* @example I click '$someVarWithText' text in 'Search Engines' collection
187188
*/
188189
When(
189190
'I click {string} text in {string} collection',
190191
async function (value: string, alias: string) {
192+
const resolvedValue = await getValue(value);
191193
const collection = await getElement(alias);
192-
await collection.getByText(value).click();
194+
await collection.getByText(resolvedValue).click();
193195
}
194196
);
195197

src/waits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ When(
135135
async function (waitType: string, value: string, timeout: number | null) {
136136
const wait = getValueWait(waitType);
137137
const expectedValue = await getValue(value);
138-
const getValueFn = () => page.url();
138+
const getValueFn = async () => page.url();
139139
await wait(getValueFn, expectedValue, timeout ? timeout : config.browser.timeout.page);
140140
}
141141
);

0 commit comments

Comments
 (0)