SlideShare a Scribd company logo
Progressive Web App
Testing With
Cypress.io
Presented By: Gaurav Kumar Shukla
Agenda
● What is Cypress.io
● Why Cypress
● Architecture of Cypress
● Cypress Installation
● Cypress Test Runner
● Cypress Locator Strategy
● Example
● Q&A
Progressive Web App Testing With Cypress.io
What is Cypress.io?
● Cypress.io is a frontend automation testing tool built for modern web
applications developed on some of the emerging technologies like
Reactjs, Ionic, Vue,and Angular.
● Cypress is a test automation tool that can perform fast, easy and reliable
testing for anything that runs in a browser.
Why Cypress.io?
● Cypress is next generation automation testing tool, that address the
major pain points developers and QA team face while testing modern
applications.
○ Test
■ Setup
■ Write
■ Run
■ Debug
○ Cypress makes it amazingly simple.
Progressive Web App Testing With Cypress.io
Progressive Web App Testing With Cypress.io
How is it different from Selenium?
● Native Access, as your test code can access all the same objects that
your application code can.
● Stub the browser or your application’s functions and force them to
behave as needed in your test case.
● Expose data stores (like in Redux) so you can programmatically alter the
state of your application directly from your test code.
● Test edge cases like ‘empty views’ by forcing your server to send empty
responses.
● Test how your application responds to errors on your server by modifying
response status codes to be 500 so that timers or polls automatically fire
without having to wait for the required time in your tests.
Cypress Supported Browser/Language.
● Browser
○ Chrome
○ Electron
○ Firefox & IE [Not Supported/ Under Construction.]
● Language Support
○ JavaScript
Progressive Web App Testing With Cypress.io
Cypress Setup
● As cypress is a JavaScript automation tool, that’s why we need to work
with modern JavaScript tools like Node.JS and NPM. To install node.js
from scratch please visit the node.js official website.
○ $ node –version
// to check the node installed or not.
○ $ npm init -y
// This command will create a package.json file and initialize a folder to accept the npm
command.
○ $ npm install cypress@[version]
// install an specific version of cypress, here version is an optional field.
Run Cypress
● $ npx cypress open
// It will open cypress test runner and create a folder structure in your project directory.
○ Cypress
■ Fixture: It contains all the data files which contains some static configuration and
user data. for ex. username, password etc.
■ Integration: It contains all the test files, the test that we write will be in this folder.
● Examples: It is a sub folder in integration older that contains some of
predefined examples, it is automatically generated when we first install the
cypress.
■ plugins: As cypress is also a node process, so we can integrate ‘n’ number of
plugins here by putting them in this folder.
■ support: it includes reusable behavior such as Custom Commands or global
overrides that you want applied and available to all of your spec files.
Cypress Test Runner
● Cypress runs tests in a unique interactive runner that allows you to see
commands as they execute while also viewing the application under test.
● Cypress Test Runner Contains:
○ Command Log
○ Test Status Menu
○ URL Preview
○ App Preview and more...
Progressive Web App Testing With Cypress.io
Write a basic test.
● As cypress support javascript so we need to follow the standards of at
least one javascript framework like Chai, Jasmine or Mocha.
● Cypress recommend to use inbuilt framework Mocha.
Cypress Locator Strategy
● Cypress support Jquery locators.
○ CSS Selector
● Some commands in Cypress are for interacting with the DOM such as:
○ .click()
○ .dblclick()
○ .rightclick()
○ .type()
○ .clear()
○ .check()
○ .uncheck()
○ .select()
○ .trigger()
Progressive Web App Testing With Cypress.io
Progressive Web App Testing With Cypress.io
References:
● https://www.cypress.io/
● https://www.udemy.com/course/cypress-tutorial/
● https://rap.knoldus.com/
Thank You.
^.^

More Related Content

What's hot (20)

PPTX
Why you should switch to Cypress for modern web testing?
Shivam Bharadwaj
 
PPTX
How to Get Started with Cypress
Applitools
 
PPTX
Introduction to Integration Testing With Cypress
Erez Cohen
 
PDF
Cypress - Best Practices
Brian Mann
 
PPTX
End to end test automation with cypress
Kushan Shalindra Amarasiri - Technical QE Specialist
 
PDF
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Applitools
 
