forked from DevExpress/testcafe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
040f316
commit c5dc73e
Showing
4 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/functional/fixtures/regression/gh-3887/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>GH-3887</title> | ||
<script> | ||
window.onload = function () { | ||
var iframe = document.querySelector('iframe'); | ||
iframe.contentDocument.designMode = 'on'; | ||
iframe.contentDocument.body.innerHTML = 'a'; | ||
iframe.contentWindow.focus(); | ||
}; | ||
</script> | ||
</head> | ||
<body> | ||
<iframe></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
describe('[Regression](GH-3887)', () => { | ||
it('Should correctly return childNodes.length after typing in an iframe', () => runTests('testcafe-fixtures/index.js')); | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/functional/fixtures/regression/gh-3887/testcafe-fixtures/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
fixture`gh-3887` | ||
.page`http://localhost:3000/fixtures/regression/gh-3887/pages/index.html`; | ||
|
||
test('Check body.childNodes.length after typing in an iframe', async t => { | ||
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); | ||
}); |