From 6bd61cd8c6af7c695474b1ec578cafe2385e49b1 Mon Sep 17 00:00:00 2001 From: geke-scottlogic <124575353+geke-scottlogic@users.noreply.github.com> Date: Fri, 5 Jan 2024 17:20:50 +0000 Subject: [PATCH] docs: Improve clarity on toHaveText and toContainText assertions (#28623) This closes https://github.com/microsoft/playwright/issues/28058. --- docs/src/api/class-locatorassertions.md | 4 ++-- packages/playwright/types/test.d.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index abe90782b9..7322d15cbe 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -933,7 +933,7 @@ await Expect( * langs: - alias-java: containsText -Ensures the [Locator] points to an element that contains the given text. You can use regular expressions for the value as well. +Ensures the [Locator] points to an element that contains the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well. **Details** @@ -1613,7 +1613,7 @@ Note that screenshot assertions only work with Playwright test runner. * langs: - alias-java: hasText -Ensures the [Locator] points to an element with the given text. You can use regular expressions for the value as well. +Ensures the [Locator] points to an element with the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well. **Details** diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index a67ff6e121..2cd20a69d7 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -5655,8 +5655,8 @@ interface LocatorAssertions { }): Promise; /** - * Ensures the {@link Locator} points to an element that contains the given text. You can use regular expressions for - * the value as well. + * Ensures the {@link Locator} points to an element that contains the given text. All nested elements will be + * considered when computing the text content of the element. You can use regular expressions for the value as well. * * **Details** * @@ -6069,8 +6069,8 @@ interface LocatorAssertions { }): Promise; /** - * Ensures the {@link Locator} points to an element with the given text. You can use regular expressions for the value - * as well. + * Ensures the {@link Locator} points to an element with the given text. All nested elements will be considered when + * computing the text content of the element. You can use regular expressions for the value as well. * * **Details** *