Package com.microsoft.playwright.impl
Class PageAssertionsImpl
- java.lang.Object
-
- com.microsoft.playwright.impl.AssertionsBase
-
- com.microsoft.playwright.impl.PageAssertionsImpl
-
- All Implemented Interfaces:
PageAssertions
public class PageAssertionsImpl extends AssertionsBase implements PageAssertions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.playwright.assertions.PageAssertions
PageAssertions.HasTitleOptions, PageAssertions.HasURLOptions
-
-
Field Summary
Fields Modifier and Type Field Description private PageImplactualPage-
Fields inherited from class com.microsoft.playwright.impl.AssertionsBase
actualLocator, isNot
-
-
Constructor Summary
Constructors Modifier Constructor Description PageAssertionsImpl(Page page)privatePageAssertionsImpl(Page page, boolean isNot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhasTitle(java.lang.String title, PageAssertions.HasTitleOptions options)Ensures the page has the given title.voidhasTitle(java.util.regex.Pattern pattern, PageAssertions.HasTitleOptions options)Ensures the page has the given title.voidhasURL(java.lang.String url, PageAssertions.HasURLOptions options)Ensures the page is navigated to the given URL.voidhasURL(java.util.regex.Pattern pattern, PageAssertions.HasURLOptions options)Ensures the page is navigated to the given URL.PageAssertionsnot()Makes the assertion check for the opposite condition.-
Methods inherited from class com.microsoft.playwright.impl.AssertionsBase
expectedRegex, expectImpl, expectImpl, expectImpl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.playwright.assertions.PageAssertions
hasTitle, hasTitle, hasURL, hasURL
-
-
-
-
Field Detail
-
actualPage
private final PageImpl actualPage
-
-
Method Detail
-
hasTitle
public void hasTitle(java.lang.String title, PageAssertions.HasTitleOptions options)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
public void hasTitle(java.util.regex.Pattern pattern, PageAssertions.HasTitleOptions options)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
public void hasURL(java.lang.String url, PageAssertions.HasURLOptions options)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
public void hasURL(java.util.regex.Pattern pattern, PageAssertions.HasURLOptions options)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
public PageAssertions 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
-
-