⚙️ Installation & Setup: AI Production Team
Follow these steps to set up Cypress and clone the repository:
1. Create a Project Folder 📂
- Choose any directory where you want to store the project
- Create a new folder (e.g., CypressTestingProject)
2. Open the Folder in Visual Studio Code 🖥️
- Launch Visual Studio Code
- Click File → Open Folder → Select the folder you created
3. Open the Terminal in VS Code 💻
- At the top menu, click Terminal → New Terminal
- A terminal window will appear at the bottom of VS Code
4. Ensure You’re in the Correct Directory 📍
- The terminal should display the path of the folder you opened
5. Clone the Repository 📂
- Instead of writing test cases from scratch, clone the prepared Cypress test repository
- ⚠️ Reminder: When pasting in the terminal, DO NOT use Ctrl + V. Instead, right-click on the terminal, and it will automatically paste the copied command
- Clone the repository using (Copy + Paste into the terminal):
terminal
git clone https://oauth2:[email protected]/ai-product-dev/cypress-ai-automation.git
- Navigate into the cloned directory:
terminal
cd cypress-ai-automation
6. Install Cypress 📦
- Run the following command to install Cypress as a development dependency:
terminal
npm install cypress --save-dev
7. Opening Cypress 🚀
- After installation, open Cypress with:
terminal
npx cypress open
- This command launches the Cypress Test Runner and automatically creates a cypress folder in your project directory
8. Project Structure 📁
- Inside the cypress folder, you will find:
fixtures/
: Contains test dataintegration/
: Stores test scriptssupport/
: Reusable functions and utilities
⚠️ Fixing “Running scripts is disabled on this system” Error
If you encounter an error message saying: error cannot be loaded because running scripts is disabled on this system
You need to allow scripts to run by updating the execution policy.
🔹 Solution:
-
Open PowerShell as Administrator
-
Run the following command in the PowerShell terminal:
terminal
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
When prompted, type Y (Yes) and press Enter (If not prompted, skip)
-
To make sure it has been assigned, run the following command, it should return as RemoteSigned:
terminal
Get-ExecutionPolicy
- Close and restart VS Code
This should resolve the issue and allow Cypress to run properly.
Last updated on