UNPKG

e2ed

Version:

E2E testing framework over Playwright

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