SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Testing
with
Cypress
Follow us
@danivieira
@karolineleite
Today’s subject
Why automate testing?
➔ Reduce time and effort
➔ Increase productivity
➔ Increase reliability
What tests to automate?
➔ Regression tests
➔ Smoke tests
Following the user journey and respecting the test pyramid
How to automate?
CYPRESS
WebApp. Chrome. Fast.Javascript.
Let’s code!
Installing Cypress
● Visit https://download.cypress.io/desktop
Installing an editor
● Visit https://atom.io/
1. Create a folder to the project
2. Open the folder with Cypress
3. Open the folder with your editor
4. Create a file to our first test, inside the folder:
cypress/integration/
it('Does not do much!', function() {
})
it('visits Google', function() {
cy.visit('http://google.com')
})
Basic interaction
cy.visit('https://example.cypress.io')
cy.title().should('include', 'Kitchen Sink')
cy.get('#query-btn').should('contain', 'Button')
Commands are what you send to the browser
Asserts are what validate the results
Selectores are how you identify the web elements
● Identifiers for HTML elements
● Be simple: ID, NAME, ATTRIBUTES, CSS
● Avoid: XPATH
Selectors
1. Create another test file inside the integration folder
2. Open the website https://the-internet.herokuapp.com/
3. Create one test for the ‘Forgot Password’
1. Create another test file inside the integration folder
2. Open the website https://the-internet.herokuapp.com/
3. Create one test for the ‘Form Authentication’
1. Let’s create more alternative test scenarios for Form
Authentication
describe('Does not do much!', function(){
})
describe('Does not do much!', function(){
it('Does not do much again!', function() {
})
})
describe('Does not do much!', function(){
it('Does not do much again!', function() {
})
it('Does not do anything', function() {
})
})
1. Create another test file inside the integration folder
2. Open the website https://the-internet.herokuapp.com/
3. Create one test for the ‘Add/Remove elements’
Versioning the code
Git & Github
If you know nothing about Git and Github, let's do it:
1) Download & install GIT: https://git-scm.com/downloads
2) Create an account on Github https://github.com/
a) Add your SSH keys to your Settings
b) Create a new repository
c) git init
d) git remote add origin git@github.com:<your_repo_here>
e) git add
f) git commit -m "first commit"
g) git push -u origin master
Using the command
line in your computer
Running on
Cypress Dashboard
Cypress dashboard
1) Create an account on Cypress Dashboard
https://dashboard.cypress.io using your Github account
2) Setup your project locally on Cypress
a) To run by command line you need to install NODE.JS and NPM
https://nodejs.org/en/download/
b) npm init -y
c) npm install cypress
d) npx cypress run --record --key <your_key>
Running on CI/CD
CircleCI
1) Create an account on CircleCI: https://circleci.com/ using
your Github account
2) Add your project at “Add projects” menu
a) Follow the basic instructions
b) Create the .circleci/ folder and add this file: http://bit.ly/circleci
c) Add command line instruction to package.json file
https://testautomationu.applitools.com/cypress-tutorial/
https://github.com/testgirls/cypress-project-en
OBRIGADA!
THANK YOU!
ola@testgirls.com.br
dani@testgirls.com.br +55 (11) 98650-7473
karol@testgirls.com.br +55 (11) 97328-1445
Follow us
https://www.linkedin.com/company/test-girls/
https://www.meetup.com/test-girls
https://twitter.com/_testgirls
https://www.instagram.com/_testgirls/
https://facebook.com/thetestgirls

Mais conteúdo relacionado

Mais procurados

The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
D
 

Mais procurados (20)

Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Automated android testing using jenkins ci
Automated android testing using jenkins ciAutomated android testing using jenkins ci
Automated android testing using jenkins ci
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
 
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
 
Kloud
KloudKloud
Kloud
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Setup Build & Deploy with Jenkins CI
Setup Build & Deploy with Jenkins CISetup Build & Deploy with Jenkins CI
Setup Build & Deploy with Jenkins CI
 
Automated-Testing-inside-containers
Automated-Testing-inside-containersAutomated-Testing-inside-containers
Automated-Testing-inside-containers
 
