UNPKG

e2ed

Version:

E2E testing framework over Playwright

29 lines (28 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.navigateToUrl = void 0; const internal_1 = require("../constants/internal"); const step_1 = require("../step"); const useContext_1 = require("../useContext"); /** * Navigates to the `url` (without waiting of interface stabilization). */ const navigateToUrl = async (url, options = {}) => { const { skipLogs = false, timeout } = options; let statusCode; await (0, step_1.step)(`Navigate to ${url}`, async () => { const page = (0, useContext_1.getPlaywrightPage)(); const maybeResponse = await page.goto(url, options); if (maybeResponse !== null) { statusCode = maybeResponse.status(); } return { statusCode }; }, { payload: options, skipLogs, ...(timeout !== undefined ? { timeout: timeout + internal_1.ADDITIONAL_STEP_TIMEOUT } : undefined), type: 5 /* LogEventType.InternalAction */, }); return { statusCode }; }; exports.navigateToUrl = navigateToUrl;