Top Banner
107

Real World Test Automation

Apr 08, 2017

Download

Technology

Jeroen Tuitjer
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Real World Test Automation
Page 2: Real World Test Automation

T H AT ’ S M E Jeroen Tuitjer Amsterdam Mirabeau Test Engineer Transavia Test Automation Ninja

Page 3: Real World Test Automation

REAL WORLDTEST AUTOMATION

At least.. My world

Page 4: Real World Test Automation

TRANSAVIA

Awesome Project / Awesome Team

Page 5: Real World Test Automation

3 TEAMS

Together

Page 6: Real World Test Automation

Team Blue

Ecommerce PlatformScrumteam

Page 7: Real World Test Automation

Team Green

Ecommerce PlatformScrumteam

Page 8: Real World Test Automation

System

Ecommerce PlatformScrumteam

Page 9: Real World Test Automation

SPRINTS SCRUMAGILE

Page 10: Real World Test Automation

TRANSAVIA.COM

Website

Page 11: Real World Test Automation
Page 12: Real World Test Automation
Page 13: Real World Test Automation
Page 14: Real World Test Automation
Page 15: Real World Test Automation
Page 16: Real World Test Automation
Page 17: Real World Test Automation
Page 18: Real World Test Automation

Responsive

Page 19: Real World Test Automation

3. CHECKIN

2. MY TRANSAVIA

1. BOOKING

Page 20: Real World Test Automation

BACK TO TESTAUTOMATION

Lessons Learned

Page 21: Real World Test Automation

WHY TEST AUTOMATION?

VS Manual testing

Page 22: Real World Test Automation

FAST

Page 23: Real World Test Automation

PRECISE

Page 24: Real World Test Automation

CONTROL

Page 25: Real World Test Automation

1.CODE2.RUN3.OWNERSHI

P

Page 26: Real World Test Automation

1.CODE

Page 27: Real World Test Automation

Awesome CodeOne line to rule them all

[TestMethod] //Checks Paidluggagebooking for 1 person public void BookingPaidluggagePax() { this.BookingBookServiceTest(passengersAmount: 5, service: "BookPaidLuggagePAX", type: "BookPaidLuggagePAX", iSAsa: true, iSIci: false, iSBrandedFare: false, serviceType: ServiceType.PaidLuggage50, outboundDestination: "RTM", inboundDestination: "ALC", finish: false); }

Page 28: Real World Test Automation

Awesome CodeOne line to rule them all

[TestMethod] //Checks Paidluggagebooking for 1 person public void BookingPaidluggagePax() { this.BookingBookServiceTest(passengersAmount: 5, service: "BookPaidLuggagePAX", type: "BookPaidLuggagePAX", iSAsa: true, iSIci: false, iSBrandedFare: false, serviceType: ServiceType.PaidLuggage50, outboundDestination: "RTM", inboundDestination: "ALC", finish: false); }

Page 29: Real World Test Automation

Awesome CodeOne line to rule them all

[TestMethod] //Checks Paidluggagebooking for 1 person public void BookingPaidluggagePax() { this.BookingBookServiceTest(passengersAmount: 5, service: "BookPaidLuggagePAX", type: "BookPaidLuggagePAX", iSAsa: true, iSIci: false, iSBrandedFare: false, serviceType: ServiceType.PaidLuggage50, outboundDestination: "RTM", inboundDestination: "ALC", finish: false); }

Page 30: Real World Test Automation

Awesome CodeOne line to rule them all

[TestMethod] //Checks Paidluggagebooking for 1 person public void BookingPaidluggagePax() { this.BookingBookServiceTest(passengersAmount: 5, service: "BookPaidLuggagePAX", type: "BookPaidLuggagePAX", iSAsa: true, iSIci: false, iSBrandedFare: false, serviceType: ServiceType.PaidLuggage50, outboundDestination: "RTM", inboundDestination: "ALC", finish: false); }

Page 31: Real World Test Automation

Awesome CodeOne line to rule them all