Build testable react app
Build testable react appBuild testable react app
Build testable react app
 
Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"
 
Dockerizing react app
Dockerizing react appDockerizing react app
Dockerizing react app
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking Jenkins
 
Let’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkinsLet’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkins
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus Deploy
 

Semelhante a [English][Test Girls] Zero to Hero: Start Test automation with Cypress

Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
Shawn Price
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobot
Tsai Tsung-Yi
 

Semelhante a [English][Test Girls] Zero to Hero: Start Test automation with Cypress (20)

Automating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and DrushAutomating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and Drush
 
OpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATXOpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATX
 
Automation Zaman Now
Automation Zaman NowAutomation Zaman Now
Automation Zaman Now
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
 
GitHub Actions for 5 minutes
GitHub Actions for 5 minutesGitHub Actions for 5 minutes
GitHub Actions for 5 minutes
 
DWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHubDWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHub
 
SydJS.com
SydJS.comSydJS.com
SydJS.com
 
Cache Me If You Can - Tuist Quick Start .pptx
Cache Me If You Can - Tuist Quick Start .pptxCache Me If You Can - Tuist Quick Start .pptx
Cache Me If You Can - Tuist Quick Start .pptx
 
GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
Coding GRIN GLOBAL Wizards
Coding GRIN GLOBAL WizardsCoding GRIN GLOBAL Wizards
Coding GRIN GLOBAL Wizards
 
Optimizing Your CI Pipelines
Optimizing Your CI PipelinesOptimizing Your CI Pipelines
Optimizing Your CI Pipelines
 
Web works hol
Web works holWeb works hol
Web works hol
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobot
 
Git and git hub basics
Git and git hub basicsGit and git hub basics
Git and git hub basics
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 

Mais de Test Girls

Mais de Test Girls (10)

Test Girls - Workshop Testes de Performance
Test Girls  - Workshop Testes de PerformanceTest Girls  - Workshop Testes de Performance
Test Girls - Workshop Testes de Performance
 
Workshop de Testes com Cypress
Workshop de Testes com CypressWorkshop de Testes com Cypress
Workshop de Testes com Cypress
 
Bug Bash - Uma estratégia colaborativa de testes - Raquel Doná
Bug Bash - Uma estratégia colaborativa de testes - Raquel DonáBug Bash - Uma estratégia colaborativa de testes - Raquel Doná
Bug Bash - Uma estratégia colaborativa de testes - Raquel Doná
 
Qualidade - end to end - Camila de Mauro
Qualidade - end to end - Camila de MauroQualidade - end to end - Camila de Mauro
Qualidade - end to end - Camila de Mauro
 
Treta Hunting - Cris Barbosa
Treta Hunting - Cris BarbosaTreta Hunting - Cris Barbosa
Treta Hunting - Cris Barbosa
 
Testes de acessibilidade, o que são? - Camila Marinho Garcia e Cristina Stoll
Testes de acessibilidade, o que são? - Camila Marinho Garcia e Cristina StollTestes de acessibilidade, o que são? - Camila Marinho Garcia e Cristina Stoll
Testes de acessibilidade, o que são? - Camila Marinho Garcia e Cristina Stoll
 
The future is female - Carine Roos
The future is female - Carine RoosThe future is female - Carine Roos
The future is female - Carine Roos
 
Carreira dentro da área de testes - Nhaiara Moura
Carreira dentro da área de testes - Nhaiara MouraCarreira dentro da área de testes - Nhaiara Moura
Carreira dentro da área de testes - Nhaiara Moura
 
Como funciona uma empresa de tecnologia sem QAs nas equipes? - Sabrina Neri
Como funciona uma empresa de tecnologia sem QAs nas equipes? - Sabrina NeriComo funciona uma empresa de tecnologia sem QAs nas equipes? - Sabrina Neri
Como funciona uma empresa de tecnologia sem QAs nas equipes? - Sabrina Neri
 
Engenharia do chaos - Ana Genari
Engenharia do chaos - Ana GenariEngenharia do chaos - Ana Genari
Engenharia do chaos - Ana Genari
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

[English][Test Girls] Zero to Hero: Start Test automation with Cypress