Skip to content

Commit

Permalink
fix(component-testing): wait for iframe to exist to start testing (#1…
Browse files Browse the repository at this point in the history
…5354)

* fix: wait for iframe to exist to start testing

* add comment

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
  • Loading branch information
Barthélémy Ledoux and lmiller1990 authored Mar 12, 2021
1 parent f6652ce commit 66d2bd7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/driver/src/cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class $Cypress {
initialize ({ $autIframe, onSpecReady }) {
this.$autIframe = $autIframe
this.onSpecReady = onSpecReady
if (this._onInitialize) {
this._onInitialize()
this._onInitialize = undefined
}
}

run (fn) {
Expand Down Expand Up @@ -216,6 +220,17 @@ class $Cypress {

this.runner.onScriptError(err)
})
.then(() => {
return (new Promise((resolve) => {
if (this.$autIframe) {
resolve()
} else {
// block initialization if the iframe has not been created yet
// Used in CT when async chunks for plugins take their time to download/parse
this._onInitialize = resolve
}
}))
})
.then(() => {
this.cy.initialize(this.$autIframe)

Expand Down

4 comments on commit 66d2bd7

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 66d2bd7 Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/circle-develop-66d2bd75eac21529c89f3b7110d234fb82a97723/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 66d2bd7 Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/appveyor-develop-66d2bd75eac21529c89f3b7110d234fb82a97723/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 66d2bd7 Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/appveyor-develop-66d2bd75eac21529c89f3b7110d234fb82a97723/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 66d2bd7 Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/circle-develop-66d2bd75eac21529c89f3b7110d234fb82a97723/cypress.tgz

Please sign in to comment.