[TestMethod] //Checks Paidluggagebooking for 1 person public void BookingPaidluggagePax() { this.BookingBookServiceTest(passengersAmount: 5, service: "BookPaidLuggagePAX", type: "BookPaidLuggagePAX", iSAsa: true, iSIci: false, iSBrandedFare: false, serviceType: ServiceType.PaidLuggage50, outboundDestination: "RTM", inboundDestination: "ALC", finish: false); }

Page 32: Real World Test Automation

//Select RTM for the Outbound Destination Trace.WriteLine( "Create booking for " + passengersAmount + " passengers from " + outboundDestination + " to " + inboundDestination); bookingToolSelectPage.BookingToolSelectDestination("Departure", outboundDestination); //Select ALC for the Inbound Destination bookingToolSelectPage.BookingToolSelectDestination("Arrival", inboundDestination);

OUTBOUND / INBOUND

Page 33: Real World Test Automation

//Select RTM for the Outbound Destination Trace.WriteLine( "Create booking for " + passengersAmount + " passengers from " + outboundDestination + " to " + inboundDestination); bookingToolSelectPage.BookingToolSelectDestination("Departure", outboundDestination); //Select ALC for the Inbound Destination bookingToolSelectPage.BookingToolSelectDestination("Arrival", inboundDestination);

OUTBOUND / INBOUND

Page 34: Real World Test Automation

