def step_impl(context): driver.elementClick(directionBtn) driver.waitOnElement(sourceField) driver.clearElement(sourceField) driver.enterValues(sourceField, sconfig.source) driver.clearElement(destinationField) driver.enterValues(destinationField, sconfig.destination) driver.enterValues(destinationField, Keys.ENTER)
def step_impl(context): driver.waitOnElement(walkBicycleFirstResultHours) driver.elementClick(flightBtn) driver.waitOnElement(flightResultLink) driver.elementClick(flightResultLink) driver.waitFor(3) driver.switchWindow() driver.waitOnElement(fromDate)
def step_impl(context): driver.waitOnElement(carFirstResultHours) driver.elementClick(walkBtn) driver.waitOnElement(walkBicycleFirstResultHours) miles = driver.getTextForElement(walkFirstResultMiles) print("Number of Miles: " + miles) milesValue = int(re.sub('[^0-9]', '', miles)) print("Number of miles by Walk: " + str(milesValue)) assert milesValue > sconfig.walkMilesMin
def step_impl(context): driver.waitOnElement(walkBicycleFirstResultHours) driver.elementClick(cycleBtn) driver.waitOnElement(walkBicycleFirstResultHours) hours = driver.getTextForElement(walkBicycleFirstResultHours) print("Number of hours: " + hours) hoursValue = int(hours[:-1]) print("Number of hours by Bicycle: " + str(hoursValue)) assert hoursValue > sconfig.bicycleHoursMin ferryMsg = driver.getTextForElement(ferryMessage) print("Ferry Message is: " + ferryMsg) assert ferryMsg == sconfig.ferryIncludedMsg
def step_impl(context): driver.waitOnElement(flightsBtn) driver.elementClick(flightsBtn) driver.waitOnElement(multiCityBtn) driver.elementClick(multiCityBtn) try: driver.elementClick(notifCloseBtn) except: pass
def step_impl(context): driver.elementClick(fromDate) driver.waitOnElement(firstAvailDate) availToClickCount = len(driver.getElements(availDate)) numOfMonthsAvaialble = int(availToClickCount / 30) print("Number of months to book ahead from elements: " + str(numOfMonthsAvaialble)) availCheckCount = 1 try: for i in range(1, numOfMonthsAvaialble + 1): print("Next month selection clicked") driver.elementClick(nextMonthSelectionBtn) availCheckCount = availCheckCount + 1 except: driver.elementClick(nextMonthSelectionBtnDisabled) print("Number of months to book ahead from next month click: " + str(availCheckCount)) assert availCheckCount == numOfMonthsAvaialble
def step_impl(context): driver.waitOnElement(flightsResult) numOfFlights = len(driver.getElements(flightsResult)) print("Number of Results from the Search Criteria: "+str(numOfFlights)) try: driver.elementClick(nonstopFlightSelect) except: driver.elementClick(onestopFlightSelect) print("Selecting the Lowest Price Flight with Least Stops") driver.waitFor(5) driver.elementClick(lowestPriceFlight) driver.waitFor(5) driver.elementClick(lowestPriceFlight) print("Waiting on Selecting Second Flight") driver.waitOnElement(noExtraCostFlight) print("Selecting Flight with No Extra Cost") driver.waitFor(5) driver.elementClick(lowestPriceFlight) driver.waitOnElement(selectFareBtn) driver.elementClick(lowestPriceFlight) print("Waiting on Selecting Third Flight") driver.waitOnElement(noExtraCostFlight) print("Selecting Flight with No Extra Cost") driver.waitFor(5) driver.elementClick(lowestPriceFlight) driver.waitOnElement(selectFareBtn) driver.elementClick(lowestPriceFlight) driver.waitFor(3) driver.switchWindow() print("Validating Confirmation of First Flight") flight1Source = driver.getTextForElement(flight1Sourceconfirmation) flight1Dest = driver.getTextForElement(flight1DestConfirmation) print("Flight 1 Source: "+str(flight1Source)) print("Flight 1 Dest: "+str(flight1Dest)) assert sconfig.Dallas in flight1Source assert sconfig.sanFran in flight1Dest print("Validating Confirmation of Second Flight") flight2Source = driver.getTextForElement(flight2Sourceconfirmation) flight2Dest = driver.getTextForElement(flight2DestConfirmation) print("Flight 2 Source: "+str(flight2Source)) print("Flight 2 Dest: "+str(flight2Dest)) assert sconfig.sanFran in flight2Source assert sconfig.newYork in flight2Dest print("Validating Confirmation of Third Flight") flight3Source = driver.getTextForElement(flight3Sourceconfirmation) flight3Dest = driver.getTextForElement(flight3DestConfirmation) print("Flight 3 Source: "+str(flight3Source)) print("Flight 3 Dest: "+str(flight3Dest)) assert sconfig.newYork in flight3Source assert sconfig.Dallas in flight3Dest
def step_impl(context): driver.waitFor(1) driver.elementClick(searchBtn)
def step_impl(context): flight1Date = "[2]" flight2Date = "[6]" flight3Date = "[10]" driver.elementClick(flight1DateBtn) driver.waitOnElement(datesPicker) availDates = len(driver.getElements(datesPicker)) print("Available Dates are: "+str(availDates)) driver.elementClick(datesPicker+flight1Date) driver.waitFor(1) driver.elementClick(flight2DateBtn) driver.elementClick(datesPicker+flight2Date) driver.waitFor(1) driver.elementClick(flight3DateBtn) driver.elementClick(datesPicker+flight3Date)
def step_impl(context): driver.waitFor(2) driver.elementClick(addFlightBtn) driver.enterValues(source1Btn, sconfig.DFW) driver.waitOnElement(loc1And3Select) driver.elementClick(loc1And3Select) driver.enterValues(destination1Btn, sconfig.SFO) driver.waitOnElement(loc2Select) driver.elementClick(loc2Select) driver.enterValues(source2Btn, sconfig.SFO) driver.waitOnElement(loc2Select) driver.elementClick(loc2Select) driver.enterValues(destination2Btn, sconfig.NYC) driver.waitOnElement(loc1And3Select) driver.elementClick(loc1And3Select) driver.enterValues(source3Btn, sconfig.NYC) driver.waitOnElement(loc1And3Select) driver.elementClick(loc1And3Select) driver.enterValues(destination3Btn, sconfig.DFW) driver.waitOnElement(loc1And3Select) driver.elementClick(loc1And3Select)
def step_impl(context): driver.waitFor(1) driver.elementClick(adultAgeBtn) driver.waitOnElement(adultAgeSelectBtn) driver.elementClick(adultAgeSelectBtn) driver.elementClick(childrenBtn) driver.waitOnElement(childrenNumBtn) driver.elementClick(childrenNumBtn) driver.elementClick(children1AgeBtn) driver.waitOnElement(children1AgeSelectBtn) driver.elementClick(children1AgeSelectBtn) driver.elementClick(children2AgeBtn) driver.waitOnElement(children2AgeSelectBtn) driver.elementClick(children2AgeSelectBtn) driver.waitFor(1) driver.elementClick(child1AgeLabel)
def step_impl(context): driver.waitOnElement(gmail) # wait on an element when site is loaded driver.elementClick(gmail) # click element when element is visible