UNPKG

e2ed

Version:

E2E testing framework over Playwright

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