Skip to Content

⚙️ Development Setup

Overview

This guide provides basic instructions for setting up the cypress-ai-automation repository for development and testing.

Prerequisites

🖥️ System Requirements

  • Node.js: Version 18.0.0 or higher
  • NPM: Version 8.0.0 or higher
  • Git: Version 2.30.0 or higher

🔧 Required Software

  • Visual Studio Code (recommended)
  • Git Client
  • Node.js & NPM (from nodejs.org)
  • Chrome Browser (for testing)

⚙️ Git Configuration

Before starting, make sure Git is properly configured. Follow the complete guide at: Configuring Git

Setup Steps

1. Install Node.js

# Check if Node.js is installed node --version npm --version # If not installed, download from https://nodejs.org/

2. Clone the Repository

# Clone the repository git clone https://gitlab.forge99.com/ai-product-dev/cypress-ai-automation.git # Navigate to the project directory cd cypress-ai-automation

3. Install Dependencies

# Install all dependencies npm install # Install Cypress (if not already installed) npm install cypress --save-dev # Install Mochawesome Reporter Plugin (if not already installed) npm install --save-dev cypress-mochawesome-reporter

4. Verify Installation

# Check Cypress version npx cypress --version # Run a quick test npm run test

Running Tests

🚀 Available Commands

# Run frontend tests with generated report npm run test # AIWebsite.PublishedSite.test.js # Run admin tests with generated report npm run admin # AIWebsite.WP-Admin.test.js # Run Cypress with UI (no generated report) npx cypress open # Navigate through Cypress test runner

📊 View Test Results

After running tests, you can view the results in:

  • Console output: Immediate feedback
  • HTML Reports: Open cypress/reports/Test Suite Report.html in your browser
  • Screenshots: Check cypress/screenshots/ for failure screenshots

Common Issues

🔧 Quick Fixes

1. Permission Errors (Windows)

# Run PowerShell as Administrator Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

2. Cypress Installation Issues

# Clear cache and reinstall npm cache clean --force rm -rf node_modules npm install

3. Node.js Version Issues

# Check Node.js version node --version # If version is too old, update Node.js from https://nodejs.org/

Next Steps

Once you have the repository set up:

  1. Review the test files in cypress/integration/examples/
  2. Check the configuration in cypress.config.js
  3. Understand the project structure from the Project Structure documentation
  4. Run tests to ensure everything works properly
Last updated on