Real World Test Automation
-
Upload
jeroen-tuitjer -
Category
Technology
-
view
171 -
download
1
Transcript of 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); }
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
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(); }
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
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
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
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