SlideShare a Scribd company logo
CHEESECAKE
The story of our automatic test suite
BIO
The story of our automated test suite 1
INTRODUCTION
• We had to create an automated test suite for a web
application
• Evolution of our automated test suite
The story of our automated test suite 2
OUR TOOLS
• Open Source
• Easy to learn
• Continuous Integration
• Document app behavior
• Flexibility
The story of our automated test suite 3
#1 WRITE SCENARIOS
Initial State: We need to agree on the wording
Solution 1
The story of our automated test suite 4
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
Scenario: Log in with valid credentials
Given I am on the login page www.myapp.com/login
When I fill the user name with jo@mail.es
And I fill the password with iLoveBdd
And I click the login button
Then I should be redirected to my dashboard
#1 WRITE SCENARIOS
Initial State: We need to agree on the wording
Solution 2
The story of our automated test suite 5
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
Scenario: Log in with valid credentials
Given I am on www.myapp.com/login
When I log in with the following data:
| username | password |
| jo@mail.es | iLoveBdd |
Then I should be redirected to my dashboard
#1 WRITE SCENARIOS
Initial State: We need to agree on the wording
Solution 3
The story of our automated test suite 6
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
Scenario: Log in with valid credentials
Given I am on the login page
When I log in with valid credentials
Then I should be redirected to my dashboard
#1 WRITE SCENARIOS
Initial State: We need to agree on the wording
Solution 3
The story of our automated test suite 7
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
Scenario: Log in with valid credentials
Given I am on the login page
When I log in with valid credentials [email:jo@mail.es]
Then I should be redirected to my dashboard
#2 ENVIRONMENT VARIABLES
Initial State: All test run against same environment
Problem: No flexibility
The story of our automated test suite 8
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#2 ENVIRONMENT VARIABLES
Solution:
• Pass environment variables on the command line to
Cucumber: ENVIRONMENT
The story of our automated test suite 9
$ cucumber ENVIRONMENT=local
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#3 BROWSER INITIALIZATION
Initial State: Browser started for each scenario
Problem: Slow
The story of our automated test suite 10
Before do
@browser = Watir::Browser.new :firefox
end
After do
@browser.quit
end
hooks.rb
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#3 BROWSER INITIALIZATION
Problem: Slow
Solution:
• Open/close the browser when starting/ending the suite
• Clean cookies between scenarios
The story of our automated test suite 11
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#3 BROWSER INITIALIZATION
The story of our automated test suite 12
AfterConfiguration do
$browser = Watir::Browser.new :firefox
end
Before do
@browser = $browser
@browser.cookies.clear
end
at_exit do
$browser.quit
end
hooks.rb
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#4 THE NIGHTLY BUILD
Initial State: Tests were executed on demand
Problem: Slow feedback loop
Solution: Nightly build + Rerun report
The story of our automated test suite 13
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#4 THE NIGHTLY BUILD
The story of our automated test suite 14
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#5 COVERAGE &
REGRESSION
Initial State: Before a deploy all tests are run
Problem: Slow feedback loop
Solution: Select a subset of tests
• Coverage: Tag scenarios
The story of our automated test suite 15
INTRODUCTION REQUIREMENTS OUR TOOLS CHALLENGES
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
smoke
regression
nightly$ cucumber --tags @smoke
$ cucumber features/acceptance/fields
-r features/
#5 COVERAGE &
REGRESSION
Initial State: Before a deploy all tests are run
Problem: Slow feedback loop
Solution: Select a subset of tests
• Regression: Change files structure
The story of our automated test suite 16
INTRODUCTION REQUIREMENTS OUR TOOLS CHALLENGES
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#6 BACKEND TESTING
Initial State: We were only doing UI testing
Problem: Slow feedback and flickering scenarios
Solution: Backend testing
Option 1: New project
The story of our automated test suite 17
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#6 BACKEND TESTING
Initial State: We were only doing UI testing
Problem: Slow feedback and flickering scenarios
Solution: Backend testing
Option 2: Use tags and conditionals inside the
step definitions
The story of our automated test suite 18
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#6 BACKEND TESTING
Initial State: We were only doing UI testing
Problem: Slow feedback and flickering
scenarios
Solution: Backend testing
Option 3: Load different contexts for backend
and frontend testing.
The story of our automated test suite 19
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
#6 BACKEND TESTING
Proof of concept
1. Tag scenarios with @front/@back
2. Re-write scenarios
3. Make step definitions generic
4. Load only one context
The story of our automated test suite 20
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
World(RegistrationStepsFront) if ENV[‘LEVEL’] == ‘front’
#6 BACKEND TESTING
• Reliable
• Fast – Quick feedback
• Easy to maintain
The story of our automated test suite 21
CHALLENGE
#1
CHALLENGE
#2
CHALLENGE
#3
CHALLENGE
#4
CHALLENGE
#5
CHALLENGE
#6
TAKE AWAYS
• Do not be afraid of changes
• Do not try to fix the big problem at once
• Do not think small improvements do not count
• Do not stop improving
The story of our automated test suite 22
THANK YOU
The story of our automated test suite 23
@bugbustersbcn
#bugbustersbcn
linkedin.com/in/gloriahornero
linkedin.com/in/aidamanna

