/// import { mount } from 'cypress/vue' interface ObjectInterface { [key: string]: any } Cypress.Commands.add('mount', (component, options = {}) => { return mount(component, options) }) Cypress.Commands.add('invokeForm', (data: ObjectInterface) => { cy.wait(1000) cy.window().then(win => { let baseRoute: string | undefined; baseRoute = win.sessionStorage.getItem('baseRoute')?.substr(1); for (const key in data) { if (data.hasOwnProperty(key)) { cy.get(`.form-item-${baseRoute}-${key} input`).type(data[key]) } } }) cy.wait(1000) }) Cypress.Commands.add('login', (data) => { cy.invokeForm(data) cy.get('button[name=login]').click() const serveConfig = sessionStorage.getItem('serveConfig') cy.url().should('include', JSON.parse(serveConfig || '').loginAfterHref) })