
What is Cypress?
Who uses Cypress?
Selenium Vs Cypress
Cypress Ecosystem
Features of Cypress
Limitations in Cypress
1) Download Node & NPM
https://nodejs.org/en/download/
2) Set NODE_HOME Environment Variable
3) Create Cypress Working Folder
4) Generate package.json
npm init
5) Install Cypress
npm install cypress --save-dev
6) Download Visual Studio Code Editor
https://code.visualstudio.com/download
How to create and run tests in cypress
Locators in Cypress
Types of assertions in cypress.
Explore the Cypress project folder structure, including downloads, e2e tests, fixtures, screenshots, and support commands, with pre-test setup, configuration, and plugins.
Handle Checkboxes & Radio Buttons in Cypress
Handle different types of drop downs in Cypress
Explore Cypress methods to handle tabs: remove the target attribute with Invoke to stay in the same tab, or visit the ref URL in the same tab, with domain limitations.
Master Cypress mouse actions, including mouse over, right click, and double click, using trigger and built in commands, plus drag and drop with a plugin and scroll into view.
Explore how to upload files in Cypress using the Cypress file upload package. Learn to upload single and multiple files, rename during upload, use drag-and-drop, and handle shadow DOM scenarios.
Learn how to create and override custom commands in Cypress, using Cypress.Commands.add in the commands file to click links by label and simplify login workflows for test reuse.
Learn how to navigate between pages in Cypress using the go command, including back, forward, and reload, with practical examples of visiting pages, clicking elements, and asserting titles.
Learn to capture screenshots and videos with Cypress, both intentionally and automatically on test failures, including whole-page and element screenshots, and run tests in headless mode from the terminal.
Steps to Generate HTML Report:
--------
1) install cypress-mochawesome-reporter
npm i --save-dev cypress-mochawesome-reporter
2) Change cypress reporter & setup hooks
Edit config file (cypress.config.js by default)
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: 'cypress-mochawesome-reporter', // for reports
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-mochawesome-reporter/plugin')(on); // for reports
},
},
});
3) Add to cypress/support/e2e.js
import 'cypress-mochawesome-reporter/register';
4) run cypress
npx cypress run --spec cypress\e2e\MyTest.cy.js
Learn how the page object model pattern in Cypress organizes page elements into dedicated classes, enabling reusable actions, centralized locators, and easier maintenance for multi-page tests.
▪How to run Cypress from the command line
▪How to specify which spec files to run
▪Working with Dashboard features
–Capture screenshots
–Recording
▪cd C:\Users\admin\CypressAutomation>
▪To Run all the specs in command line
–node_modules\.bin\cypress run
▪To Run specific specs the tests in command line
–node_modules\.bin\cypress run --spec "cypress\integration\examples\FirstTest.spec.js"
▪Dashboard
▪https://dashboard.cypress.io/login
▪Screenshots & Recording feature in Dashboard
–cypress run --record --key d63f3548-892b-41b9-bcb7-07ae3cbf9f9b
"scripts": {
"test": "node_modules\\.bin\\cypress run --config pageLoadTimeout=100000",
"runtests":"npm run test --"
}
Learn to control program flow with JavaScript conditional statements, including if, else, and switch case, and apply them to problems like even/odd, largest of three numbers, and week name.
Explore how JavaScript control statements drive program flow by using loops—while, do-while, and for loops—and jump out or skip iterations with break and continue, with practical number-printing examples.
Learn how JavaScript objects use properties and methods, access values with dot or bracket notation, add, update, delete properties, and read all properties with for-in loops, using this in methods.
Learn to create and manipulate JavaScript arrays, store mixed data types, access elements by index, check length, and iterate using for loops and for off loops.
Explore JavaScript array methods like toString, join, pop, push, shift, unshift, delete, concat, slice, sort, and reverse to manipulate and transform arrays in web automation.
Explore encapsulation in JavaScript by wrapping data and methods inside a class, using a constructor, and implementing getters and setters to manage a student’s name and marks.
Explore inheritance in JavaScript, learning how to reuse variables and methods with extends and super, covering single, multilevel, and hierarchy inheritance, overriding, and practical examples.
Explore polymorphism in JavaScript, where a draw method takes multiple forms across shape, square, and circle through method overriding. Build a base shape and derived classes to demonstrate dynamic dispatch.
Learn how to craft post request bodies in Cypress with JavaScript using three approaches: hardcoded JSON, dynamically generated data, and fixtures, with validations.
Learn to test APIs with Cypress using JavaScript by passing query parameters, headers, cookies, and bearer token authentication; generate tokens, submit and fetch orders, and validate responses.
Explore API authentications including basic, digest, bearer token, and API key, and learn to test them with Cypress with JavaScript and Postman using practical examples.
Course Title: Mastering Cypress Automation Testing with JavaScript (Updated for Cypress 12.x)
Course Overview:
Welcome to the cutting-edge world of Cypress Automation Testing, where we bring you the latest and most comprehensive course designed to propel your testing skills into the future. In this course, we delve into both Web and API Automation Testing using Cypress, the forefront technology known for its speed, simplicity, and reliability across modern web applications.
Course Highlights:
Updated for Cypress 12.x (Latest Version): Stay ahead of the curve by mastering the most recent features and enhancements in Cypress with JavaScript.
Web & API Automation Focus: Covering both realms, this course equips you with the skills to automate testing seamlessly in the browser and API environments.
From Basics to Advanced Concepts: Whether you're new to JavaScript or a seasoned developer, we've got you covered. The course includes a comprehensive review of JavaScript programming, starting from the basics and progressing to advanced topics.
Real-Time Examples: Learn through practical, real-time examples that provide a hands-on understanding of Cypress concepts and best practices in framework design.
No Prerequisites: This course is designed to cater to all skill levels. We've taken care of everything, including JavaScript basics, so you can dive right into the exciting world of Cypress Automation.
Theoretical Material & Coding Resources: Each session comes with theoretical material and coding resources that you can download, ensuring a well-rounded learning experience.
Course Contents:
JavaScript Programming:
Introduction
DOM (Document Object Model)
Environment Setup
JavaScript Basics: Comments, Statements, Variables, Data Types, Operators, etc.
Web Automation using Cypress:
Cypress Introduction
Selenium Vs Cypress
Environment setup on Windows and Mac
Writing and organizing tests
Interacting with elements
Handling UI Elements, Alerts, Frames, Navigation, File Uploads, Mouse Events, Tables, etc.
Working with Hooks and Data-Driven Testing
Custom Commands in Cypress
HTML Reports Generation
Page Object Model Pattern
Cypress Command Line & Dashboard services
Continuous Integration with Cypress and Jenkins
API Automation using Cypress:
Introduction to API Testing
Setting up the Project
HTTP Methods: GET, POST, PUT, DELETE
Request Body Creation, Path Parameters, Query Parameters, Headers, and Cookies
Parsing Response, JSON & XML Schema Validations
Authentication Types: Basic, Digest, Preemptive, OAuth 2
API Chaining
Join us on this exciting journey, and let's empower you to become a master in Cypress Automation Testing with JavaScript.