PDF
e2e testing with cypress
Tomasz Bak
 
PDF
Introduction cypress
Oim Trust
 
PDF
Automated testing with Cypress
Yong Shean Chong
 
PPTX
Cypress E2E Testing
AnaBrankovic7
 
PPTX
Cypress report
Adarsh
 
PPTX
Cypress first impressions
Hans Emmel
 
PPT
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
PPTX
An overview of selenium webdriver
Anuraj S.L
 
PDF
Playwright Begginers Presentation
FranPerea6
 
PPTX
Introduction to cypress in Angular (Chinese)
Hong Tat Yew
 
PDF
Introduction to E2E in Cypress
Fabio Biondi
 
PDF
Component testing with cypress
Walmyr Lima e Silva Filho
 
PPTX
Jenkins CI
Viyaan Jhiingade
 
PDF
Selenium with Cucumber
Knoldus Inc.
 
Why you should switch to Cypress for modern web testing?
Shivam Bharadwaj
 
How to Get Started with Cypress
Applitools
 
Introduction to Integration Testing With Cypress
Erez Cohen
 
Cypress - Best Practices
Brian Mann
 
End to end test automation with cypress
Kushan Shalindra Amarasiri - Technical QE Specialist
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Applitools
 
e2e testing with cypress
Tomasz Bak
 
Introduction cypress
Oim Trust
 
Automated testing with Cypress
Yong Shean Chong
 
Cypress E2E Testing
AnaBrankovic7
 
Cypress report
Adarsh
 
Cypress first impressions
Hans Emmel
 
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
An overview of selenium webdriver
Anuraj S.L
 
Playwright Begginers Presentation
FranPerea6
 
Introduction to cypress in Angular (Chinese)
Hong Tat Yew
 
Introduction to E2E in Cypress
Fabio Biondi
 
Component testing with cypress
Walmyr Lima e Silva Filho
 
Jenkins CI
Viyaan Jhiingade
 
Selenium with Cucumber
Knoldus Inc.
 

Similar to Progressive Web App Testing With Cypress.io (20)

PPTX
Serverless - DevOps Lessons Learned From Production
Steve Hogg
 
PPTX
End to end test automation with cypress
PankajSingh184960
 
PDF
Cypress Testing Demystified: A Practical Guide
Testgrid.io
 
PDF
Crikeycon 2019 Velociraptor Workshop
Velocidex Enterprises
 
PDF
Expedia 3x3 presentation
Drew Hannay
 
PDF
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
PDF
Static Analysis of Your OSS Project with Coverity
Samsung Open Source Group
 
PDF
2016 07 - CloudBridge Python library (XSEDE16)
Enis Afgan
 
PPTX
Cypress.pptx
Arshad QA
 
PDF
Cypress vs Playwright: A Comparative Analysis
Shubham Joshi
 
PDF
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
PDF
Treinamento frontend
Adrian Caetano
 
PDF
Playwright Testing Guide for QA Engineers.pdf
jamescantor38
 
PDF
Integration testing - A&BP CC
JWORKS powered by Ordina
 
PDF
Angular - Chapter 1 - Introduction
WebStackAcademy
 
PDF
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Richard Bullington-McGuire
 
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
PDF
Developers Testing - Girl Code at bloomon
Ineke Scheffers
 
PDF
Embracing the Cloud A Java Developer’s Guide to Jakarta EE on The Cloud - A R...
Buhake Sindi
 
PPTX
Modern web technologies
Simeon Prusiyski
 
Serverless - DevOps Lessons Learned From Production
Steve Hogg
 
End to end test automation with cypress
PankajSingh184960
 
Cypress Testing Demystified: A Practical Guide
Testgrid.io
 
Crikeycon 2019 Velociraptor Workshop
Velocidex Enterprises
 
Expedia 3x3 presentation
Drew Hannay
 
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
Static Analysis of Your OSS Project with Coverity
Samsung Open Source Group
 
2016 07 - CloudBridge Python library (XSEDE16)
Enis Afgan
 
Cypress.pptx
Arshad QA
 
Cypress vs Playwright: A Comparative Analysis
Shubham Joshi
 
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
Treinamento frontend
Adrian Caetano
 
Playwright Testing Guide for QA Engineers.pdf
jamescantor38
 
