* Initial plan * feat: add Cypress E2E testing for auth flows Agent-Logs-Url: https://github.com/RMCampos/tasknote/sessions/f3b4e747-3e09-4b6c-8b4c-336cf45b59c4 Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * fix: use regex intercepts and unique emails in Cypress auth tests Agent-Logs-Url: https://github.com/RMCampos/tasknote/sessions/2a1225d9-9412-459e-bc97-93303454a461 Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * fix: use PUT method for sign-up intercepts in Cypress auth tests Agent-Logs-Url: https://github.com/RMCampos/tasknote/sessions/bda14dfc-a30d-4c01-aa74-e8c2690072e3 Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * chore: update tools.md file to include sql command --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> Co-authored-by: Ricardo Campos <ricardompcampos@gmail.com>
27 lines
738 B
TypeScript
27 lines
738 B
TypeScript
// Custom Cypress commands.
|
|
// Add any project-wide custom commands here.
|
|
|
|
// Prevent TypeScript errors for cy.login usage
|
|
declare global {
|
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
namespace Cypress {
|
|
interface Chainable {
|
|
/**
|
|
* Custom command to log in via the UI.
|
|
* @param email - User email address
|
|
* @param password - User password
|
|
*/
|
|
login(email: string, password: string): Chainable<void>;
|
|
}
|
|
}
|
|
}
|
|
|
|
Cypress.Commands.add('login', (email: string, password: string) => {
|
|
cy.visit('/login');
|
|
cy.get('input[name="email"]').clear().type(email);
|
|
cy.get('input[name="password"]').clear().type(password);
|
|
cy.get('button[type="submit"]').click();
|
|
});
|
|
|
|
export {};
|