
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
Master Cypress alert handling by exploring simple, confirmation, and prompt popups, validating messages, passing input, and authenticating via URL tricks with Cypress events.
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.
Learn to handle iframes in Cypress by locating the frame, drilling into its document body, and typing and formatting text, using custom commands and the Cypress iframe plugin.
Learn how to handle web tables in Cypress with JavaScript by counting rows and columns, validating data in specific cells, reading all rows and columns, and navigating pagination.
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 use Cypress hooks—before, after, before each, and after each—for setup and teardown, and apply tags like skip and only to selectively run tests.
Use Cypress fixtures to manage test data stored in the fixtures folder. Drive tests with data from JSON files, including data sets for login, and reuse data via before hooks.
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 --"
}
Explore core web concepts, including web applications, client-server architecture, and HTML, CSS, and JavaScript basics, plus the history and differences between Java and JavaScript.
Explore how the document object model powers dynamic web pages by connecting html to JavaScript, accessing elements with the document object, and updating content via events.
Install Visual Studio Code, create a basic html file with embedded JavaScript, and learn to use document.write, console.log, and live server for automatic updates.
Explore how JavaScript declares variables with var, let, and const, and understand basic scope and initialization. Display values with document.write and console.log; identify numbers, strings, and booleans.
Master JavaScript operators, including arithmetic, assignment, relational, and logical types, with practical examples of increment, decrement, and the ternary operator. Run and test these operators in Node.js and HTML contexts.
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 to define and invoke JavaScript functions, including parameters and return values. See how functions enable reuse, events, and HTML integration for dynamic tasks like adding numbers.
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.
Learn to create and use a date object in JavaScript, extracting date, month, year, hours, minutes, and seconds, and build a dynamic digital clock with HTML and JS.
Explore strings and numbers in JavaScript by creating strings with literals or the String object, using methods like replace, substring, split, trim, toLowerCase, and parseInt and parseFloat.
Explore object oriented programming in JavaScript by defining classes and objects, creating methods, and using constructors to initialize data and automate object creation.
Explore how the static keyword makes variables and methods shared across class instances, reducing memory usage and enabling access via the class name, while contrasting non-static members.
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 how prototype in JavaScript lets you add properties and methods to functions and classes after creation, with practical examples using function constructors and class prototypes.
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.
Explore converting JSON data to JavaScript objects and extracting values from arrays and nested objects, including access to names, addresses, and phone numbers.
Set up Node.js, npm, and Visual Studio Code to test rest APIs with Cypress, sending get, post, put, and delete requests and verifying status codes.
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.
Parse and validate JSON responses from a store API using Cypress with JavaScript, including status code checks. Extract data with JSON path, validate attributes, and compute totals from multiple objects.
Learn to validate json schema in Cypress using AJV, by defining a schema, capturing the response, compiling the schema, and asserting the response body matches the schema.
Master sending and validating XML payloads in Cypress using the XML to JS library. Parse XML responses to extract generated IDs and verify pet details.
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.
Learn how to implement OAuth 2.0 authentication in Cypress with JavaScript, covering client ID, client secret, authorization code, and access token for GitHub API access.
Learn how to implement api chaining in Cypress by linking sequential requests, extracting IDs from one response and using them in subsequent calls, including create, update, and delete workflows.
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.