e2ed
Version:
E2E testing framework over Playwright
18 lines (17 loc) • 651 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.switchToTab = void 0;
const tab_1 = require("../context/tab");
const step_1 = require("../step");
const playwrightPage_1 = require("../utils/playwrightPage");
/**
* Switches page context to the specified tab.
*/
const switchToTab = (tab) => (0, step_1.step)('Switch page context to the specified tab', async () => {
const { page } = tab;
const url = page.url();
(0, tab_1.setTab)(tab);
await (0, playwrightPage_1.switchPlaywrightPage)(page);
return { url };
}, { type: 5 /* LogEventType.InternalAction */ });
exports.switchToTab = switchToTab;