More Related Content

Viewers also liked

Case study 4
Case study 4Case study 4
Case study 4
khaled alsaeh
 
Case study 2
Case study 2Case study 2
Case study 2
khaled alsaeh
 
Case study 6
Case study 6Case study 6
Case study 6
khaled alsaeh
 
Case study 8
Case study 8Case study 8
Case study 8
khaled alsaeh
 
Case study 3
Case study 3Case study 3
Case study 3
khaled alsaeh
 
Case study 7
Case study 7Case study 7
Case study 7
khaled alsaeh
 

Viewers also liked (6)

Case study 4
Case study 4Case study 4
Case study 4
 
Case study 2
Case study 2Case study 2
Case study 2
 
Case study 6
Case study 6Case study 6
Case study 6
 
Case study 8
Case study 8Case study 8
Case study 8
 
Case study 3
Case study 3Case study 3
Case study 3
 
Case study 7
Case study 7Case study 7
Case study 7
 

Similar to Cheesecake

Expoqa17 - Cheesecake: The evolution of our automatic test suite
Expoqa17 - Cheesecake: The evolution of our automatic test suiteExpoqa17 - Cheesecake: The evolution of our automatic test suite
Expoqa17 - Cheesecake: The evolution of our automatic test suite
Bugbustersbcn
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
Dhanasekaran Nagarajan
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
Blue Elephant Consulting
 
Trust issues with_ui_automation
Trust issues with_ui_automationTrust issues with_ui_automation
Trust issues with_ui_automation
Bijoya Chatterjee
 
Great! another bug
Great! another bugGreat! another bug
Great! another bug
AgileCoach.net
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your Database
David Wheeler
 
Test automation engineer
Test automation engineerTest automation engineer
Test automation engineer
Sadaaki Emura
 
Petri for kyiv.pptx
Petri for kyiv.pptxPetri for kyiv.pptx
Petri for kyiv.pptx
Talya Gendler
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
Blue Elephant Consulting
 
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
Sauce Labs
 
Code Camp Applying Modern Software Development Techniques To Ui Testing
Code Camp  Applying Modern Software Development Techniques To Ui TestingCode Camp  Applying Modern Software Development Techniques To Ui Testing
Code Camp Applying Modern Software Development Techniques To Ui TestingChristopherGTaylor
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
Andreas Grabner
 
The React Cookbook: Advanced Recipes to Level Up Your Next App
The React Cookbook: Advanced Recipes to Level Up Your Next AppThe React Cookbook: Advanced Recipes to Level Up Your Next App
The React Cookbook: Advanced Recipes to Level Up Your Next App
FITC
 
