- Add GitHub Actions CI workflow with lint, type-check, test, build, and e2e jobs - Configure Jest for unit and integration tests with coverage reporting - Create unit tests for BaseAgent, PlantLineageAgent, and AgentOrchestrator - Add blockchain PlantChain unit tests - Create API integration tests for plants endpoints - Configure Cypress for E2E testing with support files and custom commands - Add E2E tests for home, plant registration, transparency, and vertical farm pages - Set up Prettier for code formatting with configuration - Configure Husky pre-commit hooks with lint-staged - Add commitlint for conventional commit message enforcement - Update package.json with new scripts and dev dependencies This implements Agent 5 (Testing & CI/CD) from the deployment plan.
27 lines
686 B
TypeScript
27 lines
686 B
TypeScript
/**
|
|
* Cypress Custom Commands
|
|
*/
|
|
|
|
// Wait for page to fully load
|
|
Cypress.Commands.add('waitForPageLoad', () => {
|
|
cy.document().its('readyState').should('eq', 'complete');
|
|
});
|
|
|
|
// Login command (placeholder for auth implementation)
|
|
Cypress.Commands.add('login', (email: string, password: string) => {
|
|
// This will be implemented when auth is added
|
|
cy.log(`Login with ${email}`);
|
|
cy.session([email, password], () => {
|
|
// Placeholder for auth session
|
|
cy.visit('/');
|
|
});
|
|
});
|
|
|
|
// Navigate to a plant page
|
|
Cypress.Commands.add('visitPlant', (plantId: string) => {
|
|
cy.visit(`/plants/${plantId}`);
|
|
cy.waitForPageLoad();
|
|
});
|
|
|
|
// Export empty object for module
|
|
export {};
|