Skip to content

Commit 791f221

Browse files
Update validation.mdx (#106)
1 parent 74d20f3 commit 791f221

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

versioned_docs/version-2x/Guides/validation.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ Validation with auto-retries
144144
const { getPollValidation } = require('@qavajs/validation');
145145

146146
Then('I expect the answer {validation} {string}', async function(validate, expected) {
147-
const answer = getAnswer();
147+
const answer = async () => this.page.locator('answer').innerText();
148148
await validate.poll(answer, expected, { timeout: 2000, interval: 500 });
149149
});
150150

151151
Then('I expect the answer {} {string}', async function(validationType, expected) {
152-
const answer = getAnswer();
152+
const answer = async () => this.page.locator('answer').innerText();
153153
const validate = getPollValidation(validationType);
154154
await validate(getAnswer, expected, { timeout: 2000, interval: 500 });
155155
});
@@ -161,12 +161,12 @@ Validation with auto-retries
161161
import { getPollValidation } from '@qavajs/validation';
162162

163163
Then('I expect the answer {validation} {string}', async function(validate: Validation, expected: string) {
164-
const answer = getAnswer();
165-
await validate.poll(answer, expected);
164+
const answer = async () => this.page.locator('answer').innerText();
165+
await validate.poll(answer, expected, { timeout: 2000, interval: 500 });
166166
});
167167

168168
Then('I expect the answer {} {string}', async function(validationType: string, expected: string) {
169-
const answer = getAnswer();
169+
const answer = async () => this.page.locator('answer').innerText();
170170
const validate = getPollValidation(validationType);
171171
await validate(getAnswer, expected, { timeout: 2000, interval: 500 });
172172
});

0 commit comments

Comments
 (0)