Skip to content

Commit

Permalink
Fix test for single pass
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkimball committed Jan 17, 2020
1 parent ee90ca2 commit d70ed9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions test/integration/test-shadow-amp.js
Expand Up @@ -20,22 +20,20 @@ describes.integration(
{
amp: false,
body: `
<script async src='/dist/amp-shadow.js'></script>
<div id="host"></div>
<script>
window.addEventListener('DOMContentLoaded', () => {
<div id="host"></div>
<script>
(window.AMP = window.AMP || []).push(() => {
window.ampShadowHost = document.getElementById('host');
const host = document.getElementById('host');
const testUrl = 'http://localhost:9876/amp4test/shadow-amp';
fetch(testUrl)
.then(res => res.text())
.then(text => {
const doc = new DOMParser().parseFromString(text, 'text/html');
AMP.attachShadowDoc(window.ampShadowHost, doc, testUrl);
AMP.attachShadowDoc(host, doc, testUrl);
});
});
});
</script>
</script>
<script async src='/dist/amp-shadow.js'></script>
`,
},
env => {
Expand All @@ -44,8 +42,8 @@ describes.integration(

beforeEach(async () => {
docController = new BrowserController(env.win);
await docController.waitForShadowRoot('#host');
shadowDoc = env.win.ampShadowHost.shadowRoot;
await docController.waitForShadowRoot('#host', 25000);
shadowDoc = env.win.document.getElementById('host').shadowRoot;
});

it('should attach shadow AMP document', () => {
Expand Down
2 changes: 1 addition & 1 deletion testing/describes.js
Expand Up @@ -476,7 +476,7 @@ class IntegrationFixture {
/** @const */
this.spec = spec;
if (this.spec.timeout === undefined) {
this.spec.timeout = 15000;
this.spec.timeout = 25000;
}
if (this.spec.retryOnSaucelabs === undefined) {
this.spec.retryOnSaucelabs = 4;
Expand Down

0 comments on commit d70ed9e

Please sign in to comment.