/* eslint-disable no-undef */
// / ;
Cypress.Commands.add('getByTestId', (selector, ...args) => {
return cy.get(`[data-testid=${selector}]`, ...args);
});
// -- This is a parent command --
Cypress.Commands.add('login', (user, password) => {
cy.getByTestId('header--button-login').click();
cy.wait(300);
cy.get('#login--dialog-username').type(user);
cy.wait(200);
cy.get('#login--dialog-password').type(password);
cy.wait(500);
cy.get('#login--dialog-button-submit').click();
});
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable
// drag(subject: string, options?: Partial): Chainable
// dismiss(subject: string, options?: Partial): Chainable
// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable
// }
// }
// }