Real World Test Automation

107

Transcript of Real World Test Automation

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

REAL WORLDTEST AUTOMATION

At least.. My world

TRANSAVIA

Awesome Project / Awesome Team

3 TEAMS

Together

Team Blue

Ecommerce PlatformScrumteam

Team Green

Ecommerce PlatformScrumteam

System

Ecommerce PlatformScrumteam

SPRINTS SCRUMAGILE

TRANSAVIA.COM

Website

Responsive

3. CHECKIN

2. MY TRANSAVIA

1. BOOKING

BACK TO TESTAUTOMATION

Lessons Learned

WHY TEST AUTOMATION?

VS Manual testing

FAST

PRECISE

CONTROL

1.CODE2.RUN3.OWNERSHI

P

1.CODE

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

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

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

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

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

//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

//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

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)

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

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;

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

}

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

COMPLEXE CODE

CODE REVIEWS

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

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

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

I.Click(“.Selector”);

.panel .primary-button

I.Hover(“.Selector”);

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

I.Takescreenshot();

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

SIMPLE CODE

WORK WITH DEVELOPMENT

Team Effort

CODE LEARNINGS

Read me

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

NO CODES#214465

6P01

PRM

ASA

SSR

@#$@

AMS

TXL

PAX

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

i

LESS VARIABLES

5 max

QUESTIONS

Feedback, or other solutions

2.RUN

FEATURE FILE

BACKGROUND

TEST - 1

TEST - 2

TEST - 3

GO TO TEST!!

http://gotopPage.Directly

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

STARTSTART TEST

TESTISOLATED

NIGHTLY BUILD

CHECK TESTRUN

@FAIL@NotFinished

SMOKE TEST

STARTSTART TEST

PLAN CAREFULLY

STARTSTART TESTTESTS

CAN RUN ALL THE

TIME

STARTSTART TESTTIMING DIFFICULTY

STARTSTART TEST

- BOOKING CONFIRMATION

- DECLINE PAYMENT- CANCELLATION

REQUIREMENTS

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

MAINTAINABLE

FAST

MULTITHREAD TESTRUNS

READABLE

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

STABLE

RELIABLE

TEAMWORK

Team Blue

Write new tests in sprint

Team Green

Write New TestsIn Sprint

DEFENITION OF DONE

System

Maintain tests,Focus on improvements

DISTRIBUTE WORK

CHECK EVERY DAY

MAKE A TEST BACKLOG

FOCUS

PRIORITISE

QUESTIONS

Feedback, or other solutions

3.OWNERSHIP

OWNERSHIP

TEST IS NO OWNER

INSIGHTS

FEATURE

DASHBOARD

QUESTIONS

Feedback, or other solutions

1.CODE2.RUN3.OWNERSHI

P

USABILITY