clean-nightfall-72091
09/23/2022, 9:29 AMclass Form{
firstname?: string
lastname?: string
birthplace?: string
constructor(...){...}
setAllWrong(){
this.firstname = ""
this.lastname = ""
this.birthplace = ""
}
}
Now I declare a custom command:
Cypress.Commands.add(
'fill_all_correct',
(data: Form) => {
...
}
)
And define it insinde the `index.ts`:
declare namespace Cypress {
interface Chainable{
fill_all_correct(data: Form): Chainable<Element>,
}
}
Cypress is now giving me a ReferenceError: Form is not defined
when using it inside a test.
specify('Test', () => {
const form= new Form()
...
}
Importing the Form
Class inside the test, command and index file leaves me with an Type 'Chainable' is not generic.
inside the index.ts
. Can anybody identify what I may be doing wrong and what I should do instead ? I hope I could picture the problem for all of you.