if (iSIci) { // Outbound flight by using the datepicker, search for the flight bookingToolSelectPage.ClickBookingDatePicker(FluentJourneyType.Outbound); bookingToolSelectPage.ClickDateInDatePickerIci(); bookingToolSelectPage.ClickBookingDatePicker(FluentJourneyType.Inbound);

//Select next day and than previous day, then the Outbound flight by clicking on the top bar bookingToolSelectPage.ClickNextInDatePicker(); bookingToolSelectPage.ClickDateInDatePicker(); Trace.WriteLine("Outbound flight by using the datepicker, search for the flight"); bookingToolSelectPage.BookingToolIncreaseAdult(passengersAmount, type); bookingToolSelectPage.ClickBookingSearchButton(); bookingToolSelectPage.BookingIciSelect(); this.I.Wait(1); } else { // Outbound flight by using the datepicker, search for the flight bookingToolSelectPage.ClickBookingDatePicker(FluentJourneyType.Outbound); bookingToolSelectPage.ClickNextInDatePicker(); bookingToolSelectPage.ClickDateInDatePicker(); Trace.WriteLine("Outbound flight by using the datepicker, search for the flight");

// Inbound flight by using the datepicker, search for the flight

BOOKING TODAY(ICI)

Page 35: Real World Test Automation

BRANDED FAREprivate void BookingBrandedFares( string service, string type, bool iSBrandedFare, BookingToolSelectPage bookingToolSelectPage) { int package; switch (service) { case BrandedFarePlusCode: { package = 2; } break; case BrandedFaresBizzCode: { package = 3; } break; default: package = 1; break; }

Page 36: Real World Test Automation

REDUCED MOBILITY switch (serviceType) { case ServiceType.PrmAoxy: case ServiceType.PrmBlnd: case ServiceType.PrmDeaf: case ServiceType.PrmManual: case ServiceType.PrmMeda: case ServiceType.PrmPoxy: case ServiceType.PrmSmbw: case ServiceType.PrmSvan: case ServiceType.PrmWcbd: case ServiceType.PrmWcbw: case ServiceType.PrmWchc: case ServiceType.PrmWchr: case ServiceType.PrmWchs: case ServiceType.PrmSmbd: this.ServicePrm(service, type, bookingToolSelectPage, prmSelectPage); break;

Page 37: Real World Test Automation

SEAT RESERVATION if (iSAsa) { //ASAPage Trace.WriteLine("ASA is possible with " + serviceType); asaSelectPage.AsaLegendIsAvailable(); switch (serviceType) { case ServiceType.SeatNormal: case ServiceType.SeatExtraLegroom: case ServiceType.SeatUpFront: case ServiceType.SeatFrontRow: //ASAPage select seats Trace.WriteLine("Select Seats" + serviceType); this.BookAsa(passengersAmount, serviceType.ToString()); break; }

bookingToolSelectPage.ClickNext("");

asaSelectPage.ConfirmNoSeats();

}

Page 38: Real World Test Automation

private void BookPaidluggage(int passengersAmount, string serviceType) { Trace.WriteLine(passengersAmount + serviceType); var bookingToolSelectPage = new BookingToolSelectPage(this); var ssrSelectPage = new SSRSelectPage(this); switch (serviceType) { case "PaidLuggage10": LuggageAmount(passengersAmount, 10, "outbound"); break; case "PaidLuggage15": LuggageAmount(passengersAmount, 15, "outbound"); break; case "PaidLuggage20": LuggageAmount(passengersAmount, 20, "outbound"); break; case "PaidLuggage30": LuggageAmount(passengersAmount, 30, "outbound"); break; case "PaidLuggage40": LuggageAmount(passengersAmount, 40, "outbound"); break; case "PaidLuggage50": LuggageAmount(passengersAmount, 50, "outbound"); break; }

SUITCASE

Page 39: Real World Test Automation
Page 40: Real World Test Automation
Page 41: Real World Test Automation
Page 42: Real World Test Automation
Page 43: Real World Test Automation

COMPLEXE CODE

Page 44: Real World Test Automation

CODE REVIEWS

Page 45: Real World Test Automation
Page 46: Real World Test Automation

Scenario: Search Ten Adult Groupbooking Show Notification

Given I am on the Search Select pageAnd I have entered BCN as OutboundFlightAnd I have entered AMS as InboundFlightAnd I have checked the returnflight checkboxAnd I have selected 10 adults, 0 children and 0 infantsThen There should be a notification about the groupbookingsform

Page 47: Real World Test Automation

[Then(@"the Checkin page should be available")] public void ThenTheCheckinPageShouldBeAvailable() { var internetCheckinPage = Pages.Get<InternetCheckinPassengerPage>(); internetCheckinPage.CheckinPageShouldBeAvailable(); }

Page 48: Real World Test Automation

public void ClickOnTheInternetCheckinButton() { I.Click("selector"); }

Page 49: Real World Test Automation

I.Click(“.Selector”);

Page 50: Real World Test Automation

.panel .primary-button

Page 51: Real World Test Automation

I.Hover(“.Selector”);

Page 52: Real World Test Automation

I.Assert.Exists(“.selector”);

Page 53: Real World Test Automation

I.Takescreenshot();

Page 54: Real World Test Automation

Given I book a single HV flight 0 days from now for 1 adults, 0 child nr 5962 from CPH to EIN Given I am on the Passenger Detail PageAnd I enter the pax information for multiple pax| Passengernumber | PaxType | Firstname | Lastname | DateOfBirth | Gender | Email | Phonenumber || 0 | Adult | Email | PassB | 01-01-1980 | Male | [email protected]| 612345678 | Then I click on the next button in the booking summaryGiven I am on the Holdluggage pageGiven I am on the Contact Detail PageAnd I enter the contact information| Firstname | Lastname | Gender | Email | Phonenumber || Zoel | ASAICI | Female | [email protected] | 612345678 |Then I click on the next button in the booking summary

Given I am on the Payment pageAnd I select the creditcard optionAnd I fill in my Mastercard creditcard numberAnd I fill in my Mastercard creditcard validationcodeAnd I fill in my NameAnd I fill in my experation dateThen I click on the next button in the booking summaryThen The booking confirm page should be available

Page 55: Real World Test Automation

SIMPLE CODE

Page 56: Real World Test Automation

WORK WITH DEVELOPMENT

Team Effort

Page 57: Real World Test Automation

CODE LEARNINGS

Read me

Page 58: Real World Test Automation

//NO COMMENTS! NO COMMENTS() { Write.clear.easy(); }

Page 59: Real World Test Automation

NO CODES#214465

6P01

PRM

ASA

SSR

@#$@

AMS

TXL

PAX

if ((val1 > val2) && (val1 > val3))

i

Page 60: Real World Test Automation

LESS VARIABLES

5 max

Page 61: Real World Test Automation

QUESTIONS

Feedback, or other solutions

Page 62: Real World Test Automation

2.RUN

Page 63: Real World Test Automation

FEATURE FILE

BACKGROUND

TEST - 1

TEST - 2

TEST - 3

Page 64: Real World Test Automation

GO TO TEST!!

Page 65: Real World Test Automation

http://gotopPage.Directly

Page 66: Real World Test Automation

Given I book a single HV flight 0 days from now for 1 adults, 0 child and 0 infants nr 5962 from CPH to EIN http://cd1-tst-vpn.transavia.com/nl-NL/boek-een-vlucht/vluchten/selectflights/?outboundDeparture=CPH&outboundArrival=EIN&outboundCarrier=HV&outboundFlightNumber=5962&originDepartureDate=2016-2-15&adults=1&children=0&infants=0

NAVIGATE WITH URL

Page 67: Real World Test Automation

STARTSTART TEST

Page 68: Real World Test Automation

TESTISOLATED

Page 69: Real World Test Automation

NIGHTLY BUILD

Page 70: Real World Test Automation

CHECK TESTRUN

Page 71: Real World Test Automation

@FAIL@NotFinished

Page 72: Real World Test Automation

SMOKE TEST

Page 73: Real World Test Automation

STARTSTART TEST

PLAN CAREFULLY

Page 74: Real World Test Automation

STARTSTART TESTTESTS

CAN RUN ALL THE

TIME

Page 75: Real World Test Automation

STARTSTART TESTTIMING DIFFICULTY

Page 76: Real World Test Automation

STARTSTART TEST

Page 77: Real World Test Automation

- BOOKING CONFIRMATION

- DECLINE PAYMENT- CANCELLATION

Page 78: Real World Test Automation

REQUIREMENTS

Page 79: Real World Test Automation

LOGDebug Trace:Go to flight 5962 From: CPH To EIN http://cd1-tst-vpn.transavia.com/nl-NL/boek-een-vlucht/vluchten/selectflights/?outboundDeparture=CPH&outboundArrival=EIN&outboundCarrier=HV&outboundFlightNumber=5962&originDepartureDate=2016-2-15&adults=1&children=0&infants=0

Title of the page: This web page is not availableTest

Page 80: Real World Test Automation

MAINTAINABLE

Page 81: Real World Test Automation

FAST

Page 82: Real World Test Automation

MULTITHREAD TESTRUNS

Page 83: Real World Test Automation

READABLE

Page 84: Real World Test Automation

Scenario: Search Ten Adult Groupbooking Show Notification

Given I am on the Search Select pageAnd I have entered BCN as OutboundFlightAnd I have entered AMS as InboundFlightAnd I have checked the returnflight checkboxAnd I have selected 10 adults, 0 children and 0 infantsThen There should be a notification about the groupbookingsform

Page 85: Real World Test Automation

STABLE

RELIABLE

Page 86: Real World Test Automation

TEAMWORK

Page 87: Real World Test Automation

Team Blue

Write new tests in sprint

Page 88: Real World Test Automation

Team Green

Write New TestsIn Sprint

Page 89: Real World Test Automation

DEFENITION OF DONE

Page 90: Real World Test Automation

System

Maintain tests,Focus on improvements

Page 91: Real World Test Automation

DISTRIBUTE WORK

Page 92: Real World Test Automation

CHECK EVERY DAY

Page 93: Real World Test Automation

MAKE A TEST BACKLOG

Page 94: Real World Test Automation

FOCUS

Page 95: Real World Test Automation

PRIORITISE

Page 96: Real World Test Automation

QUESTIONS

Feedback, or other solutions

Page 97: Real World Test Automation

3.OWNERSHIP

Page 98: Real World Test Automation

OWNERSHIP

TEST IS NO OWNER

Page 99: Real World Test Automation

INSIGHTS

Page 100: Real World Test Automation

FEATURE

Page 101: Real World Test Automation

DASHBOARD

Page 102: Real World Test Automation
Page 103: Real World Test Automation
Page 104: Real World Test Automation

QUESTIONS

Feedback, or other solutions

Page 105: Real World Test Automation

1.CODE2.RUN3.OWNERSHI

P

Page 106: Real World Test Automation

USABILITY

Page 107: Real World Test Automation