Integration testing - A&BP CC
JWORKS powered by Ordina
 
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Richard Bullington-McGuire
 
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
Developers Testing - Girl Code at bloomon
Ineke Scheffers
 
Embracing the Cloud A Java Developer’s Guide to Jakarta EE on The Cloud - A R...
Buhake Sindi
 
Modern web technologies
Simeon Prusiyski
 
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
PPTX
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
PPTX
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
PPTX
Java 17 features and implementation.pptx
Knoldus Inc.
 
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
PPTX
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
PPTX
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
PPTX
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
PPTX
Intro to Azure Container App Presentation
Knoldus Inc.
 
PPTX
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
PPTX
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
PPTX
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
PPTX
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Java 17 features and implementation.pptx
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Ad

Recently uploaded (20)

PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 

Progressive Web App Testing With Cypress.io

  • 1. Progressive Web App Testing With Cypress.io Presented By: Gaurav Kumar Shukla
  • 2. Agenda ● What is Cypress.io ● Why Cypress ● Architecture of Cypress ● Cypress Installation ● Cypress Test Runner ● Cypress Locator Strategy ● Example ● Q&A
  • 4. What is Cypress.io? ● Cypress.io is a frontend automation testing tool built for modern web applications developed on some of the emerging technologies like Reactjs, Ionic, Vue,and Angular. ● Cypress is a test automation tool that can perform fast, easy and reliable testing for anything that runs in a browser.
  • 5. Why Cypress.io? ● Cypress is next generation automation testing tool, that address the major pain points developers and QA team face while testing modern applications. ○ Test ■ Setup ■ Write ■ Run ■ Debug ○ Cypress makes it amazingly simple.
  • 8. How is it different from Selenium? ● Native Access, as your test code can access all the same objects that your application code can. ● Stub the browser or your application’s functions and force them to behave as needed in your test case. ● Expose data stores (like in Redux) so you can programmatically alter the state of your application directly from your test code. ● Test edge cases like ‘empty views’ by forcing your server to send empty responses. ● Test how your application responds to errors on your server by modifying response status codes to be 500 so that timers or polls automatically fire without having to wait for the required time in your tests.
  • 9. Cypress Supported Browser/Language. ● Browser ○ Chrome ○ Electron ○ Firefox & IE [Not Supported/ Under Construction.] ● Language Support ○ JavaScript
  • 11. Cypress Setup ● As cypress is a JavaScript automation tool, that’s why we need to work with modern JavaScript tools like Node.JS and NPM. To install node.js from scratch please visit the node.js official website. ○ $ node –version // to check the node installed or not. ○ $ npm init -y // This command will create a package.json file and initialize a folder to accept the npm command. ○ $ npm install cypress@[version] // install an specific version of cypress, here version is an optional field.
  • 12. Run Cypress ● $ npx cypress open // It will open cypress test runner and create a folder structure in your project directory. ○ Cypress ■ Fixture: It contains all the data files which contains some static configuration and user data. for ex. username, password etc. ■ Integration: It contains all the test files, the test that we write will be in this folder. ● Examples: It is a sub folder in integration older that contains some of predefined examples, it is automatically generated when we first install the cypress. ■ plugins: As cypress is also a node process, so we can integrate ‘n’ number of plugins here by putting them in this folder. ■ support: it includes reusable behavior such as Custom Commands or global overrides that you want applied and available to all of your spec files.
  • 13. Cypress Test Runner ● Cypress runs tests in a unique interactive runner that allows you to see commands as they execute while also viewing the application under test. ● Cypress Test Runner Contains: ○ Command Log ○ Test Status Menu ○ URL Preview ○ App Preview and more...
  • 15. Write a basic test. ● As cypress support javascript so we need to follow the standards of at least one javascript framework like Chai, Jasmine or Mocha. ● Cypress recommend to use inbuilt framework Mocha.
  • 16. Cypress Locator Strategy ● Cypress support Jquery locators. ○ CSS Selector ● Some commands in Cypress are for interacting with the DOM such as: ○ .click() ○ .dblclick() ○ .rightclick() ○ .type() ○ .clear() ○ .check() ○ .uncheck() ○ .select() ○ .trigger()

