Class RequestHelper

Setup


export type TestOptions = {
requestHelper: RequestHelper;
};

export const test = base.extend<TestOptions>({
requestHelper: async ({ page }, use) => {
use(new RequestHelper(page));
}
});

Usage

     test('has title', async ({ page, requestHelper }) => {
await requestHelper.waitForResponse("/queries", page.type('.DocSearch-Input', 'network'))
});

Hierarchy

  • RequestHelper

Constructors

Properties

page: Page
tracker: RequestManager

Methods

  • Verify that all xhr requests are completed before we continue

    Parameters

    • action: any

      playwright action type click etc full command i.e. page.click('button')

    Returns Promise<any>

  • Verify that a certain repsponse is received after an action is performed

    Parameters

    • reqURL: string

      regular expression of the API URL can be relative

    • action: any

      playwright action type click etc full command i.e. page.click('button')

    Returns Promise<Response>

    Promise

  • Verifies a given response code is matching the response status of the request Returns an error message if expect is failing

    Parameters

    • response: APIResponse
    • statusCode: number

    Returns Promise<void>

Generated using TypeDoc