Package com.microsoft.playwright.impl
Class PageAssertionsImpl
java.lang.Object
com.microsoft.playwright.impl.AssertionsBase
com.microsoft.playwright.impl.PageAssertionsImpl
- All Implemented Interfaces:
PageAssertions
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.microsoft.playwright.assertions.PageAssertions
PageAssertions.HasTitleOptions, PageAssertions.HasURLOptions -
Field Summary
FieldsFields inherited from class com.microsoft.playwright.impl.AssertionsBase
actualLocator, isNot -
Constructor Summary
ConstructorsModifierConstructorDescriptionPageAssertionsImpl(Page page) privatePageAssertionsImpl(Page page, boolean isNot) -
Method Summary
Modifier and TypeMethodDescriptionvoidhasTitle(String title, PageAssertions.HasTitleOptions options) Ensures the page has the given title.voidhasTitle(Pattern pattern, PageAssertions.HasTitleOptions options) Ensures the page has the given title.voidhasURL(String url, PageAssertions.HasURLOptions options) Ensures the page is navigated to the given URL.voidhasURL(Pattern pattern, PageAssertions.HasURLOptions options) Ensures the page is navigated to the given URL.not()Makes the assertion check for the opposite condition.Methods inherited from class com.microsoft.playwright.impl.AssertionsBase
expectedRegex, expectImpl, expectImpl, expectImplMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.microsoft.playwright.assertions.PageAssertions
hasTitle, hasTitle, hasURL, hasURL
-
Field Details
-
actualPage
-
-
Constructor Details
-
PageAssertionsImpl
-
PageAssertionsImpl
-
-
Method Details
-
hasTitle
Description copied from interface:PageAssertionsEnsures the page has the given title.**Usage**
assertThat(page).hasTitle("Playwright");- Specified by:
hasTitlein interfacePageAssertions- Parameters:
title- Expected title or RegExp.
-
hasTitle
Description copied from interface:PageAssertionsEnsures the page has the given title.**Usage**
assertThat(page).hasTitle("Playwright");- Specified by:
hasTitlein interfacePageAssertions- Parameters:
pattern- Expected title or RegExp.
-
hasURL
Description copied from interface:PageAssertionsEnsures the page is navigated to the given URL.**Usage**
assertThat(page).hasURL(".com");- Specified by:
hasURLin interfacePageAssertions- Parameters:
url- Expected URL string or RegExp.
-
hasURL
Description copied from interface:PageAssertionsEnsures the page is navigated to the given URL.**Usage**
assertThat(page).hasURL(".com");- Specified by:
hasURLin interfacePageAssertions- Parameters:
pattern- Expected URL string or RegExp.
-
not
Description copied from interface:PageAssertionsMakes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain"error":assertThat(page).not().hasURL("error");- Specified by:
notin interfacePageAssertions
-