SlideShare a Scribd company logo
Test Automation with RoR for dummiesAug, 2011Eran Nelinger, SAP Labseran.nelinger@sap.com
Why Test AutomationRails Testing TheoryDeep dive into ‘Test’ directoryOther automation investment tips8/22/2011
Why Test AutomationRails Testing TheoryDeep dive into ‘Test’ directoryOther automation investment tips8/22/2011
8/22/2011
8/22/2011
8/22/2011Life’s too short for manual testing…
8/22/2011Rails make it super-easy for us to write tests (Almost everything we need is already in place with scaffolding)
Machine can better remember expected outputWhy Test AutomationRails Testing TheoryDeep dive into ‘Test’ directoryOther automation investment tips8/22/2011
8/22/2011Rails applications typically interacts heavily with databases
If we would like to write efficient tests, they’ll need to interact with databases8/22/2011We would like to be able to run our test in such environment where messing our data does not really make a difference
On the other hand we want to rebuild our data each time before a test run8/22/2011The Three Environments approach allows us to set up and interact with test data without any danger of your tests altering data from your production environment8/22/2011test/fixtures:Just a fancy word for ‘sample-data’Populate our test-schema with content each time before a test runsDatabase independent Supports YAML as well as CSV
8/22/2011
8/22/2011
8/22/2011test/unit:Unit-tests in rails are model-testsLogical assertions of our application’s business logicShould include at list one test method for every method in the model
8/22/2011test/unit/helpers:Any method that might be used in more then one test-case
8/22/2011test/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 filesSwitch to RAILS_ENV = “test”Brings us assertions from test test/unit
8/22/2011test/functionalActionController::TestCaseController specific testswas the web request successful?
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?8/22/2011test/integrationActionController::IntegrationTestInteraction among number of controllersGenerally used to test important flowsFixtures -> to be included explicitly
8/22/2011test/performanceActionDispatch::PerformanceTestRuns a code profiler of each test methodFlat and graph_html output is written by defauls
8/22/2011Before 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/2011Assertions are the working bees of testing
Actually performs a check to see if expected==actual8/22/2011Assertions are the working bees of testing
Actually performs a check to see if expected==actual8/22/2011Rails specific assertionsWhy Test AutomationRails Testing TheoryDeep dive into ‘Test’ directory (Model testing)Other automation investment tips8/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
8/22/2011
Why Test AutomationRails Testing TheoryDeep dive into ‘Test’ directory (Controller testing)Other automation investment tips8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
8/22/2011
Why Test AutomationRails Testing TheoryDeep dive into ‘Test’ directory (View testing)Other automation investment tips8/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/2011http://guides.rubyonrails.org/testing.htmlhttp://guides.rubyonrails.org/http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.htmlhttp://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/Assertions.htmlhttp://api.rubyonrails.org/classes/ActiveSupport/TestCase.htmlhttp://api.rubyonrails.org/classes/ActionController/TestCase.htmlhttp://rdoc.info/github/rails/rails/master/ActionDispatch/IntegrationTesthttp://watir.com/http://pivotal.github.com/jasmine/http://railscasts.com/episodes/261-testing-javascript-with-jasmine

More Related Content

PPT
Less02 2 e_testermodule_1
Suresh Mishra
 
PPT
Bealls florida automation overview
Vijay Rangaiah
 
PPT
Less14 3 e_loadmodule_4
Suresh Mishra
 
PPT
Ppt of soap ui
pkslide28
 
PPT
Less07 2 e_testermodule_6
Suresh Mishra
 
PPTX
Why Back-end is the most important part of the system
BugRaptors
 
PPT
ALP. Short facts
Alex
 
Less02 2 e_testermodule_1
Suresh Mishra
 
Bealls florida automation overview
Vijay Rangaiah
 
Less14 3 e_loadmodule_4
Suresh Mishra
 
Ppt of soap ui
pkslide28
 
Less07 2 e_testermodule_6
Suresh Mishra
 
Why Back-end is the most important part of the system
BugRaptors
 
ALP. Short facts
Alex
 

What's hot (18)

PPTX
Uft Basics
Archana Krushnan
 
PPTX
Selenium IDE and Extensions
Yana Altunyan
 
PPT
Less03 2 e_testermodule_2
Suresh Mishra
 
PPT
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
PPTX
UFT Automation Framework Introduction
Himal Bandara
 
PPTX
Twelve Factor - Designing for Change
Eric Wyles
 
PPTX
Resilience and chaos engineering
Eric Wyles
 
PDF
Unit testing in Force.com platform
Chamil Madusanka
 
PPTX
Testclass [Autosaved]
Suraj Singh
 
PDF
Qtp certification training_material
Vishwaprakash Sahoo
 
PDF
Testcase Preparation Checklist
Sreeram Kishore Chavali
 
PDF
Tc Checklist
nazeer pasha
 
PDF
Top 25 Selenium Interview Questions and Answers 2018
Testbytes
 
PPTX
The complete guide for software integration testing | David Tzemach
David Tzemach
 
PPSX
Software testing and_quality_assurance_powerpoint_presentation
vigneshasromio
 
PDF
Reactive Programming or Reactive Systems? (spoiler: both)
Fabio Tiriticco
 
DOCX
MichaelGutierrezSpr2017
Michael Gutierrez
 
PPT
Module Owb Process Flows
Nicholas Goodman
 
Uft Basics
Archana Krushnan
 
Selenium IDE and Extensions
Yana Altunyan
 
Less03 2 e_testermodule_2
Suresh Mishra
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
UFT Automation Framework Introduction
Himal Bandara
 
Twelve Factor - Designing for Change
Eric Wyles
 
Resilience and chaos engineering
Eric Wyles
 
Unit testing in Force.com platform
Chamil Madusanka
 
Testclass [Autosaved]
Suraj Singh
 
Qtp certification training_material
Vishwaprakash Sahoo
 
Testcase Preparation Checklist
Sreeram Kishore Chavali
 
Tc Checklist
nazeer pasha
 
Top 25 Selenium Interview Questions and Answers 2018
Testbytes
 
The complete guide for software integration testing | David Tzemach
David Tzemach
 
Software testing and_quality_assurance_powerpoint_presentation
vigneshasromio
 
Reactive Programming or Reactive Systems? (spoiler: both)
Fabio Tiriticco
 
MichaelGutierrezSpr2017
Michael Gutierrez
 
Module Owb Process Flows
Nicholas Goodman
 
Ad

Viewers also liked (6)

DOCX
QTP10 _ 9.5 _
Sandeep Yadav
 
PPTX
Google, quality and you
nelinger
 
PPT
SAP Test automation - fully automatic test of complex business processes incl...
Tobias Trapp
 
PDF
The Near Future of CSS
Rachel Andrew
 
PDF
The Presentation Come-Back Kid
Ethos3
 
PDF
The Buyer's Journey - by Chris Lema
Chris Lema
 
QTP10 _ 9.5 _
Sandeep Yadav
 
Google, quality and you
nelinger
 
SAP Test automation - fully automatic test of complex business processes incl...
Tobias Trapp
 
The Near Future of CSS
Rachel Andrew
 
The Presentation Come-Back Kid
Ethos3
 
The Buyer's Journey - by Chris Lema
Chris Lema
 
Ad

Similar to Testing in Rails 3.x (20)

PDF
Ijetcas14 413
Iasir Journals
 
PPTX
Top 30 Selenium Interview Questions.pptx
Syntax Technologies
 
PDF
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
PDF
A Comprehensive Guide to Generating Extent Reports in Selenium.pdf
kalichargn70th171
 
PDF
Test automation wipro
ambreprasad77
 
PDF
7 Effective Practices to Follow for Selenium Automation Testing
TestingXperts
 
PDF
Building Maintainable Android Apps (DroidCon NYC 2014)
Kevin Schultz
 
PPTX
Successful Teams are TDD Teams
Rob Myers
 
PDF
7.pdf
AffanIT1
 
PPTX
Test automation framework
QACampus
 
PPS
Final Automation Testing
priya_trivedi
 
PDF
Fitnesse, Watir and Ruby Based Test Automation System
Harbinger Systems - HRTech Builder of Choice
 
PDF
Guide To Running Parallel Test Cases in TestNG.pdf
kalichargn70th171
 
PPTX
Performance Testing REST APIs
Jason Weden
 
PDF
How to Start Unit Testing in Laravel.pdf
Shiv Technolabs
 
PDF
Data Driven Framework in Selenium
Knoldus Inc.
 
PDF
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PROIDEA
 
PDF
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PROIDEA
 
PDF
What is Selenium Testing.pdf
AnanthReddy38
 
PPTX
Oracle application testing suite (OATS)
Koushik Arvapally
 
Ijetcas14 413
Iasir Journals
 
Top 30 Selenium Interview Questions.pptx
Syntax Technologies
 
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
A Comprehensive Guide to Generating Extent Reports in Selenium.pdf
kalichargn70th171
 
Test automation wipro
ambreprasad77
 
7 Effective Practices to Follow for Selenium Automation Testing
TestingXperts
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Kevin Schultz
 
Successful Teams are TDD Teams
Rob Myers
 
7.pdf
AffanIT1
 
Test automation framework
QACampus
 
Final Automation Testing
priya_trivedi
 
Fitnesse, Watir and Ruby Based Test Automation System
Harbinger Systems - HRTech Builder of Choice
 
Guide To Running Parallel Test Cases in TestNG.pdf
kalichargn70th171
 
Performance Testing REST APIs
Jason Weden
 
How to Start Unit Testing in Laravel.pdf
Shiv Technolabs
 
Data Driven Framework in Selenium
Knoldus Inc.
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PROIDEA
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PROIDEA
 
What is Selenium Testing.pdf
AnanthReddy38
 
Oracle application testing suite (OATS)
Koushik Arvapally
 

Recently uploaded (20)

PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 

Testing in Rails 3.x