Automation Testing
Introduction
What is Cypress?
Cypress is a test automation tool used for testing web applications by automating browser actions.
Cypress is a purely JavaScript-based front-end testing tool built for the modern web. It aims to address the pain points developers or QA engineers face while testing an application
Installation
Pre-requisites:
- Google Chrome or Firefox and other supported browsers
- NodeJS
- VSCode or any preferred Text Editor (For editing configuration file)
How to install Cyress
Step 1. Create a Folder
Step 2. Open the folder and access it thru Command Prompt
Step 3. Install Cypress
- Type
npm install [email protected]
Step 4. Wait for it to finish the download
Cypress Interaction
Opening Cypress
Step 1. Open the folder and access it thru Command Prompt
Step 2. Locate Cypress Binary
- Locate
.\node_modules\.bin
Step 3. Open Cypress
- Type
cypress open
Step 4. You will encounter an error the first time. You need to delete the cypress file first
Step 5. Then do step 3 again
How to copy Cypress test suites
Step 1. Download Cypress Test Suites
- Download the cypress test suites.zip on https://gitlab.forge99.com/noel.dulin/cypress-test-suites/-/releases (Download the Latest version)
Step 2. Extract the files
Step 3. Navigate to Cypress Binary Folder
- Locate
.\node_modules\.bin
Step 4. Paste and overwrite the files
Edit Configuration file
Step 1. Access the folder
Step 2. Locate cypress.json
Step 3. Open cypress.json
on VSCode or any preferred Text Editor
Step 4. Edit the config file:
Description | Environment | Example |
---|---|---|
Website URL (always include ”/” in the end) | "url" | ”url”: “https://www.ap-iconic.agentimage.com/ “ |
Website URL2 (without www prefix) | "url2" | ”url2”: “https://ap-iconic.agentimage.com/ “ |
Agent Image Username | "AIUsername" | ”AIUsername” :“Agentimage” |
Agent Image Password | "AIUsername" | ”AIPassword” :“MIUASDFMCASHDUIAUSHD23123” |
Step 5. Save
Cypress UI
- Test Location
- Test folders
- Test cases
- Browser Selector
Run test script (Headed)
Step 1. Open cypress
Step 2. Access the Folder
- Click search or Ctrl+F to access the folder you want to run
Step 3. Click run integration to run by folder or click only the test case if you will run a single test
Run test script by folder (Headless)
- Open the folder and access it thru Command Prompt
- Type
cypress run --spec 'cypress\integration\Iconic-AP\*\*' --browser chrome
for Iconic folder - Type
cypress run --spec 'cypress\integration\Legacy-AP\*\*' --browser chrome
for Legacy folder
Note
Change chrome to firefox if you want to run it in Firefox browser
False Negative Reporting
Any false negative issues create a ticket to Product Dev Service Desk and assign to Noel Dulin
Useful Links
- Official website: https://www.cypress.io/
- Documentation: https://docs.cypress.io/guides/overview/why-cypress#In-a-nutshell
- Cypress Test Suites Repository: https://gitlab.forge99.com/noel.dulin/cypress-test-suites
- Test Suite Documentation: https://docs.google.com/spreadsheets/d/1YMbaFjqDcKOcl8AdJcW_mnoHon3bK2aCT1dx009aNtY/edit?usp=sharing
Changelog
1.1.7
Update:
- Added Command script when logging in on wp/admin even in Outdated version of AIOS initial setup Login Screen
- Removed GE-012 Verify if the reCaptcha v3 is active (Since we use honeypot now)
- General Folder has been removed and added General-AP and General-AIX
- General-AP folder will contain scripts to be run on AP Themes only
- General-AIX folder will contain scripts to be run on AIX Themes only
Added Scripts:
- Added test script on General-AP:
- GE-014 Verify Duplicator if installed then remove installer data
- GE-015 Footer copyright should use client or company name
- Added test script on General-AIX:
- GEX-014 Verify Duplicator if installed then remove installer data
1.1.6
Update:
- Updated GE-008 Activate the following plugins. Update them if already installed:
- Added AIOS Optimize version 1.2.7
- Update AIOS Initial Setup to latest version 6.0.1
- Update AIOS SEO Tools to latest version 2.0.6
- Update Optima Express IDX Plugin to latest version 7.3.0
- Updated AMP to latest version 2.3.0
1.1.5
Update:
- Added GE-013 Domain should pass and no errors in MXtoolbox or DNSChecker
- Added new assertion Menu and footer items should be accessible in Test ID 003: Menu Items should be in text form
- Now it changes to Menu and Header items should be accessible and not empty text
1.1.4
Update:
- Removed all Test ID 013 Attach GTMetrix score to post launch notes in all themes folder since it not using it anymore on production
1.1.3
- Change the CF7 version to 5.3.2 in GE-008 Activate the following plugins. Update them if already installed
1.1.2
Update:
- Updated the version of AIOS Initial set-up plugin to 6.0.0 and AIOS SEO tools plugin to 2.0.6 in GE-008
1.1.1
Update:
- Fix login issues in different WordPress Versions (PDSD-632) .
1.1.0
Test suite update for cypress 9.7.0:
- Automation testing in the Back-end/General Folder will require changing
"experimentalSessionAndOrigin": true
in cypress.json - Automation testing in the Front-end/Themes Folder will require changing
"experimentalSessionAndOrigin": false
in cypress.json Added test script: - GE-011 No Duplicate and Unused Plugins.js
- GE-012 Verify if the reCaptcha v3 is active.js Improvements:
- Added Test ID in the test description in Back-end/General Folder
- Improve optimization (remove unnecessary clicks and visits) for faster testing time in Back-end/General Folder
Support
- Slack: Noel Dulin
- Email: [email protected]
Last updated on