def test_977(self): page = EventCalendarPage() # STEP1 page.open() time.sleep(2) select = Select(page.activity_name) select.select_by_visible_text(ActivityName) time.sleep(5) page.hide_events.click() time.sleep(5) page.event_tickets[0].click() time.sleep(5) for i in range(0, len(page.event_tickets)): if EventHeaderDateTimeList[ 0] != page.date_time_title.get_attribute('textContent'): page.close_button.click() time.sleep(5) page.event_tickets[i + 1].click() time.sleep(5) continue else: time.sleep(5) assert 'Ticket Sold: 0' not in page.manifest_title.get_attribute( "innerText") assert 'Ticket Sold: 1' not in page.manifest_title.get_attribute( "innerText") assert 'Tickets Sold: 2' not in page.manifest_title.get_attribute( "innerText") page.add_booking_button.click() # STEP2 break time.sleep(5) page = AdminBookingPage() time.sleep(5) page.first_tickets_type.send_keys('1') # STEP3 time.sleep(5) page.enter_customer_information_button.click() # STEP4 time.sleep(5) NewFirstName = 'James' page.first_name.send_keys(NewFirstName) # STEP5 NewLastName = 'James' NewFullName = NewFirstName + ' ' + ''.join(NewLastName) page.last_name.send_keys(NewLastName) NewEmail = ('*****@*****.**') page.email_address.send_keys(NewEmail) time.sleep(10) page.complete_booking_button.click() # STEP6 time.sleep(5) wait = WebDriverWait(get_driver(), 15) wait.until(lambda driver: page.is_element_present('payment_type_list')) select = Select(page.payment_type_list) # STEP7 PaymentType = "Cash" select.select_by_visible_text(PaymentType) page.submit_booking_button.click() # STEP8 time.sleep(5) assert page.final_alert.get_attribute( "textContent") == 'Booking Successful!' page.final_alert_ok_button.click() # STEP9
def test_985(self): page = EventCalendarPage() page.open() time.sleep(2) select = Select(page.activity_name) select.select_by_visible_text(ActivityNameList[0]) time.sleep(2) page.hide_events.click() time.sleep(5) page.date_picker.click() time.sleep(2) page.date_picker_next.click() EventDate = str(random.choice(DateList)) for i in range(0, len(page.days_date_picker)): if page.days_date_picker[i].get_attribute( "textContent") == EventDate: page.days_date_picker[i].click() else: continue break page.day_button.click() time.sleep(6) nextMonthDate = datetime.date.today() + relativedelta(months=1) FullEventDate = (nextMonthDate.strftime("%B") + ' ' + ''.join(EventDate)) assert str(FullEventDate) in page.date_header.get_attribute( "textContent") for ticket in page.day_slots: # STEP25 for i in range(0, len(page.day_slots)): if TimeList[0] in ticket.day_slot_time[i].get_attribute( 'textContent'): page.day_slots[i].click() else: continue break time.sleep(6) assert FullEventDate in page.date_time_title.get_attribute( 'textContent') assert ActivityNameList[0] == page.activity_name_title.get_attribute( 'textContent') assert TimeList[0] in page.date_time_title.get_attribute('textContent') assert page.event_status.get_attribute( "textContent") == 'Pending' #STEP4 assert 'Ticket Sold: 0' in page.manifest_title.get_attribute( "innerText") page.add_booking_button.click() #STEP5 time.sleep(5) page = AdminBookingPage() time.sleep(5) page.first_tickets_type.send_keys('3') #STEP6 time.sleep(5) assert page.final_alert.get_attribute( "textContent" ) == 'Minimum number of tickets (4 tickets) for the event has not been met yet. Do you want to continue?' page.alert_cancel_button.click() # STEP7 time.sleep(5) assert page.is_element_present( 'enter_customer_information_button') == False page.first_tickets_type.clear() page.first_tickets_type.send_keys('4') # STEP8 time.sleep(5) page.enter_customer_information_button.click() #STEP9 time.sleep(5) NewFirstName = 'James' page.first_name.send_keys(NewFirstName) # STEP10 NewLastName = 'James' NewFullName = NewFirstName + ' ' + ''.join(NewLastName) page.last_name.send_keys(NewLastName) NewEmail = ('*****@*****.**') page.email_address.send_keys(NewEmail) time.sleep(10) page.complete_booking_button.click() time.sleep(5) wait = WebDriverWait(get_driver(), 15) wait.until(lambda driver: page.is_element_present('payment_type_list')) select = Select(page.payment_type_list) PaymentType = "Cash" # STEP11 select.select_by_visible_text(PaymentType) page.cash_recieved.click() page.submit_booking_button.click() time.sleep(5) assert page.final_alert.get_attribute( "textContent") == 'Booking Successful!' page.final_alert_ok_button.click() # STEP12 page = EventCalendarPage() #STEP13 page.open() time.sleep(2) select = Select(page.activity_name) select.select_by_visible_text(ActivityNameList[0]) time.sleep(2) page.hide_events.click() time.sleep(5) page.date_picker.click() time.sleep(2) page.date_picker_next.click() for i in range(0, len(page.days_date_picker)): if page.days_date_picker[i].get_attribute( "textContent") == EventDate: page.days_date_picker[i].click() else: continue break page.day_button.click() time.sleep(6) assert str(FullEventDate) in page.date_header.get_attribute( "textContent") for ticket in page.day_slots: for i in range(0, len(page.day_slots)): if TimeList[0] in ticket.day_slot_time[i].get_attribute( 'textContent'): page.day_slots[i].click() else: continue break time.sleep(6) assert FullEventDate in page.date_time_title.get_attribute( 'textContent') assert ActivityNameList[0] == page.activity_name_title.get_attribute( 'textContent') assert TimeList[0] in page.date_time_title.get_attribute('textContent') assert page.event_status.get_attribute("textContent") == 'Closed' assert 'Tickets Sold: 4' in page.manifest_title.get_attribute( "innerText") assert page.customer_name_link.get_attribute( 'textContent') == NewFullName assert page.email_link.get_attribute('textContent') == NewEmail assert page.add_booking_button.is_enabled() == False #STEP14