We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I get this really annoying warning in the browser console when I try to use async/await with promisify:
Cypress Warning: Cypress detected that you returned a promise in a test, but also invoked one or more cy commands inside of that promise. The test title was: element exists While this works in practice, it's often indicative of an anti-pattern. You almost never need to return both a promise and also invoke cy commands. Cy commands themselves are already promise like, and you can likely avoid the use of the separate Promise. https://on.cypress.io/returning-promise-and-commands-in-test
Cypress Warning: Cypress detected that you returned a promise in a test, but also invoked one or more cy commands inside of that promise.
The test title was:
element exists
While this works in practice, it's often indicative of an anti-pattern. You almost never need to return both a promise and also invoke cy commands.
Cy commands themselves are already promise like, and you can likely avoid the use of the separate Promise.
https://on.cypress.io/returning-promise-and-commands-in-test
This is my reduced test case written in Typescript:
import promisify from 'cypress-promise' const loadTestPage = (): Promise<Window> => promisify(cy.visit('./cypress/test-file.html')) async function runTest() { it('element exists', async () => { await loadTestPage() cy.get(`#element`).should('exist') }) } runTest()
The text was updated successfully, but these errors were encountered:
Duplicate of #6
Sorry, something went wrong.
No branches or pull requests
I get this really annoying warning in the browser console when I try to use async/await with promisify:
The warning
Reduced test case
This is my reduced test case written in Typescript:
The text was updated successfully, but these errors were encountered: