Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support switching to Iframes that are places in a Shadow Root. #5848

Closed
thakurrugved opened this issue Jan 6, 2021 · 1 comment
Closed

Comments

@thakurrugved
Copy link

What is your Test Scenario?

Use t.switchToIframe with an iframe element that is located inside a shadow root. There was an issue opened for this but got closed over the time. #3673

What is the Current behavior?

Currently, if you try to perform this, you will get the The iframe in which the test is currently operating does not exist anymore error.

What is the Expected behavior?

Support this case.

Additional context

test.html

<!DOCTYPE html>
<html>
    <head>
        <title>Test Shadow IFrame</title>
    </head>
    <body>
        <div id="shadowRootElement"></div>
        <script>
            shadowRootElement.attachShadow({mode: 'open'});

            const shadowRoot = shadowRootElement.shadowRoot;
            const iframe     = document.createElement('iframe');

            iframe.src = 'iframe.html';
            
            shadowRoot.appendChild(iframe);
        </script>
    </body>
</html>

iframe.html

<!DOCTYPE html>
<html>
    <head>
        <title>Shadow Iframe</title>
    </head>
    <body>
        <div id="logElement"></div>
        <button onclick="logElement.textContent = 'It works'">Click me</button>
    </body>
</html>

test.js

fixture `Test Shadow`
    .page`./test.html`;

test(`iframe`, async t => {
    await t
        .switchToIframe(() => shadowRootElement.shadowRoot.querySelector('iframe'))
        .click('button')
        .wait(3000);
})
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 6, 2021
@miherlosev
Copy link
Collaborator

Hi @thakurrugved,

Thank your for the example. I reopened the original #3673 issue. Please track it to be informed about its progress.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants