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
Good exemple, but not work with version 9 of cypress.
How can we update your exemple ?
cypress-command-definition.ts
export interface NxCypressCommandDefinition<T extends keyof Cypress.Chainable> { name: T; options?: Cypress.CommandOptions & {prevSubject: false}; // eslint-disable-next-line @typescript-eslint/no-explicit-any fn: Cypress.CommandFn<T>; }
register-commands.ts
import { NxCypressCommandDefinition } from "./cypress-command-definition"; export function registerCommands ( availableCommands: NxCypressCommandDefinition<keyof Cypress.Chainable>[] ) { availableCommands.forEach(commandDefinition => { if(commandDefinition.options) { Cypress.Commands.add(commandDefinition.name, commandDefinition.options, commandDefinition.fn); } else { Cypress.Commands.add(commandDefinition.name, commandDefinition.fn); } }); }
get-el-command.ts
import { NxCypressCommandDefinition } from "./cypress-command-definition"; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Cypress { // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Chainable { getEl(identifier: string): Chainable<Element>; } } } export const getElCommand: NxCypressCommandDefinition<keyof Cypress.Chainable> = { name: 'getEl', fn: (identifier: string) => { return cy.get(`[data-test="${identifier}"]`); } };
I have an error on the fn definition in the getElCommand
fn
getElCommand
Do you have an idea to solve it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Good exemple, but not work with version 9 of cypress.
How can we update your exemple ?
cypress-command-definition.ts
register-commands.ts
get-el-command.ts
I have an error on the
fn
definition in thegetElCommand
Do you have an idea to solve it
The text was updated successfully, but these errors were encountered: