SlideShare une entreprise Scribd logo
1  sur  56
Test Automation with RoR for dummies Aug, 2011 Eran Nelinger, SAP Labs eran.nelinger@sap.com
Why Test Automation Rails Testing Theory Deep dive into ‘Test’ directory Other automation investment tips 8/22/2011
Why Test Automation Rails Testing Theory Deep dive into ‘Test’ directory Other automation investment tips 8/22/2011
8/22/2011
8/22/2011
8/22/2011 Life’s too short for manual testing…
8/22/2011 ,[object Object]
Machine can better remember expected output,[object Object]
8/22/2011 ,[object Object]
If we would like to write efficient tests, they’ll need to interact with databases,[object Object]
On the other hand we want to rebuild our data each time before a test run,[object Object],[object Object]
8/22/2011
8/22/2011
8/22/2011 test/unit: Unit-tests in rails are model-tests Logical assertions of our application’s business logic Should include at list one test method for every method in the model
8/22/2011 test/unit/helpers: Any method that might be used in more then one test-case
8/22/2011 test/unit/test_helper.rb: Define ActiveSupport::TestCase class which is the base class for each test (not only unit) Requires by each of the test files Switch to RAILS_ENV = “test” Brings us assertions from test test/unit
8/22/2011 test/functional ActionController::TestCase Controller specific tests ,[object Object]
was the user redirected to the right page?
was the user successfully authenticated?
was the correct object stored in the response template?
was the appropriate message displayed to the user in the view?,[object Object]
8/22/2011 test/performance ActionDispatch::PerformanceTest Runs a code profiler of each test method Flat and graph_html output is written by defauls
8/22/2011 Before running the tests: $ rake db:migrate 	runs any pending migrations on the development environment and updatesdb/schema.rb $ rake db:test:load 		recreates the test database from the 		  	current db/schema.rb
8/22/2011 ,[object Object]
Actually performs a check to see if expected==actual,[object Object]
Actually performs a check to see if expected==actual,[object Object],[object Object]
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
Why Test Automation Rails Testing Theory Deep dive into ‘Test’ directory (Controller testing) Other automation investment tips 8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
Why Test Automation Rails Testing Theory Deep dive into ‘Test’ directory (View testing) Other automation investment tips 8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011 http://guides.rubyonrails.org/testing.html http://guides.rubyonrails.org/ http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/Assertions.html http://api.rubyonrails.org/classes/ActiveSupport/TestCase.html http://api.rubyonrails.org/classes/ActionController/TestCase.html http://rdoc.info/github/rails/rails/master/ActionDispatch/IntegrationTest http://watir.com/ http://pivotal.github.com/jasmine/ http://railscasts.com/episodes/261-testing-javascript-with-jasmine

Contenu connexe

Tendances

Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
Yana Altunyan
 
Less03 2 e_testermodule_2
Less03 2 e_testermodule_2Less03 2 e_testermodule_2
Less03 2 e_testermodule_2
Suresh Mishra
 
UFT Automation Framework Introduction
UFT Automation Framework IntroductionUFT Automation Framework Introduction
UFT Automation Framework Introduction
Himal Bandara
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]
Suraj Singh
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentation
vigneshasromio
 

Tendances (18)

Uft Basics
Uft BasicsUft Basics
Uft Basics
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
 
Less03 2 e_testermodule_2
Less03 2 e_testermodule_2Less03 2 e_testermodule_2
Less03 2 e_testermodule_2
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionSoftware Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
 
UFT Automation Framework Introduction
UFT Automation Framework IntroductionUFT Automation Framework Introduction
UFT Automation Framework Introduction
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
 
Resilience and chaos engineering
Resilience and chaos engineeringResilience and chaos engineering
Resilience and chaos engineering
 
Unit testing in Force.com platform
Unit testing in Force.com platformUnit testing in Force.com platform
Unit testing in Force.com platform
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]
 
Qtp certification training_material
Qtp certification training_materialQtp certification training_material
Qtp certification training_material
 
