Skip to Content

πŸ—οΈ Project Structure

Overview

This section explains the organization of files and folders in the cypress-ai-automation repository to help you understand how the project is structured.

Root Directory Structure

cypress-ai-automation/ β”œβ”€β”€ πŸ“ cypress/ # Main testing framework β”œβ”€β”€ πŸ“ node_modules/ # NPM dependencies (auto-generated) β”œβ”€β”€ πŸ“ qa/ # Documentation folder β”œβ”€β”€ πŸ“„ .gitignore # Git ignore patterns β”œβ”€β”€ πŸ“„ cypress.config.js # Cypress configuration β”œβ”€β”€ πŸ“„ package.json # Project metadata & scripts └── πŸ“„ package-lock.json # Dependency lock file

Cypress Directory Structure

πŸ“ /cypress/

The main testing framework directory:

cypress/ β”œβ”€β”€ πŸ“ downloads/ # Files downloaded during tests β”œβ”€β”€ πŸ“ fixtures/ # Test data β”œβ”€β”€ πŸ“ integration/ # Test specification files β”‚ └── πŸ“ examples/ # AI website test cases β”œβ”€β”€ πŸ“ reports/ # Generated test reports β”œβ”€β”€ πŸ“ screenshots/ # Failure screenshots β”œβ”€β”€ πŸ“ support/ # Custom commands and utilities └── πŸ“ videos/ # Test execution recordings

πŸ“ /cypress/integration/examples/

Contains the main test files:

examples/ β”œβ”€β”€ πŸ“„ AIWebsite.PublishedSite.test.js # Frontend testing (597 lines) └── πŸ“„ AIWebsite.WP-Admin.test.js # WordPress admin testing (321 lines)

What each file does:

  • AIWebsite.PublishedSite.test.js: Tests the frontend of published AI websites
  • AIWebsite.WP-Admin.test.js: Tests WordPress admin panel functionality

πŸ“ /cypress/support/

Contains support files and custom commands:

support/ β”œβ”€β”€ πŸ“„ commands.js # Custom Cypress commands └── πŸ“„ e2e.js # E2E test configuration

Key files:

  • commands.js: Custom commands like handlePopups() for managing dynamic content
  • e2e.js: Global configuration and imports for E2E testing

πŸ“ /cypress/fixtures/

Test data storage:

fixtures/ └── πŸ“„ example.json # Sample test data structure

Configuration Files

πŸ“„ cypress.config.js

Main Cypress configuration file that contains:

  • Timeouts: Extended timeouts for AI website testing
  • Security: Chrome web security disabled for testing
  • Reporting: Mochawesome reporter configuration
  • File Patterns: Spec pattern for test discovery

πŸ“„ package.json

Project metadata containing:

  • Dependencies: Cypress, mochawesome reporter, dotenv
  • Scripts: Pre-defined commands for running tests
  • Project Information: Name, version, description

Generated Directories

πŸ“ /cypress/reports/

Auto-generated test reports:

  • HTML Reports: Visual test results for viewing in browser
  • JSON Reports: Machine-readable test data
  • Assets: Screenshots and supporting files

πŸ“ /cypress/screenshots/

Failure screenshots organized by:

  • Test file name
  • Timestamp
  • Failure context

πŸ“ /cypress/videos/

Test execution recordings (optional):

  • Full test run videos
  • Organized by test suite

File Naming Conventions

Test Files

  • Pattern: [Component].[TestType].test.js
  • Examples:
    • AIWebsite.PublishedSite.test.js
    • AIWebsite.WP-Admin.test.js

Support Files

  • Pattern: [functionality].js
  • Examples:
    • commands.js - Custom commands
    • e2e.js - E2E configuration
Last updated on