a star trek journey in the travel industry · geb page object spock test spock test introduction to...
TRANSCRIPT
Sophia Antipolis, French Riviera20-22 October 2015
A STAR TREK JOURNEYIN THE TRAVEL INDUSTRYPresented by Lisa Persson & David‐Olivier Saban
© All rights reserved
Who are Amadeus
2
• Distribution
• E‐Retail
• E‐Commerce
©All rights reserved
695million
passengersboarded
million bookings processed
526
Operations in
countries195
3 © All rights reserved
• Amadeus e‐Travel Management• Self‐booking tool• For corporations
• Selling Platform Connect• Booking tool• For travel agencies
4 © All rights reserved
SUT – Systems Under Test
Corporate Customers
+7,300Active users
+8.1m+8.5mBookingsin 2014
Points of sale equipped
400K +200Countries
% of TA bookings
70%
The road less travelled
5 © All rights reserved
Conquering Mount System Test
6
• Challenges with Automated System Tests
• Translate human verifications into code
• Test analysis
• Reuse code between test levels
©All rights reserved
Our journey
7 © All rights reserved
* formerly Quick Test Pro
Selenium
Unified Functional Testing*
Unified Functional Testing*
• Heavy, proprietary• VB script• Wide‐spread
8 © All rights reserved
9 © All rights reserved
10 © All rights reserved
11 © All rights reserved
12 © All rights reserved
13 © All rights reserved
Selenium code snippet
14 © All rights reserved
mainPage = HelperLogin.loginWith(loginParams);reporter.reportPassed(”1. User logged in successfully”, ””);PageCarSearch carPage = mainPage.selectCarBookingFile();reporter.reportPassed(”2. Open a booking file car”, ””);PageCheckout pageCheckOut =carPage.actionCarSearchByCA(strPickUpPoint);
Selenium printout – home‐grown
15
• Difficult to analyze
• Not reviewable by functional people
©All rights reserved
Gherkin/Cucumber
16 © All rights reserved
Unified Functional Testing
Selenium
Introduction to Cucumber
17 © All rights reserved
Source: https://cucumber.io/
Feature File
Step Definition
Scenario: Add two numbersGiven I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press addThen the result should be 120 on the screen
Given /I have entered (.*) into the calculator/ do |n|calculator = Calculator.newcalculator.push(n.to_i)
end
I have entered 50 into the calculator
/I have entered (.*) into the calculator/
Five is entered, then zero
I type 50 in the input field
Cucumber – Criticism
18 © All rights reserved
“Reading and writing Gherkin is a waste of time [for non-technical stakeholders].”
“The more naturally it reads, the more difficult it
is to translate it into reusable code.”
“All the reasons to use it … are theoretical, and I have never
seen them … be remotely applicable in the real world.”
Source: http://www.jimmycuadra.com/posts/please‐don‐t‐use‐cucumber
Geb/Spock
19 © All rights reserved
Unified Functional Testing
Selenium
Gherkin/Cucumber
Geb/Spock
Gherkin/Cucumber
Selenium
public class CarSearchPage extends AbstractPage {
static at = {carFrame.displayed && !$(”#waitingDialog”.displayed)
}
static content = {cityInput { $(”#ACFieldCityPickUp”)pickUpDateInput { $(”#pickupDate_id_txt input”)
}
Geb page object Spock test
Spock test
Introduction to Geb/Spock
20 © All rights reserved
Geb content
Definition of at
given: ’The user is on Car Search Page’at CarSearchPage
when: ’Search for a car for 1 day’cityInput = DataBible.PICKUP_CITYsearchButton.click()
then: ’The user is on the Car Availabilities page’at CarAvailPage
and: ’New Record Locator number is displayed’
Introduction to Geb/Spock
21 © All rights reserved
given: ’The user is on Car Search Page’
when: ’Search for a car for 1 day’
then: ’The user is on the Car Availabilities page’
and: ’New Record Locator number is displayed’
Spock printout – Damage Control
22 © All rights reserved
Picking up speed
23
• Large scale usage of Geb/Spock• End‐to‐end system tests• Inherited from manual QA
• 6 months• 100 tests• 180 Geb pages/modules
©All rights reserved
Reusable code
24
• Shared framework Synergy
• Responsibility distribution UI + Geb pages aligned
©All rights reserved
Bumps in the road
25
• Unstable SUT• 3rd party systems• No search results
• Inherited scenarios
• Headless vs normal browser
©All rights reserved
Sailing without wind
26
• Limitations in Geb/Spock
• Standalone application
• Compatibility with old IE
• Technical problems
©All rights reserved
The journey continues
27 © All rights reserved
•• Existing flows Smaller flows Atomization
Navigare necesse est
28 © All rights reserved
Unified Functional Testing
Selenium
Gherkin/Cucumber
Geb/Spock
?
Why choose Geb/Spock?
29
Easy to analyse
Plain English
Reusable code
©All rights reserved
Sophia Antipolis, French Riviera20-22 October 2015
A STAR TREK JOURNEYIN THE TRAVEL INDUSTRYPresented by Lisa Persson & David‐Olivier Saban
© All rights reserved