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

Incorrect childNodes.length after typing in an iframe #3887

Closed
AndreyBelym opened this issue May 7, 2019 · 1 comment
Closed

Incorrect childNodes.length after typing in an iframe #3887

AndreyBelym opened this issue May 7, 2019 · 1 comment
Labels
AREA: client STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AndreyBelym
Copy link
Contributor

Introduced between testcafe-hammerhead@14.4.1 and testcafe-hammerhead@14.4.2.

test.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>test iframe</title>
    <script>
        window.onload = function() {
            initializeIframe();
            document.getElementById("testIframe").contentDocument.addEventListener("keyup", onKeyUp, true);
        };

        function initializeIframe() {
            var iframe = document.getElementById("testIframe");
            iframe.contentDocument.designMode = "on";
            iframe.contentDocument.body.innerHTML = "a";
            iframe.contentWindow.focus();
        }
        function onKeyUp(e) {
            if(e.keyCode === 17) {
                var iframe = document.getElementById("testIframe"),
                    doc = iframe.contentDocument;
                doc.body.innerHTML = "=SUM(";
            }
        }
    </script>
</head>
<body>
    <iframe id="testIframe" class="dxss-inputTarget"></iframe>
</body>
</html>
test.js
import { Selector } from 'testcafe';

fixture `iframe`
    .page(`http://grivachev-w10/191/RegressionTestsSite/ASPxSpreadsheet/iframe.html`);

test('Test iframe typing', async t => {
    const iframe = Selector("#testIframe");
    const body = Selector('body');

    await t
        .switchToIframe(iframe)
        .typeText(body, "=SU", { replace: true })
        .typeText(body, "=SU", { replace: true })
        .switchToMainWindow()

        .pressKey("ctrl")

        const count = await t.eval(() => document.querySelector('iframe').contentDocument.body.childNodes.length);
        await t.expect(count).eql(1)
});
@AndreyBelym AndreyBelym transferred this issue from DevExpress/testcafe May 21, 2019
@miherlosev miherlosev transferred this issue from DevExpress/testcafe-hammerhead Jun 11, 2019
@LavrovArtem LavrovArtem added this to the Sprint #34 milestone Jun 11, 2019
@LavrovArtem LavrovArtem added AREA: client SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug). labels Jun 11, 2019
@lock
Copy link

lock bot commented Jun 23, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Jun 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants