Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incorrectly using Window.length as subject length #4397

Merged
merged 8 commits into from
Jun 11, 2019

Conversation

kuceb
Copy link
Contributor

@kuceb kuceb commented Jun 5, 2019

fix #4396

@kuceb kuceb requested review from brian-mann, jennifer-shehane and a team and removed request for brian-mann and jennifer-shehane June 5, 2019 20:22
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

test?

@kuceb
Copy link
Contributor Author

kuceb commented Jun 7, 2019

I added iframes to the test fixture as a test

@kuceb kuceb requested a review from jennifer-shehane June 7, 2019 16:17
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

I see, we already have a test that calls cy.window().focus(), etc, but there's nothing guaranteeing that these iframes remain present in the DOM.html file, someone could delete them out if they 'think' there's no tests involving iframes in our suite.

Can you add an assertion in that test that's more explicit to assert the iframes are present and the cy.window().focus() doesn't fail? Looks good otherwise.

@kuceb kuceb changed the title wrap element length getter to account for Window.length fix incorrectly using Window.length as subject length Jun 7, 2019
@kuceb
Copy link
Contributor Author

kuceb commented Jun 7, 2019

@jennifer-shehane agreed, should be much better now

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

Yay! Much better 💯

@jennifer-shehane
Copy link
Member

Maybe a legitimate failure?

  1) src/cy/commands/screenshot #screenshot element capture passes through window:
     AssertionError: expected false to be true
      at getRet (http://localhost:3500/__cypress/runner/cypress_runner.js:71734:16)
      at tryCatcher (http://localhost:3500/__cypress/runner/cypress_runner.js:132224:23)
      at Function.Promise.attempt.Promise.try (http://localhost:3500/__cypress/runner/cypress_runner.js:129598:29)
      at Context.thenFn (http://localhost:3500/__cypress/runner/cypress_runner.js:71748:26)
      at Context.then (http://localhost:3500/__cypress/runner/cypress_runner.js:72014:21)
      at Context.<anonymous> (http://localhost:3500/__cypress/runner/cypress_runner.js:79052:21)
      at http://localhost:3500/__cypress/runner/cypress_runner.js:78757:33
      at tryCatcher (http://localhost:3500/__cypress/runner/cypress_runner.js:132224:23)
      at Promise._settlePromiseFromHandler (http://localhost:3500/__cypress/runner/cypress_runner.js:130242:31)
      at Promise._settlePromise (http://localhost:3500/__cypress/runner/cypress_runner.js:130299:18)
      at Promise._settlePromiseCtx (http://localhost:3500/__cypress/runner/cypress_runner.js:130336:10)
      at Async._drainQueue (http://localhost:3500/__cypress/runner/cypress_runner.js:127153:12)
      at Async._drainQueues (http://localhost:3500/__cypress/runner/cypress_runner.js:127158:10)
      at Async.drainQueues (http://localhost:3500/__cypress/runner/cypress_runner.js:127032:14)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress reads Window.length as number of subjects passed from cy.window()
2 participants