@@ -1046,8 +1046,8 @@ class NavigateOptions {
10461046 * <ul>
10471047 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
10481048 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1049- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1050- * ms .</li>
1049+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1050+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
10511051 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
10521052 * </ul>
10531053 */
@@ -1076,8 +1076,8 @@ public NavigateOptions setTimeout(double timeout) {
10761076 * <ul>
10771077 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
10781078 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1079- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1080- * ms .</li>
1079+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1080+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
10811081 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
10821082 * </ul>
10831083 */
@@ -1476,6 +1476,19 @@ class LocatorOptions {
14761476 * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
14771477 */
14781478 public Locator has ;
1479+ /**
1480+ * Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
1481+ * outer one. For example, {@code article} that does not have {@code div} matches {@code
1482+ * <article><span>Playwright</span></article>}.
1483+ *
1484+ * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
1485+ */
1486+ public Locator hasNot ;
1487+ /**
1488+ * Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1489+ * passed a [string], matching is case-insensitive and searches for a substring.
1490+ */
1491+ public Object hasNotText ;
14791492 /**
14801493 * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
14811494 * [string], matching is case-insensitive and searches for a substring. For example, {@code "Playwright"} matches {@code
@@ -1493,6 +1506,33 @@ public LocatorOptions setHas(Locator has) {
14931506 this .has = has ;
14941507 return this ;
14951508 }
1509+ /**
1510+ * Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
1511+ * outer one. For example, {@code article} that does not have {@code div} matches {@code
1512+ * <article><span>Playwright</span></article>}.
1513+ *
1514+ * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
1515+ */
1516+ public LocatorOptions setHasNot (Locator hasNot ) {
1517+ this .hasNot = hasNot ;
1518+ return this ;
1519+ }
1520+ /**
1521+ * Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1522+ * passed a [string], matching is case-insensitive and searches for a substring.
1523+ */
1524+ public LocatorOptions setHasNotText (String hasNotText ) {
1525+ this .hasNotText = hasNotText ;
1526+ return this ;
1527+ }
1528+ /**
1529+ * Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1530+ * passed a [string], matching is case-insensitive and searches for a substring.
1531+ */
1532+ public LocatorOptions setHasNotText (Pattern hasNotText ) {
1533+ this .hasNotText = hasNotText ;
1534+ return this ;
1535+ }
14961536 /**
14971537 * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
14981538 * [string], matching is case-insensitive and searches for a substring. For example, {@code "Playwright"} matches {@code
@@ -1751,8 +1791,8 @@ class SetContentOptions {
17511791 * <ul>
17521792 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
17531793 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1754- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1755- * ms .</li>
1794+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1795+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
17561796 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
17571797 * </ul>
17581798 */
@@ -1773,8 +1813,8 @@ public SetContentOptions setTimeout(double timeout) {
17731813 * <ul>
17741814 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
17751815 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1776- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1777- * ms .</li>
1816+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1817+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
17781818 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
17791819 * </ul>
17801820 */
@@ -2188,8 +2228,8 @@ class WaitForNavigationOptions {
21882228 * <ul>
21892229 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
21902230 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2191- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2192- * ms .</li>
2231+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2232+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
21932233 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
21942234 * </ul>
21952235 */
@@ -2237,8 +2277,8 @@ public WaitForNavigationOptions setUrl(Predicate<String> url) {
22372277 * <ul>
22382278 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
22392279 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2240- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2241- * ms .</li>
2280+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2281+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
22422282 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
22432283 * </ul>
22442284 */
@@ -2318,8 +2358,8 @@ class WaitForURLOptions {
23182358 * <ul>
23192359 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
23202360 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2321- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2322- * ms .</li>
2361+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2362+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
23232363 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
23242364 * </ul>
23252365 */
@@ -2340,8 +2380,8 @@ public WaitForURLOptions setTimeout(double timeout) {
23402380 * <ul>
23412381 * <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
23422382 * <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2343- * <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2344- * ms .</li>
2383+ * <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2384+ * least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead .</li>
23452385 * <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
23462386 * </ul>
23472387 */
@@ -4849,7 +4889,8 @@ default JSHandle waitForFunction(String expression) {
48494889 * <ul>
48504890 * <li> {@code "load"} - wait for the {@code load} event to be fired.</li>
48514891 * <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
4852- * <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
4892+ * <li> {@code "networkidle"} - **DISCOURAGED** wait until there are no network connections for at least {@code 500} ms. Don't
4893+ * use this method for testing, rely on web assertions to assess readiness instead.</li>
48534894 * </ul>
48544895 * @since v1.8
48554896 */
@@ -4890,7 +4931,8 @@ default void waitForLoadState() {
48904931 * <ul>
48914932 * <li> {@code "load"} - wait for the {@code load} event to be fired.</li>
48924933 * <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
4893- * <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
4934+ * <li> {@code "networkidle"} - **DISCOURAGED** wait until there are no network connections for at least {@code 500} ms. Don't
4935+ * use this method for testing, rely on web assertions to assess readiness instead.</li>
48944936 * </ul>
48954937 * @since v1.8
48964938 */
0 commit comments