- 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.
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
/**
|
|
* Vertical Farm E2E Tests
|
|
*/
|
|
|
|
describe('Vertical Farm', () => {
|
|
describe('Farm List Page', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/vertical-farm');
|
|
cy.waitForPageLoad();
|
|
});
|
|
|
|
it('should load the vertical farm page', () => {
|
|
cy.url().should('include', '/vertical-farm');
|
|
});
|
|
|
|
it('should display farm management content', () => {
|
|
cy.get('main').should('be.visible');
|
|
});
|
|
|
|
it('should have navigation to register new farm', () => {
|
|
cy.contains(/register|new|add|create/i).should('exist');
|
|
});
|
|
});
|
|
|
|
describe('Farm Registration', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/vertical-farm/register');
|
|
cy.waitForPageLoad();
|
|
});
|
|
|
|
it('should load the registration page', () => {
|
|
cy.url().should('include', '/vertical-farm/register');
|
|
});
|
|
|
|
it('should display registration form', () => {
|
|
cy.get('form').should('be.visible');
|
|
});
|
|
|
|
it('should have required form fields', () => {
|
|
cy.get('input, select, textarea').should('have.length.at.least', 1);
|
|
});
|
|
});
|
|
|
|
describe('Responsiveness', () => {
|
|
it('should display correctly on mobile', () => {
|
|
cy.viewport('iphone-x');
|
|
cy.visit('/vertical-farm');
|
|
cy.waitForPageLoad();
|
|
cy.get('main').should('be.visible');
|
|
});
|
|
|
|
it('should display correctly on tablet', () => {
|
|
cy.viewport('ipad-2');
|
|
cy.visit('/vertical-farm');
|
|
cy.waitForPageLoad();
|
|
cy.get('main').should('be.visible');
|
|
});
|
|
});
|
|
});
|