Class PageAssertionsImpl

    • Field Detail

      • actualPage

        private final PageImpl actualPage
    • Constructor Detail

      • PageAssertionsImpl

        public PageAssertionsImpl​(Page page)
      • PageAssertionsImpl

        private PageAssertionsImpl​(Page page,
                                   boolean isNot)
    • Method Detail

      • hasTitle

        public void hasTitle​(java.lang.String title,
                             PageAssertions.HasTitleOptions options)
        Description copied from interface: PageAssertions
        Ensures the page has the given title.

        **Usage**

        
         assertThat(page).hasTitle("Playwright");
         
        Specified by:
        hasTitle in interface PageAssertions
        Parameters:
        title - Expected title or RegExp.
      • hasTitle

        public void hasTitle​(java.util.regex.Pattern pattern,
                             PageAssertions.HasTitleOptions options)
        Description copied from interface: PageAssertions
        Ensures the page has the given title.

        **Usage**

        
         assertThat(page).hasTitle("Playwright");
         
        Specified by:
        hasTitle in interface PageAssertions
        Parameters:
        pattern - Expected title or RegExp.
      • hasURL

        public void hasURL​(java.lang.String url,
                           PageAssertions.HasURLOptions options)
        Description copied from interface: PageAssertions
        Ensures the page is navigated to the given URL.

        **Usage**

        
         assertThat(page).hasURL(".com");
         
        Specified by:
        hasURL in interface PageAssertions
        Parameters:
        url - Expected URL string or RegExp.
      • hasURL

        public void hasURL​(java.util.regex.Pattern pattern,
                           PageAssertions.HasURLOptions options)
        Description copied from interface: PageAssertions
        Ensures the page is navigated to the given URL.

        **Usage**

        
         assertThat(page).hasURL(".com");
         
        Specified by:
        hasURL in interface PageAssertions
        Parameters:
        pattern - Expected URL string or RegExp.
      • not

        public PageAssertions not()
        Description copied from interface: PageAssertions
        Makes 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:
        not in interface PageAssertions