UNPKG

e2ed

Version:

E2E testing framework over Playwright

19 lines (18 loc) 735 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.switchToMainTab = void 0; const tab_1 = require("../context/tab"); const step_1 = require("../step"); const useContext_1 = require("../useContext"); const playwrightPage_1 = require("../utils/playwrightPage"); /** * Switches page context to the specified tab. */ const switchToMainTab = () => (0, step_1.step)('Switch page context to the main tab', async () => { (0, tab_1.clearTab)(); const page = (0, useContext_1.getPlaywrightPage)(); const url = page.url(); await (0, playwrightPage_1.switchPlaywrightPage)(page); return { url }; }, { type: 5 /* LogEventType.InternalAction */ }); exports.switchToMainTab = switchToMainTab;