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: strict top offset comparison fails in headed mode #237

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

drecali
Copy link
Contributor

@drecali drecali commented Feb 15, 2022

Many tests were failing in click.spec.ts, hover.spec.ts, and mouse.spec.ts when I ran them locally in the Cypress Test Runner using the yarn run cypress open command. Please see the screenshots below.

All tests passed in headless mode.

The reason for the headed failures are that the top offset of the element is expected to be an integer but the actual value has a decimal of usually 0.1875.

The fix seems quite easy and works well for me locally. I just changed the Cypress comparison to allow for the small deviation. It seems like a relatively safe change.

Closes #236

Please let me know if I missed something.

image

image

image

image

image

@dmtrKovalenko
Copy link
Owner

I am actually surprised by this, it looks like some kind of issues in our calculations of the position? I'd like to have all the coordinates stable between different run modes.

@drecali
Copy link
Contributor Author

drecali commented Feb 15, 2022

@dmtrKovalenko
I'm not sure why the extra decimal is always 0.1875 or why it's only present in headed mode. Can you reproduce this locally? I tried to change the viewport on the Cypress Test Runner but it didn't make a difference.

@krznbtni krznbtni mentioned this pull request Jun 13, 2022
drecali and others added 6 commits June 26, 2022 20:27
The example for `cy.realMouseMove` was using `cy,realMouseUp`
* chore(deps-dev): bump cypress from 9.1.0 to 10.2.0

Bumps [cypress](https://github.com/cypress-io/cypress) from 9.1.0 to 10.2.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](cypress-io/cypress@v9.1.0...v10.2.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate to cypress 10

* Fix glob

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitriy <dmtr.kovalenko@outlook.com>
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.

Tests failing locally in open/headed mode
4 participants