Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
dca80ff
commit 0ff6d05
Showing
6 changed files
with
100 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
test/functional/fixtures/regression/gh-7983/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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>This should be in an iframe</title> | ||
<style> | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
} | ||
|
||
body { | ||
background-color: bisque; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div>content</div> | ||
</body> | ||
|
||
</html> |
23 changes: 23 additions & 0 deletions
23
test/functional/fixtures/regression/gh-7983/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,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Test Framework</title> | ||
</head> | ||
|
||
<body> | ||
Host content | ||
<script> | ||
function createIframe(container, iframeSource) { | ||
const iframe = document.createElement('iframe'); | ||
container.appendChild(iframe); | ||
iframe.src = iframeSource; | ||
return iframe; | ||
} | ||
|
||
createIframe(document.body, './iframe.html'); | ||
</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,23 @@ | ||
const path = require('path'); | ||
const createTestCafe = require('../../../../../lib'); | ||
const { onlyInNativeAutomation } = require('../../../utils/skip-in'); | ||
|
||
let testcafe = null; | ||
|
||
describe('[Regression](GH-7983)', function () { | ||
onlyInNativeAutomation('File protocol iframe in Native Automation', function () { | ||
return createTestCafe('127.0.0.1', 1335, 1336) | ||
.then(tc => { | ||
testcafe = tc; | ||
}) | ||
.then(() => { | ||
return testcafe.createRunner() | ||
.browsers('chrome:headless --allow-file-access-from-files') | ||
.src(path.join(__dirname, './testcafe-fixtures/index.js')) | ||
.run(); | ||
}) | ||
.then(() => { | ||
return testcafe.close(); | ||
}); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/functional/fixtures/regression/gh-7983/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,13 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture `File protocol iframe` | ||
.page('../pages/index.html'); | ||
|
||
for (let i = 0; i < 10; i++) { | ||
test(`File protocol iframe ${i}`, async t => { | ||
await t.switchToIframe('iframe'); | ||
|
||
await t.expect(Selector('div').innerText).eql('content'); | ||
}); | ||
|
||
} |