cypress
cypress copied to clipboard
feat: Create public `Cypress.ensure` API for use with custom queries
User facing changelog
Creates and adds types to Cypress.ensure
API, which can be useful for creating custom queries. This new API is based off the previously undocumented cy.ensure*
methods, which are now removed.
In addition, adds public types to cy.now()
, which is again useful for custom queries.
Additional details
All the methods on Cypress.ensure
are pre-existing, and were already on cy
. This PR updates the arguments slightly for consistency, moves many of them to Cypress
, and and adds publicly-facing types. Those that didn't end up on Cypress.ensure
are split up around the codebase near where they're used.
These are referenced in the Custom Query documentation, which is "why this, why now." https://github.com/cypress-io/cypress-documentation/pull/4835
Steps to test
Type tests have been added. All these commands are also used internally.
How has the user experience changed?
No change to the user experience for the vast majority of users. Plugin authors will have to do less TS juggling to get things to work.
PR Tasks
- [x] Have tests been added/updated?
- [n/a] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
- [x] Has a PR for user-facing changes been opened in
cypress-documentation
? https://github.com/cypress-io/cypress-documentation/pull/4835 - [x] Have API changes been updated in the
type definitions
?
Thanks for taking the time to open a PR!
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
- Become familiar with the Code Review Checklist for guidelines on coding standards and what needs to be done before a PR can be merged.
Test summary
Run details
Project | cypress |
Status | Passed |
Commit | c31e4a4a2c |
Started | Nov 28, 2022 4:27 PM |
Ended | Nov 28, 2022 4:45 PM |
Duration | 17:31 💡 |
OS | Linux Debian - |
Browser | Multiple |
View run in Cypress Dashboard ➡️
Flakiness
specs_list_latest_runs.cy.ts | 1 | ||
---|---|---|---|
1 | App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs | ||
project-setup.cy.ts | 1 | ||
1 | ... > can setup e2e testing for a project selecting JS | ||
cypress-origin-communicator.cy.ts | 1 | ||
1 | Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution |
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard
In regards to documentation, will
Cypress.ensure
get its own page likeCypress.dom
or just the mentions on the custom-queries page?
I was planning to leave it with just the mentions on custom-queries for now. Adding a page documenting it more explicitly can be a post-release task.