Skip to content

Commit 5219445

Browse files
committed
containsText Assertion
1 parent 7bd10f2 commit 5219445

File tree

3 files changed

+41
-36
lines changed

3 files changed

+41
-36
lines changed

lib/WebActions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ export class WebActions {
128128
expect(textValue.trim()).toBe(text);
129129
}
130130

131+
async verifyElementContainsTest(locator: string, text: string): Promise<void> {
132+
await this.waitForElementAttached(locator);
133+
await expect(this.page.locator(locator)).toContainText(text);
134+
}
135+
131136
async verifyJSElementValue(locator: string, text: string): Promise<void> {
132137
await this.waitForElementAttached(locator);
133138
const textValue = await this.page.$eval(locator, (element: HTMLInputElement) => element.value);

package-lock.json

Lines changed: 34 additions & 34 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
@@ -24,8 +24,8 @@
2424
"dependencies": {
2525
"@playwright/test": "^1.14.1",
2626
"@types/crypto-js": "^4.0.2",
27-
"@typescript-eslint/eslint-plugin": "^4.30.0",
28-
"@typescript-eslint/parser": "^4.30.0",
27+
"@typescript-eslint/eslint-plugin": "^4.31.0",
28+
"@typescript-eslint/parser": "^4.31.0",
2929
"crypto-js": "^4.1.1",
3030
"eslint": "^7.32.0",
3131
"eslint-plugin-import": "^2.24.2",

0 commit comments

Comments
 (0)