Software testing introduction
Software testing introductionSoftware testing introduction
Software testing introduction
Sriman Eshwar
 
Systematic Unit Testing
Systematic Unit TestingSystematic Unit Testing
Systematic Unit Testing
scotchfield
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
Amir Barylko
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
Machine learning pipeline
Machine learning pipelineMachine learning pipeline
Machine learning pipeline
Vadym Kuzmenko
 
The PHP Way Of TDD - Think First, Code Later
The PHP Way Of TDD - Think First, Code LaterThe PHP Way Of TDD - Think First, Code Later
The PHP Way Of TDD - Think First, Code Later
Hiraq Citra M
 
Testing In Django
Testing In DjangoTesting In Django
Testing In Django
Daniel Greenfeld
 

Similar to Cheesecake (20)

Expoqa17 - Cheesecake: The evolution of our automatic test suite
Expoqa17 - Cheesecake: The evolution of our automatic test suiteExpoqa17 - Cheesecake: The evolution of our automatic test suite
Expoqa17 - Cheesecake: The evolution of our automatic test suite
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 
Trust issues with_ui_automation
Trust issues with_ui_automationTrust issues with_ui_automation
Trust issues with_ui_automation
 
Great! another bug
Great! another bugGreat! another bug
Great! another bug
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your Database
 
Test automation engineer
Test automation engineerTest automation engineer
Test automation engineer
 
Petri for kyiv.pptx
Petri for kyiv.pptxPetri for kyiv.pptx
Petri for kyiv.pptx
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
 
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
10x Test Coverage, Less Drama: Shift Left Functional & Performance Testing
 
Code Camp Applying Modern Software Development Techniques To Ui Testing
Code Camp  Applying Modern Software Development Techniques To Ui TestingCode Camp  Applying Modern Software Development Techniques To Ui Testing
Code Camp Applying Modern Software Development Techniques To Ui Testing
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
 
The React Cookbook: Advanced Recipes to Level Up Your Next App
The React Cookbook: Advanced Recipes to Level Up Your Next AppThe React Cookbook: Advanced Recipes to Level Up Your Next App
The React Cookbook: Advanced Recipes to Level Up Your Next App
 
Software testing introduction
Software testing introductionSoftware testing introduction
Software testing introduction
 
Systematic Unit Testing
Systematic Unit TestingSystematic Unit Testing
Systematic Unit Testing
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Machine learning pipeline
Machine learning pipelineMachine learning pipeline
Machine learning pipeline
 
The PHP Way Of TDD - Think First, Code Later
The PHP Way Of TDD - Think First, Code LaterThe PHP Way Of TDD - Think First, Code Later
The PHP Way Of TDD - Think First, Code Later
 
Testing In Django
Testing In DjangoTesting In Django
Testing In Django
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