Editor's Notes

  • #2: Hello Everyone, As you all know, I am Gaurav Shukla, currently working in Knoldus as a module lead QA consultant since last 4.5 years and currently sitted in the 4th block of Knoldus growth path. So today we gather here to discuss something about an FE automation testing tool named cypress.io.
  • #3: Let's have a look on the agenda of today's session.
  • #4: Before moving on further, let’s have a quick introduction about progressive web app, might be some of you haven't heard the phrase previously.
  • #5: What is cypress.io? That’s pretty straight forward. Cypress.io is a frontend automation testing tool built for modern web applications developed on some of the emerging technologies like Reactjs, Ionic, Vue,and Angular. Cypress is a test automation tool that can perform fast, easy and reliable testing for anything that runs in a browser.
  • #6: What are the major questions in our mind when we pick a tool to automate tests? 1) How to Setup? 2) How to write test? 3) How to run those test? 4) How to debug if any test failed? Let's keep cypress out from the picture and try to figure out the answers of above four questions from a selenium user like me. 1) How to setup? Selenium setup is a lengthy process, choose framework, setup environment, configure pom.xml or build.sbt, integrate an another testNg framework or apache POI to achieve data driven capabilities and many more. WHich is a timetaking process and in real life scenarios we are lazy tester we don't have much time to do all these things. 2) How to write test? I love this question, selenium is a great tool and it's really a very tedious jpb to write tests in selenium for a person who has just started his carrier as a qa, so most of the companies prefer developers to write selenium scripts, as it requires good programming skills. 3) How to run those test? Test running is not a problem, it is just a small command, but to run on a specific browser, run the test parrallely, ci/cd integration, is also not an easy task. 4) How to debug? if any test failed: Debugging is also a tedius jon in selenium, for ex: if broser version is not compatible with selenium then you can not find the root cause just to see the error message in terminal. Cypress makes these 4 tasks amazingly simple: 1) How to setup? As it is a javascript framework built on modern tools like node and npm, so to setup cypress is just a one step process by using command like npm install cypress. 2) How to write test? as it is a javascript framework and support mocha as a test runner with a very simple syntax for writing test. 3) Run the test? As we just need to do browser configuration iin package.json so we don't need to worry about the browser driver and all to run the test on specific browser. 4) How to debug? Debugging in easy as you can see each and every failure on the dashboard with easy to understand error messages.
  • #7: We write test scripts that wrapped as a JSON file and it is sent to the browser driver, what are browser drivers, it acts as a web browser but not an actual browser, so everytime when we need to run the test we need to invoke the driver instance for a particular browser. like chromeDriver, geckoDriver, safariDriver, IEDrive etc. So we invoke a browser driver and inject our code in that driver which interpret the code and insprect the necesary commands and sent to the web browser to perform actions. SO this is how it work, to not directly interact with the browser. There is a mediator who perform all the operations on behalf. That's why it is little slow, not is selenium, any tools wthose uses selenium as there parent.
  • #8: Let's see how cypress work. Cypress engine Directly Operates inside the browser. So in a nutshell it is a browser that is executing your code not a proxy server like a specific browser driver. that enable cypress to listen and modify the browser behavior at run time by manipulating DOM and altering network request and responses on the fly. Ability to mock the server response: As cypress run inside the browser, so it has ability to access all the network requests and when we get the repsonse cypress intelligently stop that response and inject that mock response to the browser. So as everything is running on the browser so now instead of specific browser driver it's browser responsibility to take care all the things and complete the test execution. And it opens the door of new kind of testing with having ultimate control over application [FE and BE].
  • #9: So as we have already seen how cypress architure different from selenium, but apart from architecture there are some other features it have which makes cypress a better tool. Someof them are:
  • #10: As of now cypress only support chrome and electron browser which is a lightweight version of chrome browser and only support Javascript, it might be a drawback of cypress, but if we talk with a perspective that FE community majorly work with javascript, and for backend we might be little worry about language support but for FE, it’s not a major drawback for me. If we talk in terms of browser support so as per the report of sep 2019 chrome own the 70% market of desktop internet browser. See:
  • #11: Change the Snippet
  • #17: Cypress claims they use jquery locators, jquery locators are nothings it’s just a css selector. AS selenium has lot of locators like id, name, classname, xpath, css selector, but cypress only supports css selector.