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
Property 'state' does not exist on type 'Chainable<undefined>' #4771
Comments
Previous docs issue for cy.state cypress-io/cypress-documentation#108 |
Property 'state' does not exist on type 'cy'. /// <reference types="cypress" />
// @ts-check
exports.HomePage = () => {
return cy.state("currentPage");
} |
We can define it like below: interface State {
(property: 'document'): Document
(property: 'window'): Cypress.AUTWindow
(property: 'runnable'): any
// etc. etc.
(property: string): any
} But the problem is that it's not sure |
For anyone that is trying to use @sainthkh's answer, use it like this:
|
@ShaneHudson where would I put this interface, currently I have it in the index.d.ts but my spec file still gives ts error, im thinking i gotta add it to commands.ts? |
We're using:
|
Current behavior:
cy.state
doesn't exist on typescript definitionsDesired behavior:
cy.state
exists on typescript definitionsSteps to reproduce: (app code and test code)
just check
cy.state
and see its not definedVersions
Cypress Latest
The text was updated successfully, but these errors were encountered: