cypress
cy.title().should('contain', 'Cypress.io');cy.get('#my-element').should('be.visible');cy.get('input[name="username"]').type('admin');
cy.get('input[name="password"]').type('secret');
cy.get('button[type="submit"]').click();cy.on('window:alert', (alertText) => {
// Do something with the alert text
});cy.visit('https://example.com');cy.get('#my-element').should('be.visible').and('have.text', 'Hello World!');Cypress.Commands.add('login', (username, password) => {
// Login logic
});
cy.login('admin', 'secret');