Interface APIResponseAssertions


  • public interface APIResponseAssertions
    The APIResponseAssertions class provides assertion methods that can be used to make assertions about the APIResponse in the tests.
    {@code
     ...
     import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
    
     public class TestPage {
       ...
    • Method Detail

      • not

        APIResponseAssertions not()
        Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful:
        
         assertThat(response).not().isOK();
         
        Since:
        v1.20
      • isOK

        void isOK()
        Ensures the response status code is within 200..299 range.

        Usage

        
         assertThat(response).isOK();
         
        Since:
        v1.18