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
44ca231
commit aca42f4
Showing
10 changed files
with
105 additions
and
18 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
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
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
10 changes: 10 additions & 0 deletions
10
test/functional/fixtures/regression/gh-1842/pages/iframe.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,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>GH-1842 iframe</title> | ||
</head> | ||
<body> | ||
<h1>GH-1842 iframe</h1> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
test/functional/fixtures/regression/gh-1842/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,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>GH-1842</title>> | ||
</head> | ||
<body> | ||
<h1>GH-1842</h1> | ||
<iframe id="reloading-iframe" src="reloading-iframe.html?delay=1000"></iframe> | ||
<iframe id="iframe" src="iframe.html?delay=1000"></iframe> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
test/functional/fixtures/regression/gh-1842/pages/reloading-iframe.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,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>GH-1842 reloading iframe</title> | ||
</head> | ||
<body> | ||
<h1>GH-1842 reloading iframe</h1> | ||
<script> | ||
window.setTimeout(function () { | ||
if (!window.top.iframeReloads) | ||
window.top.iframeReloads = 0; | ||
|
||
if (window.top.iframeReloads < 3) { | ||
window.top.iframeReloads++; | ||
document.location.href = document.location.href; | ||
} | ||
}, 0); | ||
</script> | ||
</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,9 @@ | ||
describe('[Regression](GH-1842)', function () { | ||
it('Should wait if an iframe reloads during the switchToIframe command execution', function () { | ||
return runTests('testcafe-fixtures/index-test.js', 'gh-1842', { selectorTimeout: 10000 }); | ||
}); | ||
|
||
it('Should take into account iframe selector\'s timeout option', function () { | ||
return runTests('testcafe-fixtures/index-test.js', 'Individual timeout', { selectorTimeout: 200 }); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
test/functional/fixtures/regression/gh-1842/testcafe-fixtures/index-test.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,20 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture `GH-1842` | ||
.page `http://localhost:3000/fixtures/regression/gh-1842/pages/index.html`; | ||
|
||
test('gh-1842', async t => { | ||
await t | ||
.switchToIframe('#reloading-iframe') | ||
.click('body') | ||
.click('body'); | ||
}); | ||
|
||
test('Individual timeout', async t => { | ||
const iframe = Selector('#iframe', { timeout: 10000 }); | ||
|
||
await t | ||
.switchToIframe(iframe) | ||
.expect(Selector('body').visible).ok('iframe is loaded') | ||
.switchToMainWindow(); | ||
}); |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
describe.only('[Regression](GH-1875)', function () { | ||
describe('[Regression](GH-1875)', function () { | ||
it('Should listen console messages in iframes before it loaded completely', function () { | ||
return runTests('testcafe-fixtures/index-test.js', 'gh-1875'); | ||
return runTests('testcafe-fixtures/index-test.js', 'gh-1875', { selectorTimeout: 10000 }); | ||
}); | ||
}); |