SlideShare une entreprise Scribd logo
1  sur  12
Geb:
Save Time with Groovy
Functional Testing
Dallas, TX
October 2012




Discussion document – Strictly Confidential & Proprietary
Agenda …


We will cover how a successful workflow for developing functional tests


• Introductions

• Interactive Shell

  –   Basic setup

  –   Syntax Overview

• Page Abstraction

  –   Overview

  –   Modules

  –   Functions

• Functional Testing

• Recap and Questions




                                                           Geb: Save Time with Groovy Functional Testing
                                                                                          October, 2012    2
Introductions




                Geb: Save Time with Groovy Functional Testing
                                               October, 2012    3
Interactive Shell




                    Geb: Save Time with Groovy Functional Testing
                                                   October, 2012    4
Interactive Shell…


Getting started with Geb in the interactive Groovy Shell


• Firefox for Geb

• Try out your tests before putting them into code

• Useful for rapid test development

• http://groovy.codehaus.org/Groovy+Shell

• https://github.com/jhamit/geb-examples




                                                           Geb: Save Time with Groovy Functional Testing
                                                                                          October, 2012    5
Interactive Shell …


Basic Geb syntax looks familiar, though there are some differences with jQuery


• http://www.gebish.org/manual/current/

Key Objects

• geb.Browser

• geb.navigator.Navigator

• geb.js.JavascriptInterface

Nice Features

• DOM Inspection via CSS Selectors, Indexes, Attributes

• DOM Interaction via b.$.click()

• DOM Manipulation via jQuery Hook

Examples

• b.title

• b.$('div.content-main')

• b.$('div.tweet').first().find('a[href="/improving"]',0)


                                                            Geb: Save Time with Groovy Functional Testing
                                                                                           October, 2012    6
Page Abstraction




                   Geb: Save Time with Groovy Functional Testing
                                                  October, 2012    7
Page Abstraction …

Define the essence of the page in order to separate the concerns of test
methods and web elements

These tools allow flexibility in page design without breaking tests

• Page – Conceptual abstraction of a URLs

• Page Module - Sections that are reusable across multiple pages

• Page Method – Actions that are used frequently on pages




                                                                      Geb: Save Time with Groovy Functional Testing
                                                                                                     October, 2012    8
Functional Testing




                 Geb: Save Time with Groovy Functional Testing
                                                October, 2012    9
Functional Testing…


Geb makes it easy to test natively in multiple browsers


• Faster and easier to develop tests

• Automated report generation

• Easily invoked from command line

• Can be incorporated into build/deployment process

• Point to other environments with native browsers via geb.build.baseUrl




                                                                           Geb: Save Time with Groovy Functional Testing
                                                                                                          October, 2012    10
Functional Testing…

More Geb to come so follow along and share your techniques with the
community…

More Geb to come…

Follow along @josh_hamit or JoshHamit.com

• Configurable page instances

• Module lists




                                                        Geb: Save Time with Groovy Functional Testing
                                                                                       October, 2012    11
Recap and Questions




                 Geb: Save Time with Groovy Functional Testing
                                                October, 2012    12

Contenu connexe

Similaire à Geb: Save Time with Groovy Functional Testing

What would your own version of Ruby look like?
What would your own version of Ruby look like?What would your own version of Ruby look like?
What would your own version of Ruby look like?Hung Wu Lo
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
Getting started with GitHub
Getting started with GitHubGetting started with GitHub
Getting started with GitHubPat Hawks
 
Rapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaRapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaKunal Dabir
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20kraqa
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereStrannik_2013
 
Tool Development Process and Software Engineering
Tool Development Process and Software EngineeringTool Development Process and Software Engineering
Tool Development Process and Software Engineeringsupun06
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonDomingo Suarez Torres
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013Gavin Hogan
 
Google jib: Building Java containers without Docker
Google jib: Building Java containers without DockerGoogle jib: Building Java containers without Docker
Google jib: Building Java containers without DockerMaarten Smeets
 
'Using' github - coworking with Github
'Using' github - coworking with Github'Using' github - coworking with Github
'Using' github - coworking with Github수빈 최
 
Building a Portable Testing Rig with GoConvey and Docker
Building a Portable Testing Rig with GoConvey and DockerBuilding a Portable Testing Rig with GoConvey and Docker
Building a Portable Testing Rig with GoConvey and DockerAlison Rowland
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsCasey Lee
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Molieremfrancis
 
Acceptance testing with Geb
Acceptance testing with GebAcceptance testing with Geb
Acceptance testing with GebRichard Paul
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesStrannik_2013
 
Test Automation with Twist and Sahi
Test Automation with Twist and SahiTest Automation with Twist and Sahi
Test Automation with Twist and Sahiericjamesblackburn
 
