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 #3673

Closed
AndreyBelym opened this issue Apr 11, 2019 · 8 comments · Fixed by #7139
Closed

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

AndreyBelym opened this issue Apr 11, 2019 · 8 comments · Fixed by #7139
Assignees
Labels
AREA: client FREQUENCY: level 2 SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).

Comments

@AndreyBelym
Copy link
Contributor

Related: https://stackoverflow.com/questions/55504936/accessing-an-iframe-within-shadow-dom-using-testcafe

What is your Test Scenario?

Use t.switchToIframe with an iframe element that is located inside a shadow root.

What are you suggesting?

Support this case. 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.

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);
})
@AndreyBelym AndreyBelym added TYPE: enhancement The accepted proposal for future implementation. AREA: client SYSTEM: driver labels Apr 11, 2019
@AndreyBelym AndreyBelym added this to Test API Suggestions in Enhancements processing Jul 15, 2019
@AndreyBelym AndreyBelym changed the title Supoort switching to Iframes that are places in a Shadow Root Support switching to Iframes that are places in a Shadow Root Aug 8, 2019
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

@github-actions github-actions bot added the STATE: Stale An outdated issue that will be automatically closed by the Stale bot. label Nov 25, 2020
@github-actions
Copy link

github-actions bot commented Dec 5, 2020

We're closing this issue after a prolonged period of inactivity. If it still affects you, please create a new issue with up-to-date information. Thank you.

@github-actions github-actions bot closed this as completed Dec 5, 2020
Enhancements processing automation moved this from Test API Suggestions to Closed Dec 5, 2020
@miherlosev miherlosev removed the STATE: Stale An outdated issue that will be automatically closed by the Stale bot. label Jan 8, 2021
@miherlosev miherlosev reopened this Jan 8, 2021
Enhancements processing automation moved this from Closed to NEEDS TRIAGE Jan 8, 2021
@jzhang52
Copy link

We ran into this issue of testcafe, which became a blocker for automating certain UI features of ours. Do you have a timeline on putting in this support yet? We'd be very interested in trying it out when you do. @miherlosev

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Aug 19, 2021
@miherlosev
Copy link
Collaborator

Hi @jzhang52

We cannot give you an estimate for this feature's release. We will update this thread as soon as we have news.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Aug 23, 2021
@mostlyfabulous
Copy link
Contributor

Just wanted to say we'd be making use of this when it's ready!

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 17, 2021
@AlexSkorkin AlexSkorkin removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 19, 2021
@ddoice
Copy link

ddoice commented Mar 7, 2022

Nowadays working with shadow dom is quite common, isn't there a way to fix this?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 7, 2022
@AlexKamaev
Copy link
Contributor

@ddoice
The described issue still exists and, at present, I cannot give you an estimate on this.

Nowadays working with shadow dom is quite common, isn't there a way to fix this?

We agree with you and we are working on ShadowRoot support. For example, we introduced a special .shadowRoot() method, which allows querying shadow elements easily. If you are not familiar with this method, take a look at https://testcafe.io/documentation/402745/reference/test-api/selector/shadowroot

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 8, 2022
@AlexKamaev AlexKamaev added TYPE: bug The described behavior is considered as wrong (bug). FREQUENCY: level 2 and removed TYPE: enhancement The accepted proposal for future implementation. labels Mar 8, 2022
@Aleksey28 Aleksey28 self-assigned this Jul 7, 2022
Enhancements processing automation moved this from NEEDS TRIAGE to Closed Jul 20, 2022
@github-actions
Copy link

Release v1.20.1-rc.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client FREQUENCY: level 2 SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants