UNPKG

pw-api-plugin

Version:

Playwright plugin for comprehensive API testing and result presentation using the Playwright UI, Trace Viewer, and HTML Report. It significantly aids debugging processes and supports both Playwright's native API and Axios requests.

16 lines (15 loc) 575 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.testApi = void 0; const test_1 = require("@playwright/test"); /** * A conditional Playwright test extension based on the `LOG_API_UI` environment variable. * If `LOG_API_UI` is not set to 'false', the base API is used as-is. * Otherwise, the base API is extended with the `page` fixture disabled. */ exports.testApi = (process.env.LOG_API_UI !== 'false') ? test_1.test : test_1.test.extend({ page: async ({}, use) => { // @ts-ignore await use(undefined); }, });