Taming Functional Web Testing with Spock and Geb
Taming Functional Web Testing with Spock and GebTaming Functional Web Testing with Spock and Geb
Taming Functional Web Testing with Spock and GebC4Media
 

Similaire à Geb: Save Time with Groovy Functional Testing (20)

What would your own version of Ruby look like?
What would your own version of Ruby look like?What would your own version of Ruby look like?
What would your own version of Ruby look like?
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Getting started with GitHub
Getting started with GitHubGetting started with GitHub
Getting started with GitHub
 
Rapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaRapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for Java
 
Geb with spock
Geb with spockGeb with spock
Geb with spock
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
 
Tool Development Process and Software Engineering
Tool Development Process and Software EngineeringTool Development Process and Software Engineering
Tool Development Process and Software Engineering
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013
 
Google jib: Building Java containers without Docker
Google jib: Building Java containers without DockerGoogle jib: Building Java containers without Docker
Google jib: Building Java containers without Docker
 
'Using' github - coworking with Github
'Using' github - coworking with Github'Using' github - coworking with Github
'Using' github - coworking with Github
 
Building a Portable Testing Rig with GoConvey and Docker
Building a Portable Testing Rig with GoConvey and DockerBuilding a Portable Testing Rig with GoConvey and Docker
Building a Portable Testing Rig with GoConvey and Docker
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub Actions
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
Acceptance testing with Geb
Acceptance testing with GebAcceptance testing with Geb
Acceptance testing with Geb
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypes
 
Test Automation with Twist and Sahi
Test Automation with Twist and SahiTest Automation with Twist and Sahi
Test Automation with Twist and Sahi
 
Taming Functional Web Testing with Spock and Geb
Taming Functional Web Testing with Spock and GebTaming Functional Web Testing with Spock and Geb
Taming Functional Web Testing with Spock and Geb
 

Geb: Save Time with Groovy Functional Testing

  • 1. Geb: Save Time with Groovy Functional Testing Dallas, TX October 2012 Discussion document – Strictly Confidential & Proprietary
  • 2. Agenda … We will cover how a successful workflow for developing functional tests • Introductions • Interactive Shell – Basic setup – Syntax Overview • Page Abstraction – Overview – Modules – Functions • Functional Testing • Recap and Questions Geb: Save Time with Groovy Functional Testing October, 2012 2
  • 3. Introductions Geb: Save Time with Groovy Functional Testing October, 2012 3
  • 4. Interactive Shell Geb: Save Time with Groovy Functional Testing October, 2012 4
  • 5. Interactive Shell… Getting started with Geb in the interactive Groovy Shell • Firefox for Geb • Try out your tests before putting them into code • Useful for rapid test development • http://groovy.codehaus.org/Groovy+Shell • https://github.com/jhamit/geb-examples Geb: Save Time with Groovy Functional Testing October, 2012 5
  • 6. Interactive Shell … Basic Geb syntax looks familiar, though there are some differences with jQuery • http://www.gebish.org/manual/current/ Key Objects • geb.Browser • geb.navigator.Navigator • geb.js.JavascriptInterface Nice Features • DOM Inspection via CSS Selectors, Indexes, Attributes • DOM Interaction via b.$.click() • DOM Manipulation via jQuery Hook Examples • b.title • b.$('div.content-main') • b.$('div.tweet').first().find('a[href="/improving"]',0) Geb: Save Time with Groovy Functional Testing October, 2012 6
  • 7. Page Abstraction Geb: Save Time with Groovy Functional Testing October, 2012 7
  • 8. Page Abstraction … Define the essence of the page in order to separate the concerns of test methods and web elements These tools allow flexibility in page design without breaking tests • Page – Conceptual abstraction of a URLs • Page Module - Sections that are reusable across multiple pages • Page Method – Actions that are used frequently on pages Geb: Save Time with Groovy Functional Testing October, 2012 8
  • 9. Functional Testing Geb: Save Time with Groovy Functional Testing October, 2012 9
  • 10. Functional Testing… Geb makes it easy to test natively in multiple browsers • Faster and easier to develop tests • Automated report generation • Easily invoked from command line • Can be incorporated into build/deployment process • Point to other environments with native browsers via geb.build.baseUrl Geb: Save Time with Groovy Functional Testing October, 2012 10
  • 11. Functional Testing… More Geb to come so follow along and share your techniques with the community… More Geb to come… Follow along @josh_hamit or JoshHamit.com • Configurable page instances • Module lists Geb: Save Time with Groovy Functional Testing October, 2012 11
  • 12. Recap and Questions Geb: Save Time with Groovy Functional Testing October, 2012 12