SlideShare a Scribd company logo
1 of 33
Download to read offline
Write tests in the end
               users' lingo




Speaker Name : Nikhil Fernandes,Chirag Doshi
Company Name : Thoughtworks Technologies
What is the #1 thing that goes
wrong in software projects ?
Communication
End user   BA   Dev




                Application




           QA
End user       BA        Dev




                                Application




                      QA
End user
           BA       Dev



                  Application


           QA
    Acceptance Criteria
Title:I want to login to the website




 Role:As a user



Action:I want to login into the website


Outcome:So that I can view exclusive content
Acceptance Criteria:

Scenario:Successful Login

Given:The user is on the login page


When:The user types username sam
AND the user types password 123456
AND the user clicks the login button

Then:The user should be directed to the home page
AND the page should display Welcome Sam message
Acceptance Criteria:

Scenario:Invalid Username

Given:The user is on the login page


When:The user types username wrong
AND the user types password 123456
AND the user clicks the login button


Then:The page should display Authentication failed
message
Imperative v/s Declarative
Acceptance Criteria
Title:Book Submision




Role:As a Librarian



Action:I want to add a new book


Outcome:So that members can borrow this book
Imperative

Acceptance Criteria:

Scenario:Successful Submission

Given:The librarian is on the admin page


When:he/she fills in the name as Programming in Objective-C 
AND fills in author as Stephen G Kochan
AND fill in tags as programming,iphone.

Then:The librarian should see a message...
'Successfully created book'
Declarative

Acceptance Criteria:

Scenario:Successful Submission

Given:The librarian is on the admin page


When:he/she adds a new book to the system


Then:The librarian should see a message...
'Successfully created book'
End user   BA   Dev




                Application




           QA
Three ways to build test
cases in the user's
language
1.Build abstractions in the code
2.Automate your acceptance criteria
3.IDE support for these automated
  acceptance criteria
1.Build abstractions in the
 code
2.Automate your acceptance criteria
3.IDE support for these automated
  acceptance criteria
Scenario Successful Login
Given the user is on the login page
AND the user type username sam
AND the user types password 123456
AND the user clicks the login button
Then the page should display Welcome Sam Message
@Test
public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){

       selenium.click(LOGIN_LINK);
       selenium.waitForElementPresent(LOGIN_BUTTON);
       selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”sam");
       selenium.type(LOGIN_PASSWORD_EDIT_FIELD, “123456");    
       selenium.click(LOGIN_BUTTON);
       selenium.waitForElementPresent("Welcome");
}


@Test
public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){

       selenium.click(LOGIN_LINK);
       selenium.waitForElementPresent(LOGIN_BUTTON);
       selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”wrong");
       selenium.type(LOGIN_PASSWORD_EDIT_FIELD, ”123456");    
       selenium.click(LOGIN_BUTTON);
       selenium.waitForElementPresent("Authentication Failed");
}
@Test
public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){

       new LoginPage()
       .openLoginPage()
       .enterUserName('sam').enterPassword('123456')
       .login().verifySuccessfulLogin();
}


@Test
public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){

       new LoginPage()
       .openLoginPage()
       .enterUserName('wrong').enterPassword('123456').
       login().verifyUserIsNotAuthenticated();
}
public class LoginPage {

private Selenium selenium;

public LoginPage(Selenium selenium) {
        this.selenium = selenium;
}

public LoginPage openLoginPage() {
        selenium.click(LOGIN_LINK);
        selenium.waitForElementPresent(LOGIN_BUTTON);
        return this;
}

public LoginPage enterUserName(String userName){
        selenium.type(LOGIN_USERNAME_EDIT_FIELD, userName);
        return this;
}
public LoginPage enterPassword(String password){
        selenium.type(LOGIN_PASSWORD_EDIT_FIELD, password);
        return this;
}

public LoginPage login(){
        selenium.click(LOGIN_BUTTON);
        return this;
}

public boolean verifyUserIsNotAuthenticated(){
        selenium.waitForElementPresent("Authentication Failed");
        return this;
}

public boolean verifySuccessfulLogin(){
        selenium.waitForElementPresent("Welcome");
        return this;
}

}
1.Build abstractions in the code

2.Automate your
 acceptance criteria
3.IDE support for these automated
  acceptance criteria
Scenario Successful Login
 Given the user is on the login page
 AND the user type username sam
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display Welcome Sam Message


Given 'the user is on the login page' do
         @browser.open('http://foobar.com/')
end

AND /the user types (w+) (w+)/ do |element,value|
        @browser.type(element, value)
end

AND /the user clicks (w+) button/ do |element|
        @browser.click element
        @browser.wait_for_page_to_load
end

Then /the page should display (.*) Message/ do |expected_textl|
        @browser.is_element_present("css=p['#{expected_text}']").should be_true
end
Scenario Invalid UserName
 Given the user is on the login page
 AND the user type username wrong
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display 'Authentication Failed' Message


Given 'the user is on the login page' do
         @browser.open('http://foobar.com/')
end

AND /the user types (w+) (w+)/ do |element,value|
        @browser.type(element, value)
end

AND /the user clicks (w+) button/ do |element|
        @browser.click element
        @browser.wait_for_page_to_load
end

Then /the page should display (.*) Message/ do |expected_textl|
        @browser.is_element_present("css=p['#{expected_text}']").should be_true
end
JBehave
Scenario Invalid UserName
 Given the user is on the login page
 AND the user type username wrong
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display 'Authentication Failed' Message


@Given("the user is on the login page")
public void theUserIsOnTheLoginPage() {
         LoginPage loginPage = new LoginPage();
         loginPage.verifyPresenceOfLoginButton();
}

@When("the user types username $username")
public void theUserTypesUsername(String username) {
         loginPage().typeUsername(username);
}

@When("the user types password $password")
public void theUserTypesPassword(String password) {
         loginPage().typePassword(password);
}
@When("clicks the login button")
public void clicksTheLoginButton() {
         loginPage().login();
}
@Then("the page should display $errorMessage Message")
public void thePageShouldDisplayErrorMessage(String errorMessage) {
         loginPage().verifyPresenceOfErrorMessage(errorMessage);
}
1.Build abstractions in the code
2.Automate your acceptance criteria

3.IDE support for these
 automated acceptance
 criteria
Thank You
chirag@thoughtworks.com

nikhil@thoughtworks.com

More Related Content

What's hot

Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
Server and domain setup
Server and domain setupServer and domain setup
Server and domain setupkmcintyre3
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_queryFajar Baskoro
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1フ乇丂ひ丂
 

What's hot (10)

Anne bacus evernote
Anne bacus evernoteAnne bacus evernote
Anne bacus evernote
 
Demystifying OAuth2 for PHP
Demystifying OAuth2 for PHPDemystifying OAuth2 for PHP
Demystifying OAuth2 for PHP
 
Geb qa fest2017
Geb qa fest2017Geb qa fest2017
Geb qa fest2017
 
Ajax learning tutorial
Ajax learning tutorialAjax learning tutorial
Ajax learning tutorial
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
Server and domain setup
Server and domain setupServer and domain setup
Server and domain setup
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
 
Oauth
OauthOauth
Oauth
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
 

Similar to Write Tests in End Users’ Lingo

Passwords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerPasswords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerFrancois Marier
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationEWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationRob Tweed
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Jean-Loup Yu
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...Ho Chi Minh City Software Testing Club
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumXebia IT Architects
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsSeth McLaughlin
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)xsist10
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoRodrigo Urubatan
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven TestingBrian Hogan
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5Rob Tweed
 
Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Jorgen Thelin
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)Jean-Michel Garnier
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canadaxsist10
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behatxsist10
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shineWim Selles
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingPatrick Reagan
 

Similar to Write Tests in End Users’ Lingo (20)

Passwords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerPasswords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answer
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationEWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with selenium
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicação
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
 
Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canada
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behat
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shine
 
Test automation
Test  automationTest  automation
Test automation
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance Testing
 

More from IndicThreads

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs itIndicThreads
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsIndicThreads
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayIndicThreads
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices IndicThreads
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreadsIndicThreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreadsIndicThreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingIndicThreads
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreadsIndicThreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprisesIndicThreads
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIndicThreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present FutureIndicThreads
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams IndicThreads
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameIndicThreads
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceIndicThreads
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java CarputerIndicThreads
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache SparkIndicThreads
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & DockerIndicThreads
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackIndicThreads
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack CloudsIndicThreads
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!IndicThreads
 

More from IndicThreads (20)

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs it
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang way
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before Reacting
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprises
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present Future
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fame
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads Conference
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java Carputer
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedback
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack Clouds
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!
 

Recently uploaded

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...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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, Adobeapidays
 
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 FresherRemote DBA Services
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
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 TerraformAndrey Devyatkin
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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 WorkerThousandEyes
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 

Recently uploaded (20)

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...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Write Tests in End Users’ Lingo

  • 1. Write tests in the end users' lingo Speaker Name : Nikhil Fernandes,Chirag Doshi Company Name : Thoughtworks Technologies
  • 2. What is the #1 thing that goes wrong in software projects ?
  • 4. End user BA Dev Application QA
  • 5. End user BA Dev Application QA End user BA Dev Application QA
  • 7. Title:I want to login to the website Role:As a user Action:I want to login into the website Outcome:So that I can view exclusive content
  • 8. Acceptance Criteria: Scenario:Successful Login Given:The user is on the login page When:The user types username sam AND the user types password 123456 AND the user clicks the login button Then:The user should be directed to the home page AND the page should display Welcome Sam message
  • 9. Acceptance Criteria: Scenario:Invalid Username Given:The user is on the login page When:The user types username wrong AND the user types password 123456 AND the user clicks the login button Then:The page should display Authentication failed message
  • 11. Title:Book Submision Role:As a Librarian Action:I want to add a new book Outcome:So that members can borrow this book
  • 12. Imperative Acceptance Criteria: Scenario:Successful Submission Given:The librarian is on the admin page When:he/she fills in the name as Programming in Objective-C  AND fills in author as Stephen G Kochan AND fill in tags as programming,iphone. Then:The librarian should see a message... 'Successfully created book'
  • 13. Declarative Acceptance Criteria: Scenario:Successful Submission Given:The librarian is on the admin page When:he/she adds a new book to the system Then:The librarian should see a message... 'Successfully created book'
  • 14. End user BA Dev Application QA
  • 15. Three ways to build test cases in the user's language
  • 16. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 17. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 18. Scenario Successful Login Given the user is on the login page AND the user type username sam AND the user types password 123456 AND the user clicks the login button Then the page should display Welcome Sam Message
  • 19. @Test public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){ selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”sam"); selenium.type(LOGIN_PASSWORD_EDIT_FIELD, “123456");     selenium.click(LOGIN_BUTTON); selenium.waitForElementPresent("Welcome"); } @Test public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){ selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”wrong"); selenium.type(LOGIN_PASSWORD_EDIT_FIELD, ”123456");     selenium.click(LOGIN_BUTTON); selenium.waitForElementPresent("Authentication Failed"); }
  • 20. @Test public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){ new LoginPage() .openLoginPage() .enterUserName('sam').enterPassword('123456') .login().verifySuccessfulLogin(); } @Test public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){ new LoginPage() .openLoginPage() .enterUserName('wrong').enterPassword('123456'). login().verifyUserIsNotAuthenticated(); }
  • 21. public class LoginPage { private Selenium selenium; public LoginPage(Selenium selenium) { this.selenium = selenium; } public LoginPage openLoginPage() { selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); return this; } public LoginPage enterUserName(String userName){ selenium.type(LOGIN_USERNAME_EDIT_FIELD, userName); return this; }
  • 22. public LoginPage enterPassword(String password){ selenium.type(LOGIN_PASSWORD_EDIT_FIELD, password); return this; } public LoginPage login(){ selenium.click(LOGIN_BUTTON); return this; } public boolean verifyUserIsNotAuthenticated(){ selenium.waitForElementPresent("Authentication Failed"); return this; } public boolean verifySuccessfulLogin(){ selenium.waitForElementPresent("Welcome"); return this; } }
  • 23. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 24.
  • 25. Scenario Successful Login Given the user is on the login page AND the user type username sam AND the user types password 123456 AND the user clicks the login button Then the page should display Welcome Sam Message Given 'the user is on the login page' do @browser.open('http://foobar.com/') end AND /the user types (w+) (w+)/ do |element,value| @browser.type(element, value) end AND /the user clicks (w+) button/ do |element| @browser.click element @browser.wait_for_page_to_load end Then /the page should display (.*) Message/ do |expected_textl| @browser.is_element_present("css=p['#{expected_text}']").should be_true end
  • 26. Scenario Invalid UserName Given the user is on the login page AND the user type username wrong AND the user types password 123456 AND the user clicks the login button Then the page should display 'Authentication Failed' Message Given 'the user is on the login page' do @browser.open('http://foobar.com/') end AND /the user types (w+) (w+)/ do |element,value| @browser.type(element, value) end AND /the user clicks (w+) button/ do |element| @browser.click element @browser.wait_for_page_to_load end Then /the page should display (.*) Message/ do |expected_textl| @browser.is_element_present("css=p['#{expected_text}']").should be_true end
  • 28. Scenario Invalid UserName Given the user is on the login page AND the user type username wrong AND the user types password 123456 AND the user clicks the login button Then the page should display 'Authentication Failed' Message @Given("the user is on the login page") public void theUserIsOnTheLoginPage() { LoginPage loginPage = new LoginPage(); loginPage.verifyPresenceOfLoginButton(); } @When("the user types username $username") public void theUserTypesUsername(String username) { loginPage().typeUsername(username); } @When("the user types password $password") public void theUserTypesPassword(String password) { loginPage().typePassword(password); }
  • 29. @When("clicks the login button") public void clicksTheLoginButton() { loginPage().login(); } @Then("the page should display $errorMessage Message") public void thePageShouldDisplayErrorMessage(String errorMessage) { loginPage().verifyPresenceOfErrorMessage(errorMessage); }
  • 30. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 31.
  • 32.