t.switchToParentWindow Method

Activates the window that launched or was active when the active window was launched. Chainable.

t.switchToParentWindow() → this | Promise<any>

Example:

fixture`TestController.switchToParentWindow`
    .page('https://testcafe.io/');

test('Switch to the parent window', async t => {
    await t
        .openWindow('https://devexpress.com')
        .switchToParentWindow();

    const url = await t.eval(() => document.documentURI);

    await t.expect(url).eql('https://testcafe.io/');
});