Testcase Preparation Checklist
Testcase Preparation ChecklistTestcase Preparation Checklist
Testcase Preparation Checklist
 
Tc Checklist
Tc ChecklistTc Checklist
Tc Checklist
 
Top 25 Selenium Interview Questions and Answers 2018
Top 25 Selenium Interview Questions and Answers 2018Top 25 Selenium Interview Questions and Answers 2018
Top 25 Selenium Interview Questions and Answers 2018
 
The complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David TzemachThe complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David Tzemach
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentation
 
Reactive Programming or Reactive Systems? (spoiler: both)
Reactive Programming or Reactive Systems? (spoiler: both)Reactive Programming or Reactive Systems? (spoiler: both)
Reactive Programming or Reactive Systems? (spoiler: both)
 
MichaelGutierrezSpr2017
MichaelGutierrezSpr2017MichaelGutierrezSpr2017
MichaelGutierrezSpr2017
 
Module Owb Process Flows
Module Owb Process FlowsModule Owb Process Flows
Module Owb Process Flows
 

En vedette

En vedette (6)

QTP10 _ 9.5 _
QTP10 _ 9.5 _ QTP10 _ 9.5 _
QTP10 _ 9.5 _
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and you
 
SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
The Presentation Come-Back Kid
The Presentation Come-Back KidThe Presentation Come-Back Kid
The Presentation Come-Back Kid
 
The Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris LemaThe Buyer's Journey - by Chris Lema
The Buyer's Journey - by Chris Lema
 

Similaire à Testing in Rails 3.x

Successful Teams are TDD Teams
Successful Teams are TDD TeamsSuccessful Teams are TDD Teams
Successful Teams are TDD Teams
Rob Myers
 
Final Automation Testing
Final Automation TestingFinal Automation Testing
Final Automation Testing
priya_trivedi
 
What is Selenium Testing.pdf
What is Selenium Testing.pdfWhat is Selenium Testing.pdf
What is Selenium Testing.pdf
AnanthReddy38
 

Similaire à Testing in Rails 3.x (20)

Ijetcas14 413
Ijetcas14 413Ijetcas14 413
Ijetcas14 413
 
Top 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptxTop 30 Selenium Interview Questions.pptx
Top 30 Selenium Interview Questions.pptx
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Test automation wipro
Test automation   wiproTest automation   wipro
Test automation wipro
 
7 Effective Practices to Follow for Selenium Automation Testing
7 Effective Practices to Follow for Selenium Automation Testing7 Effective Practices to Follow for Selenium Automation Testing
7 Effective Practices to Follow for Selenium Automation Testing
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)
 
Successful Teams are TDD Teams
Successful Teams are TDD TeamsSuccessful Teams are TDD Teams
Successful Teams are TDD Teams
 
7.pdf
7.pdf7.pdf
7.pdf
 
Test automation framework
Test automation frameworkTest automation framework
Test automation framework
 
Final Automation Testing
Final Automation TestingFinal Automation Testing
Final Automation Testing
 
Fitnesse, Watir and Ruby Based Test Automation System
Fitnesse, Watir and Ruby Based Test Automation SystemFitnesse, Watir and Ruby Based Test Automation System
Fitnesse, Watir and Ruby Based Test Automation System
 
Performance Testing REST APIs
Performance Testing REST APIsPerformance Testing REST APIs
Performance Testing REST APIs
 
Data Driven Framework in Selenium
Data Driven Framework in SeleniumData Driven Framework in Selenium
Data Driven Framework in Selenium
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
 
What is Selenium Testing.pdf
What is Selenium Testing.pdfWhat is Selenium Testing.pdf
What is Selenium Testing.pdf
 
Oracle application testing suite (OATS)
Oracle application testing suite (OATS)Oracle application testing suite (OATS)
Oracle application testing suite (OATS)
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Rails Testing
Rails TestingRails Testing
Rails Testing
 
What is selenium
What is seleniumWhat is selenium
What is selenium
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
[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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Testing in Rails 3.x