a star trek journey in the travel industry · geb page object spock test spock test introduction to...

30
Sophia Antipolis, French Riviera 20-22 October 2015 A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY Presented by Lisa Persson & DavidOlivier Saban © All rights reserved

Upload: others

Post on 30-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Sophia Antipolis, French Riviera20-22 October 2015

A STAR TREK JOURNEYIN THE TRAVEL INDUSTRYPresented by Lisa Persson & David‐Olivier Saban 

© All rights reserved

Page 2: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Who are Amadeus

2

• Distribution

• E‐Retail

• E‐Commerce

©All rights reserved

695million

passengersboarded

million bookings processed

526

Operations in

countries195

Page 3: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

3 © All rights reserved

Page 4: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

• 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%

Page 5: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

The road less travelled

5 © All rights reserved

Page 6: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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

Page 7: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Our journey

7 © All rights reserved

* formerly Quick Test Pro

Selenium

Unified Functional Testing*

Unified Functional Testing*

• Heavy, proprietary• VB script• Wide‐spread

Page 8: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

8 © All rights reserved

Page 9: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

9 © All rights reserved

Page 10: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

10 © All rights reserved

Page 11: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

11 © All rights reserved

Page 12: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

12 © All rights reserved

Page 13: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

13 © All rights reserved

Page 14: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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);

Page 15: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Selenium printout – home‐grown

15

• Difficult to analyze

• Not reviewable by functional people

©All rights reserved

Page 16: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Gherkin/Cucumber

16 © All rights reserved

Unified Functional Testing

Selenium

Page 17: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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

Page 18: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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

Page 19: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Geb/Spock

19 © All rights reserved

Unified Functional Testing

Selenium

Gherkin/Cucumber

Geb/Spock

Gherkin/Cucumber

Selenium

Page 20: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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’

Page 21: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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’

Page 22: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Spock printout – Damage Control

22 © All rights reserved

Page 23: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

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

Page 24: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Reusable code

24

• Shared framework  Synergy

• Responsibility distribution  UI + Geb pages aligned

©All rights reserved

Page 25: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Bumps in the road

25

• Unstable SUT• 3rd party systems• No search results

• Inherited scenarios

• Headless vs normal browser

©All rights reserved

Page 26: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Sailing without wind

26

• Limitations in Geb/Spock

• Standalone application

• Compatibility with old IE

• Technical problems

©All rights reserved

Page 27: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

The journey continues

27 © All rights reserved

•• Existing flows  Smaller flows Atomization

Page 28: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Navigare necesse est

28 © All rights reserved

Unified Functional Testing

Selenium

Gherkin/Cucumber

Geb/Spock

?

Page 29: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Why choose Geb/Spock?

29

Easy to analyse

Plain English

Reusable code

©All rights reserved

Page 30: A STAR TREK JOURNEY IN THE TRAVEL INDUSTRY · Geb page object Spock test Spock test Introduction to Geb/Spock 20 ©Allrightsreserved Geb content Definition of at given: ’The user

Sophia Antipolis, French Riviera20-22 October 2015

A STAR TREK JOURNEYIN THE TRAVEL INDUSTRYPresented by Lisa Persson & David‐Olivier Saban 

© All rights reserved