Cheesecake

  • 1. CHEESECAKE The story of our automatic test suite
  • 2. BIO The story of our automated test suite 1
  • 3. INTRODUCTION • We had to create an automated test suite for a web application • Evolution of our automated test suite The story of our automated test suite 2
  • 4. OUR TOOLS • Open Source • Easy to learn • Continuous Integration • Document app behavior • Flexibility The story of our automated test suite 3
  • 5. #1 WRITE SCENARIOS Initial State: We need to agree on the wording Solution 1 The story of our automated test suite 4 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 Scenario: Log in with valid credentials Given I am on the login page www.myapp.com/login When I fill the user name with jo@mail.es And I fill the password with iLoveBdd And I click the login button Then I should be redirected to my dashboard
  • 6. #1 WRITE SCENARIOS Initial State: We need to agree on the wording Solution 2 The story of our automated test suite 5 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 Scenario: Log in with valid credentials Given I am on www.myapp.com/login When I log in with the following data: | username | password | | jo@mail.es | iLoveBdd | Then I should be redirected to my dashboard
  • 7. #1 WRITE SCENARIOS Initial State: We need to agree on the wording Solution 3 The story of our automated test suite 6 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 Scenario: Log in with valid credentials Given I am on the login page When I log in with valid credentials Then I should be redirected to my dashboard
  • 8. #1 WRITE SCENARIOS Initial State: We need to agree on the wording Solution 3 The story of our automated test suite 7 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 Scenario: Log in with valid credentials Given I am on the login page When I log in with valid credentials [email:jo@mail.es] Then I should be redirected to my dashboard
  • 9. #2 ENVIRONMENT VARIABLES Initial State: All test run against same environment Problem: No flexibility The story of our automated test suite 8 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 10. #2 ENVIRONMENT VARIABLES Solution: • Pass environment variables on the command line to Cucumber: ENVIRONMENT The story of our automated test suite 9 $ cucumber ENVIRONMENT=local CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 11. #3 BROWSER INITIALIZATION Initial State: Browser started for each scenario Problem: Slow The story of our automated test suite 10 Before do @browser = Watir::Browser.new :firefox end After do @browser.quit end hooks.rb CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 12. #3 BROWSER INITIALIZATION Problem: Slow Solution: • Open/close the browser when starting/ending the suite • Clean cookies between scenarios The story of our automated test suite 11 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 13. #3 BROWSER INITIALIZATION The story of our automated test suite 12 AfterConfiguration do $browser = Watir::Browser.new :firefox end Before do @browser = $browser @browser.cookies.clear end at_exit do $browser.quit end hooks.rb CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 14. #4 THE NIGHTLY BUILD Initial State: Tests were executed on demand Problem: Slow feedback loop Solution: Nightly build + Rerun report The story of our automated test suite 13 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 15. #4 THE NIGHTLY BUILD The story of our automated test suite 14 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 16. #5 COVERAGE & REGRESSION Initial State: Before a deploy all tests are run Problem: Slow feedback loop Solution: Select a subset of tests • Coverage: Tag scenarios The story of our automated test suite 15 INTRODUCTION REQUIREMENTS OUR TOOLS CHALLENGES CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 smoke regression nightly$ cucumber --tags @smoke
  • 17. $ cucumber features/acceptance/fields -r features/ #5 COVERAGE & REGRESSION Initial State: Before a deploy all tests are run Problem: Slow feedback loop Solution: Select a subset of tests • Regression: Change files structure The story of our automated test suite 16 INTRODUCTION REQUIREMENTS OUR TOOLS CHALLENGES CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 18. #6 BACKEND TESTING Initial State: We were only doing UI testing Problem: Slow feedback and flickering scenarios Solution: Backend testing Option 1: New project The story of our automated test suite 17 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 19. #6 BACKEND TESTING Initial State: We were only doing UI testing Problem: Slow feedback and flickering scenarios Solution: Backend testing Option 2: Use tags and conditionals inside the step definitions The story of our automated test suite 18 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 20. #6 BACKEND TESTING Initial State: We were only doing UI testing Problem: Slow feedback and flickering scenarios Solution: Backend testing Option 3: Load different contexts for backend and frontend testing. The story of our automated test suite 19 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 21. #6 BACKEND TESTING Proof of concept 1. Tag scenarios with @front/@back 2. Re-write scenarios 3. Make step definitions generic 4. Load only one context The story of our automated test suite 20 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6 World(RegistrationStepsFront) if ENV[‘LEVEL’] == ‘front’
  • 22. #6 BACKEND TESTING • Reliable • Fast – Quick feedback • Easy to maintain The story of our automated test suite 21 CHALLENGE #1 CHALLENGE #2 CHALLENGE #3 CHALLENGE #4 CHALLENGE #5 CHALLENGE #6
  • 23. TAKE AWAYS • Do not be afraid of changes • Do not try to fix the big problem at once • Do not think small improvements do not count • Do not stop improving The story of our automated test suite 22
  • 24. THANK YOU The story of our automated test suite 23 @bugbustersbcn #bugbustersbcn linkedin.com/in/gloriahornero linkedin.com/in/aidamanna