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_983(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_guide)
     if page.switcher_minimum_enforce.get_attribute(
             "outerHTML"
     ) != switcher_OFF and page.ticket_minimum.get_attribute(
             'value'
     ) == '5' and select.first_selected_option.text == GuideName and page.switchers2[
             0].get_attribute(
                 "outerHTML") == switcher_OFF:  #First Sale Closes Event::
         page.cancel_button.click()
     else:
         if page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") == switcher_OFF:
             page.switcher_minimum_enforce.click()
             time.sleep(2)
             assert page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") != switcher_OFF  # Tickets Minimum Enforce
         if page.ticket_minimum.get_attribute('value') != '5':
             page.ticket_minimum.clear()
             page.ticket_minimum.send_keys('5')
         if select.first_selected_option.text != GuideName:
             select.select_by_visible_text(GuideName)
         if page.switchers2[0].get_attribute("outerHTML") != switcher_OFF:
             page.switchers2[0].click()
             time.sleep(2)
             assert page.switchers2[0].get_attribute(
                 "outerHTML") == switcher_OFF  #First Sale Closes Event:
         page.save_button.click()
     page = EventCalendarPage()
     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 'Ticket Sold: 0' not in page.manifest_title.get_attribute(
                 "innerText"):
             page.close_button.click()
             time.sleep(5)
             page.event_tickets[i + 1].click()
             time.sleep(5)
             continue
         else:
             time.sleep(5)
             EventHeaderDateTimeList.append(
                 page.date_time_title.get_attribute('textContent'))
             page.add_booking_button.click()
         break
     time.sleep(5)
     page = AdminBookingPage()
     time.sleep(5)
     TimeList.append(page.time_current_booking.get_attribute('textContent'))
     DateList.append(page.date_current_booking.get_attribute('textContent'))
     page.first_tickets_type.send_keys('5')
     time.sleep(5)
     page.enter_customer_information_button.click()
     time.sleep(5)
     NewFirstName = 'James'
     page.first_name.send_keys(NewFirstName)
     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"
     select.select_by_visible_text(PaymentType)
     page.cash_recieved.click()
     time.sleep(5)
     page.submit_booking_button.click()
     time.sleep(5)
     assert page.final_alert.get_attribute(
         "textContent") == 'Booking Successful!'
     page.final_alert_ok_button.click()
     page = EventCalendarPage()
     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 'Tickets Sold: 5' in page.manifest_title.get_attribute(
                 "innerText")
             assert page.event_status.get_attribute(
                 'textContent') == 'Pending'
         break
     time.sleep(5)
     select = Select(page.guide_list)
     select.select_by_visible_text(GuideName)
     page.save_guide.click()
     assert page.info_pop_up.get_attribute(
         'textContent') == "Information was saved successfully."
     page.OK_info_pop_up.click()
     page = loginpage()
     page.open()
     page.login_field.send_keys(guide_flat_login)
     page.password_field.send_keys(guide_flat_password)
     page.button.click()
     page = GuidePage()
     time.sleep(5)
     page.search_field.send_keys(ActivityName)  #STEP1
     time.sleep(5)
     EventDate = DateList[0].partition(' ')[2]
     for i in range(0, len(page.event_tickets)):  # STEP7
         page.event_tickets[i].click()
         time.sleep(10)
         if EventDate in page.date_time_title.get_attribute('textContent'):
             if TimeList[0] in page.date_time_title.get_attribute(
                     'textContent'):
                 break
             else:
                 get_driver().back()
                 time.sleep(5)
                 i += 1
                 continue
         else:
             get_driver().back()
             time.sleep(5)
             i += 1
             continue
     assert '(5)' in page.customer_tickets.get_attribute("innerText")
     time.sleep(5)
     page.add_booking.click()  #STEP2
     page = AdminBookingPage()
     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 = "Credit Card"
     select.select_by_visible_text(PaymentType)
     select = Select(page.credit_card_list)
     time.sleep(5)
     select.select_by_visible_text('New Card')
     time.sleep(5)
     get_driver().switch_to.frame(page.stripe)
     page.card_number_input.send_keys(CC_Number)
     page.card_date_input.send_keys(ExpDate)
     page.card_cvc_input.send_keys(CVC)
     page.card_zip_input.send_keys(CCZip)
     get_driver().switch_to.default_content()
     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_891(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = NavigationBar()
     time.sleep(2)
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()  #STEP1
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(ActivityName)  #STEP2
     page.first_tickets_type.send_keys(AdultTickets)  #STEP3
     time.sleep(5)
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate = str(random.randint(2, 27))  #STEP4
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours = str(random.randint(2, 11))
     minutes_values = ('00', '15', '30', '45')
     EventTimeMinutes = random.choice(minutes_values)
     timeday = random.choice(('AM', 'PM'))
     EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) +
                          ' ' + ''.join(timeday) + ' ' +
                          ''.join(ActivityTimezone))
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate = (NextMonthName + ' ' + ''.join(str(EventDate)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone)  #STEP5
     time.sleep(5)
     page.enter_customer_information_button.click()  #STEP6
     first_names = ('Ivan-John', 'Peter-Paul', 'John-Alex', 'Bill-Michael',
                    'Michael-James', 'Sidor-Bob', 'Alex-Ivan', 'James-Tim',
                    'Bob-Chris', 'Ivan-Jim', 'Tim-Michael', 'Chris-Jim',
                    'Jim-John', 'Pahom-Sidor', 'Vlad-Vadim', 'Paul-James')
     NewFirstName = random.choice(first_names)
     page.first_name.send_keys(NewFirstName)  #STEP7
     last_names = ('Smith', 'Baker', 'Petroff', 'Smirnoff', 'Black',
                   'White', 'Broun', 'Ivanoff', 'Green', 'Clinton',
                   'Jameson', 'Last', 'Sergeff', 'Madison')
     NewLastName = random.choice(last_names)
     NewFullName = NewFirstName + ' ' + ''.join(NewLastName)
     page.last_name.send_keys(NewLastName)
     NewPhone = (''.join(choice(digits) for i in range(15)))
     page.phone_number.send_keys(NewPhone)
     page.complete_booking_button.click()
     time.sleep(7)
     select = Select(page.payment_type_list)
     PaymentType = "Cash"  # STEP8
     select.select_by_visible_text(PaymentType)
     page.cash_recieved.click()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()  #STEP10
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     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") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:  #STEP11
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.customer_name_link.get_attribute(
         'textContent') == NewFullName
     assert page.phone_link.get_attribute('pathname') == NewPhone
     page.customer_name_link.click()  # STEP12
     page = CustomerListPage()
     assert page.customer_name_info.get_attribute(
         'textContent') == NewFullName + "'s"
     assert page.phone_info.get_attribute('innerText') == NewPhone
     assert page.email_info.get_attribute('innerText') == 'Not Saved'
     assert page.zip_info.get_attribute('innerText') == 'Not Saved'
     assert page.state_info.get_attribute('innerText') == 'Not Saved'
     assert page.address_info.get_attribute('innerText') == 'Not Saved'
     assert page.timeline_tickets_title.get_attribute(
         'textContent'
     ) == 'Purchased Tickets for the ' + ''.join(ActivityName)
     assert EventTimeWithZone and NewFullDate in page.timeline_event.get_attribute(
         'textContent')
     assert page.timeline_tickets.get_attribute(
         'textContent'
     ) == AdultTickets + ' Tickets | ' + ''.join(AdultTicketPrice) + ' '
     page.activities_tab_link.click()
     time.sleep(5)
     assert page.activities_tab_title.get_attribute(
         'innerText') == ActivityName
     assert page.activities_tickets.get_attribute(
         'innerText'
     ) == AdultTickets + ' tickets | ' + ''.join(AdultTicketPrice)
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' +
         password)  #STEP 14
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM customer ORDER BY customer_id DESC")
     row = cursor.fetchone()
     CustomerID = row[0]
     assert row[1] == 68  #company ID
     assert row[2] == NewFirstName
     assert row[3] == NewLastName
     assert row[4] == None  #customer_address_1
     assert row[5] == None  #customer_address_2
     assert row[6] == None  #customer_city
     assert row[7] == None  #customer_state
     assert row[8] == None  #customer_zipcode
     assert row[9] == None  #customer_country
     assert row[10] == NewPhone  #customer_phone_1
     assert row[11] == None  #customer_phone_2
     assert row[12] == None
     assert row[17] == NewPhone  #CustomerKey
     page = NavigationBar()
     time.sleep(2)
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()  # STEP15
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(ActivityName2)  # STEP16
     page.first_tickets_type.send_keys(AdultTickets)  # STEP17
     time.sleep(5)
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate2 = str(int(EventDate) + 1)  # STEP18
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate2:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours2 = str(random.randint(2, 11))
     minutes_values = ('00', '15', '30', '45')
     EventTimeMinutes2 = random.choice(minutes_values)
     timeday2 = random.choice(('AM', 'PM'))
     EventTimeWithZone2 = (EventTimeHours2 + ':' +
                           ''.join(EventTimeMinutes2) + ' ' +
                           ''.join(timeday2) + ' ' +
                           ''.join(ActivityTimezone2))
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate2 = (NextMonthName + ' ' + ''.join(str(EventDate2)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone2)  # STEP19
     time.sleep(5)
     page.enter_customer_information_button.click()  # STEP20
     page.first_name.send_keys(NewFirstName)  # STEP21
     page.last_name.send_keys(NewLastName)
     page.phone_number.send_keys(NewPhone)
     NewEmail = (''.join(choice(digits)
                         for i in range(15)) + '@mailinator.com')
     page.email_address.send_keys(NewEmail)
     page.complete_booking_button.click()
     time.sleep(7)
     select = Select(page.payment_type_list)
     PaymentType = "Credit Card"  # STEP22
     select.select_by_visible_text(PaymentType)
     select = Select(page.credit_card_list)
     time.sleep(5)
     select.select_by_visible_text('New Card')
     time.sleep(5)
     get_driver().switch_to.frame(page.stripe)
     page.card_number_input.send_keys(CC_Number)
     page.card_date_input.send_keys(ExpDate)
     page.card_cvc_input.send_keys(CVC)
     page.card_zip_input.send_keys(CCZip)
     get_driver().switch_to.default_content()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()  # STEP24
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName2)
     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") == str(
                 EventDate2):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime2 = (EventTimeHours2 + ':' + ''.join(EventTimeMinutes2) +
                   ' ' + ''.join(timeday2))
     assert str(NewFullDate2) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:  # STEP25
         for i in range(0, len(page.day_slots)):
             if EventTime2 in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.customer_name_link.get_attribute(
         'textContent') == NewFullName
     assert page.phone_link.get_attribute('pathname') == NewPhone
     assert page.email_link.get_attribute('textContent') == NewEmail
     page.close_button.click()
     select = Select(page.activity_name)  # STEP26
     select.select_by_visible_text(ActivityName)
     page.date_picker.click()
     time.sleep(2)
     for i in range(0, len(page.days_date_picker)):
         if page.days_date_picker[i].get_attribute("textContent") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.customer_name_link.get_attribute(
         'textContent') == NewFullName
     assert page.phone_link.get_attribute('pathname') == NewPhone
     page.customer_name_link.click()  # STEP27
     page = CustomerListPage()
     assert page.customer_name_info.get_attribute(
         'textContent') == NewFullName + "'s"
     assert page.phone_info.get_attribute('innerText') == NewPhone
     assert page.email_info.get_attribute('innerText') == NewEmail
     assert page.zip_info.get_attribute('innerText') == 'Not Saved'
     assert page.state_info.get_attribute('innerText') == 'Not Saved'
     assert page.address_info.get_attribute('innerText') == 'Not Saved'
     assert page.timeline_email_title.get_attribute(
         'textContent'
     ) == 'Purchased Tickets for the ' + ''.join(ActivityName2)
     assert EventTimeWithZone2 and NewFullDate2 in page.timeline_event.get_attribute(
         'textContent')
     assert page.timeline_tickets.get_attribute(
         'textContent'
     ) == AdultTickets + ' Tickets | ' + ''.join(AdultTicketPrice2) + ' '
     page.activities_tab_link.click()
     time.sleep(5)
     assert page.activities_tab_title.get_attribute(
         'innerText') == ActivityName2
     assert page.activities_tickets.get_attribute(
         'innerText'
     ) == AdultTickets + ' tickets | ' + ''.join(AdultTicketPrice2)
     page = CustomerListPage()  # STEP29
     page.open()
     page.search_field.send_keys(NewPhone)
     page.search_button.click()
     time.sleep(2)
     assert page.customer_name_in_list.get_attribute(
         'textContent') == NewFullName
     assert page.phone_in_list.get_attribute('textContent') == NewPhone
     assert page.activity_name_in_list.get_attribute(
         'textContent') == ActivityName2
     assert page.is_element_present('customer_name_in_list2') == False
     cursor.execute(
         "SELECT TOP 1 * FROM customer ORDER BY customer_id DESC")  #STEP30
     row = cursor.fetchone()
     assert row[0] == CustomerID
     assert row[1] == 68  # company ID
     assert row[2] == NewFirstName
     assert row[3] == NewLastName
     assert row[4] == None  #customer_address_1
     assert row[5] == None  #customer_address_2
     assert row[6] == None  #customer_city
     assert row[7] == None  #customer_state
     assert row[8] == None  #customer_zipcode
     assert row[9] == None  #customer_country
     assert row[10] == NewPhone  #customer_phone_1
     assert row[11] == None  #customer_phone_2
     assert row[12] == NewEmail
     assert row[17] == NewEmail  #CustomerKey
 def test_8(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ChannelPayrollPage()
     page.open()
     page.channel_payment_due.click()
     time.sleep(3)
     try:
         for i in range(0, len(page.channel_entries)):
             if channel in page.channel_entries[i].get_attribute(
                     'textContent'):
                 page.channel_detail[i].click()
             else:
                 continue
             break
         time.sleep(3)
         for i in range(0, len(page.cash)):
             if page.cash[i].is_displayed():
                 page.cash[i].click()
             else:
                 continue
             break
         time.sleep(6)
         for i in range(0, len(page.pay_button)):
             if page.pay_button[i].is_displayed():
                 page.pay_button[i].click()
             else:
                 continue
             break
         time.sleep(6)
         alert = get_driver().switch_to_alert()
         alert.accept()
         time.sleep(2)
         page.OK_button.click()
         time.sleep(2)
     except WebDriverException:
         print("Channel has no payment due")
     page = NavigationBar()
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(ActivityName)
     page.first_tickets_type.send_keys(AdultTickets)
     time.sleep(5)
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate = str(random.randint(2, 30))
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours = str(random.randint(2, 11))
     minutes_values = ('00', '15', '30', '45')
     EventTimeMinutes = random.choice(minutes_values)
     timeday = random.choice(('AM', 'PM'))
     EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) +
                          ' ' + ''.join(timeday) + ' ' +
                          ''.join(ActivityTimezone))
     nextMonthDate = (datetime.now() +
                      relativedelta(months=1)).strftime('%#m')
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate = (NextMonthName + ' ' + ''.join(str(EventDate)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone)
     time.sleep(5)
     page.enter_customer_information_button.click()
     FirstName = "Alexey"
     page.first_name.send_keys(FirstName)
     LastName = "Kolennikov"
     page.last_name.send_keys(LastName)
     EmailAddress = '*****@*****.**'
     page.email_address.send_keys(EmailAddress)
     page.complete_booking_button.click()
     time.sleep(2)
     select = Select(page.channel_list)
     time.sleep(5)
     select.select_by_visible_text(channel)
     select = Select(page.payment_type_list)
     time.sleep(5)
     PaymentType = "Cash"
     select.select_by_visible_text(PaymentType)
     time.sleep(2)
     page.cash_recieved.click()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     page.date_picker.click()
     time.sleep(2)
     page.date_picker_next.click()
     time.sleep(2)
     for i in range(0, len(page.days_date_picker)):
         if page.days_date_picker[i].get_attribute("textContent") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
                 time.sleep(6)
                 assert NewFullDate and EventTime in page.date_time_title.get_attribute(
                     'textContent')
                 assert ActivityName == page.activity_name_title.get_attribute(
                     'textContent')
                 select = Select(page.guide_list)
                 select.select_by_visible_text(GuideName)
                 page.save_guide.click()
                 page.close_button.click()
             else:
                 continue
         break
     page = loginpage()
     page.open()
     page.login_field.send_keys(guide_login)
     page.password_field.send_keys(guide_password)
     page.button.click()
     page = GuidePage()
     time.sleep(2)
     page.day_button.click()
     time.sleep(2)
     page.date_picker.click()
     time.sleep(2)
     page.next_month.click()
     time.sleep(2)
     for i in range(0, len(page.days_date_picker)):
         if page.days_date_picker[i].get_attribute("textContent") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     time.sleep(2)
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
                 time.sleep(6)
                 assert NextMonthName and EventDate and EventTimeWithZone in page.date_time_title.get_attribute(
                     'textContent')
                 assert ActivityName in page.activity_name_title.get_attribute(
                     'textContent')
             else:
                 continue
         break
     time.sleep(4)
     page.check_in.click()
     page.event_complete.click()
     alert = get_driver().switch_to_alert()
     alert.accept()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ChannelPayrollPage()
     page.open()
     page.channel_payment_due.click()
     time.sleep(5)
     L = []
     for i in range(0, len(page.channel_entries)):
         if channel in page.channel_entries[i].get_attribute('textContent'):
             assert comission_amount in page.channel_entries[
                 i].get_attribute('textContent')
             L.append(page.channel_entries[i].get_attribute('textContent'))
         else:
             continue
         break
     assert len(L) == 1
 def test_880(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = NavigationBar()
     time.sleep(2)
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()  #STEP1
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(ActivityName)  #STEP2
     page.first_tickets_type.send_keys(AdultTickets)  #STEP3
     time.sleep(5)
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate = str(random.randint(2, 28))  #STEP4
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours = str(random.randint(2, 11))
     minutes_values = ('00', '15', '30', '45')
     EventTimeMinutes = random.choice(minutes_values)
     timeday = random.choice(('AM', 'PM'))
     EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) +
                          ' ' + ''.join(timeday) + ' ' +
                          ''.join(ActivityTimezone))
     nextMonthDate = (datetime.now() +
                      relativedelta(months=1)).strftime('%#m')
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate = (NextMonthName + ' ' + ''.join(str(EventDate)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone)  #STEP5
     time.sleep(5)
     page.enter_customer_information_button.click()  #STEP6
     first_names = ('Ivan', 'Peter', 'John', 'Bill', 'Michael', 'Sidor',
                    'Alex', 'James', 'Bob', 'Ivan', 'Tim', 'Chris', 'Jim',
                    'Pahom', 'Vlad', 'Paul')
     NewFirstName = random.choice(first_names)
     page.first_name.send_keys(NewFirstName)  #STEP7
     last_names = ('Smith', 'Baker', 'Petroff', 'Smirnoff', 'Black',
                   'White', 'Broun', 'Ivanoff', 'Green', 'Clinton',
                   'Jameson', 'Last', 'Sergeff', 'Madison')
     NewLastName = random.choice(last_names)
     NewFullName = NewFirstName + ' ' + ''.join(NewLastName)
     page.last_name.send_keys(NewLastName)
     page.complete_booking_button.click()
     time.sleep(7)
     select = Select(page.payment_type_list)
     PaymentType = "Cash"  #STEP8
     select.select_by_visible_text(PaymentType)
     page.cash_recieved.click()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()  #STEP10
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     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") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:  #STEP11
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.customer_name_link.get_attribute(
         'textContent') == NewFullName
     page.customer_name_link.click()  # STEP12
     page = CustomerListPage()
     assert page.customer_name_info.get_attribute(
         'textContent') == NewFullName + "'s"
     #assert page.phone_info.get_attribute('innerText')=='Not Saved' #BUG 2954
     assert page.email_info.get_attribute('innerText') == 'Not Saved'
     assert page.zip_info.get_attribute('innerText') == 'Not Saved'
     assert page.state_info.get_attribute('innerText') == 'Not Saved'
     assert page.address_info.get_attribute('innerText') == 'Not Saved'
     assert page.timeline_tickets_title.get_attribute(
         'textContent'
     ) == 'Purchased Tickets for the ' + ''.join(ActivityName)
     assert EventTimeWithZone and NewFullDate in page.timeline_event.get_attribute(
         'textContent')
     assert page.timeline_tickets.get_attribute(
         'textContent'
     ) == AdultTickets + ' Tickets | ' + ''.join(AdultTicketPrice) + ' '
     page.activities_tab_link.click()
     time.sleep(5)
     assert page.activities_tab_title.get_attribute(
         'innerText') == ActivityName
     assert page.activities_tickets.get_attribute(
         'innerText'
     ) == AdultTickets + ' tickets | ' + ''.join(AdultTicketPrice)
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' +
         password)  #STEP 14
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM customer ORDER BY customer_id DESC")
     row = cursor.fetchone()
     assert row[1] == 68  #company ID
     assert row[2] == NewFirstName
     assert row[3] == NewLastName
     assert row[17] == None  #CustomerKey
예제 #6
0
 def test_567(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.sales_tax.get_attribute("value") == '0 %':
         page.cancel_button.click()
     else:
         page.sales_tax.clear()
         page.sales_tax.send_keys('0')
     page = NavigationBar()
     time.sleep(2)
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()  # STEP1
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(ActivityName)  # STEP2
     page.first_tickets_type.send_keys('1')  # STEP3
     page.second_tickets_type.send_keys('1')
     time.sleep(5)
     assert page.ticket_total.get_attribute("innerText") == '$150.00'
     assert page.discount.get_attribute("innerText") == '- $0.00'
     assert page.giftcertificate.get_attribute("innerText") == '- $0.00'
     assert page.taxes.get_attribute("innerText") == '$0.00'
     assert page.booking_fee.get_attribute("innerText") == '$0.00'
     assert page.grand_total.get_attribute("innerText") == '$150.00'
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate = str(random.randint(2, 27))  # STEP4
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours = str(random.randint(8, 11))
     minutes_values = '00'
     EventTimeMinutes = minutes_values
     timeday = 'AM'
     EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) +
                          ' ' + ''.join(timeday) + ' ' +
                          ''.join(ActivityTimezone))
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate = (NextMonthName + ' ' + ''.join(str(EventDate)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone)  # STEP5
     time.sleep(5)
     page.enter_customer_information_button.click()  # STEP6
     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()
     time.sleep(7)
     select = Select(page.payment_type_list)
     PaymentType = "Credit Card"  # STEP8
     select.select_by_visible_text(PaymentType)
     select = Select(page.credit_card_list)
     time.sleep(5)
     select.select_by_visible_text('New Card')
     time.sleep(5)
     get_driver().switch_to.frame(page.stripe)
     page.card_number_input.send_keys(CC_Number)
     page.card_date_input.send_keys(ExpDate)
     page.card_cvc_input.send_keys(CVC)
     page.card_zip_input.send_keys(CCZip)
     get_driver().switch_to.default_content()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()  # STEP10
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     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") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:  # STEP11
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.customer_name_link.get_attribute(
         'textContent') == NewFullName
     assert page.email_link.get_attribute('innerText') == NewEmail
     assert '1 Adult' in page.manifest_tickets.get_attribute("innerText")
     assert '1 Child' in page.manifest_tickets.get_attribute("innerText")
     assert page.paid_link.get_attribute(
         "innerText") == 'Paid in Full : $150.00 '
     page.paid_link.click()  #STEP12
     page = CustomerChargePage()
     time.sleep(5)
     assert page.ticket_total.get_attribute('textContent') == '$150.00'
     assert page.boooking_fee.get_attribute('textContent') == '$0.00'
     assert page.taxes.get_attribute('textContent') == '$0.00'
     assert page.grand_total.get_attribute('textContent') == '$150.00'
     assert page.total_charges.get_attribute('textContent') == '$150.00'
     assert page.total_due.get_attribute('textContent') == '$0.00'
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' +
         password)  # STEP 13
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 * FROM charge ORDER BY charge_id DESC")
     row = cursor.fetchone()
     assert row[12] == 0  # charge_amount_tax
     assert row[13] == 150  # charge_amount_total
     assert row[9] == 'creditcard'  # charge_type
     assert 'OK|CHARGED|' in row[14]  #charge_resulttext
     cursor.execute(
         "SELECT TOP 1 * FROM q_charge_ex ORDER BY charge_id DESC"
     )  # STEP14
     row = cursor.fetchone()
     assert row[12] == 0  # charge_amount_tax
     assert row[13] == 150  # charge_amount_total
     assert row[9] == 'creditcard'  # charge_type
     assert 'OK|CHARGED|' in row[14]  #charge_resulttext
 def test_85(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     page.search_activity_field.send_keys('AutoTest_')
     time.sleep(5)
     page.activity_actions.click()
     ActivityName = page.activity_title.get_attribute("textContent")
     page.add_events.click()
     page = EventScheldulerPage()
     wait = WebDriverWait(get_driver(), 15)
     wait.until(lambda driver: page.is_element_present('scheldule_type'))
     select = Select(page.scheldule_type)
     select.select_by_visible_text('One-Time Event')
     page.onetime_field.click()
     page.next_button_calendar_begin.click()
     NewDate = random.randint(8, 30)
     nextMonthDate = datetime.date.today() + relativedelta(months=1)
     NewFullDate = (nextMonthDate.strftime("%B") + ' ' +
                    ''.join(str(NewDate)))
     for i in range(0, len(page.date_calendar)):
         if i + 1 == NewDate:
             page.date_calendar[i].click()
         else:
             continue
         break
     NewTimeHours = str(random.randint(1, 12))
     select = Select(page.onetime_hour)
     select.select_by_visible_text(NewTimeHours)
     NewTimeMinutes = '30'
     select = Select(page.onetime_minute)
     select.select_by_visible_text(NewTimeMinutes)
     NewTimeAMPM = 'PM'
     select = Select(page.onetime_ampm)
     select.select_by_visible_text(NewTimeAMPM)
     page.onetime_add.click()
     time.sleep(5)
     assert page.is_element_present('popup_OK') == True
     page.popup_OK.click()
     page = EventCalendarPage()
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     time.sleep(2)
     page.hide_events.click()
     time.sleep(2)
     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") == str(
                 NewDate):
             page.days_date_picker[i].click()
     page.day_button.click()
     time.sleep(2)
     timeEvent = (NewTimeHours + ':' + ''.join(NewTimeMinutes) + ' ' +
                  ''.join(NewTimeAMPM))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:
         for i in range(0, len(page.day_slots)):
             if timeEvent in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
                 time.sleep(6)
                 assert NewFullDate and timeEvent in page.date_time_title.get_attribute(
                     'textContent')
                 assert ActivityName == page.activity_name_title.get_attribute(
                     'textContent')
                 page.close_button.click()
                 page = EventCalendarPage()
             else:
                 continue
         break
 def test_242(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(username_list[0])  #STEP1
     page.password_field.send_keys(pwd_list[0])
     page.button.click()
     time.sleep(5)
     page = EmployeePage()  # STEP2
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_new_user') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ActivityHubPage()  #STEP3
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_activity_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = NavigationBar()  #STEP 4
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ChannelPage()  #STEP 5
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = WaiverAddPage()  #STEP 6
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = DiscountPage()  #STEP 7
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GrouponPage()  #STEP 8
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = CertificatePage()  #STEP 9
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_new_certificate_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = InvoicePageV2()  #STEP 10
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = PeopleHubPage()  #STEP 11
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_guide_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GuidePayrollPage()  # STEP 12
     page.open()
     time.sleep(2)
     assert page.is_element_present('guide_list') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ChannelPayrollPage()  #STEP 13
     page.open()
     time.sleep(2)
     assert page.is_element_present('channel_payment_due') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = EventCalendarPage()  #STEP 14
     page.open()
     time.sleep(2)
     assert page.is_element_present('date_picker') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GuideBulAssignmentPage()  #STEP 15
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = AddStartingLocationPage()  #STEP 16
     page.open()
     assert page.is_element_present('location_name') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = TaxesReportPage()  #STEP 17
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = AnalyticsDashboardPage()  #STEP 18
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = EditCompanyPage()  #STEP 19
     page.open()
     assert page.is_element_present('company_name_field') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = SelfProfilePage()  #STEP 20
     page.open()
     assert page.is_element_present('first_name_field') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = CustomerListPage()  #STEP 21
     page.open()
     assert page.is_element_present('add_customer_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
 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
예제 #10
0
 def test_511(self):
     page = NavigationBar()
     page.open()
     time.sleep(2)
     page.main_actions_drop_down.click()
     time.sleep(2)
     page.add_a_booking.click()  #STEP1
     page = AdminBookingPage()
     select = Select(page.activity_list)
     select.select_by_visible_text(Activity1)  #STEP2
     page.first_tickets_type.send_keys('1')  #STEP3
     time.sleep(5)
     page.datepicker_next_month.click()
     time.sleep(5)
     EventDate = str(random.randint(2, 27))  #STEP4
     for i in range(0, len(page.dates)):
         if page.dates[i].get_attribute("textContent") == EventDate:
             page.dates[i].click()
         else:
             continue
         break
     time.sleep(5)
     EventTimeHours = '9'
     EventTimeMinutes = '00'
     timeday = 'PM'
     EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) +
                          ' ' + ''.join(timeday) + ' ' +
                          ''.join(ActivityTimezone))
     NextMonthName = (datetime.now() +
                      relativedelta(months=1)).strftime("%B")
     NewFullDate = (NextMonthName + ' ' + ''.join(str(EventDate)))
     select = Select(page.time)
     select.select_by_visible_text(EventTimeWithZone)  #STEP5
     time.sleep(5)
     page.enter_customer_information_button.click()  #STEP6
     NewFirstName = 'James'
     page.first_name.send_keys(NewFirstName)  #STEP7
     NewLastName = 'James'
     NewFullName = NewFirstName + ' ' + ''.join(NewLastName)
     page.last_name.send_keys(NewLastName)
     NewEmail = ('*****@*****.**')
     page.email_address.send_keys(NewEmail)
     page.complete_booking_button.click()
     time.sleep(12)
     select = Select(page.payment_type_list)
     PaymentType = "Cash"  #STEP8
     select.select_by_visible_text(PaymentType)
     page.cash_recieved.click()
     page.submit_booking_button.click()
     time.sleep(5)
     page = EventCalendarPage()  #STEP10
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(Activity2)
     page.hide_events.click()
     time.sleep(2)
     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") == str(
                 EventDate):
             page.days_date_picker[i].click()
         else:
             continue
         break
     page.day_button.click()
     time.sleep(6)
     EventTime = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' +
                  ''.join(timeday))
     assert str(NewFullDate) in page.date_header.get_attribute(
         "textContent")
     for ticket in page.day_slots:  #STEP11
         for i in range(0, len(page.day_slots)):
             if EventTime in ticket.day_slot_time[i].get_attribute(
                     'textContent'):
                 page.day_slots[i].click()
             else:
                 continue
         break
     time.sleep(6)
     assert page.event_status.get_attribute('textContent') == 'Closed'
 def test_976(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.switcher_minimum_enforce.get_attribute(
             "outerHTML"
     ) != switcher_OFF and page.ticket_minimum.get_attribute(
             'value') == '3' and page.switchers2[0].get_attribute(
                 "outerHTML") == switcher_OFF:  #First Sale Closes Event:
         page.cancel_button.click()
     else:
         if page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") == switcher_OFF:
             page.switcher_minimum_enforce.click()
             time.sleep(2)
             assert page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") != switcher_OFF  #Tickets Minimum Enforce
         if page.ticket_minimum.get_attribute('value') != '3':
             page.ticket_minimum.clear()
             page.ticket_minimum.send_keys('3')
         if page.switchers2[0].get_attribute("outerHTML") != switcher_OFF:
             page.switchers2[0].click()
             time.sleep(2)
             assert page.switchers2[0].get_attribute(
                 "outerHTML") == switcher_OFF  #First Sale Closes Event:
         page.save_button.click()
     time.sleep(5)
     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 'Ticket Sold: 0' not in page.manifest_title.get_attribute(
                 "innerText"):
             page.close_button.click()
             time.sleep(5)
             page.event_tickets[i + 1].click()
             time.sleep(5)
             continue
         else:
             time.sleep(5)
             EventHeaderDateTimeList.append(
                 page.date_time_title.get_attribute('textContent'))
             page.add_booking_button.click()  # STEP2
         break
     time.sleep(5)
     page = AdminBookingPage()
     time.sleep(5)
     page.first_tickets_type.send_keys('3')  # 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 = "Credit Card"
     select.select_by_visible_text(PaymentType)
     select = Select(page.credit_card_list)
     time.sleep(5)
     select.select_by_visible_text('New Card')
     time.sleep(5)
     get_driver().switch_to.frame(page.stripe)
     page.card_number_input.send_keys(CC_Number)
     page.card_date_input.send_keys(ExpDate)
     page.card_cvc_input.send_keys(CVC)
     page.card_zip_input.send_keys(CCZip)
     get_driver().switch_to.default_content()
     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
예제 #12
0
 def test_864(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.switcher_minimum_enforce.get_attribute(
             "outerHTML"
     ) != switcher_OFF and page.ticket_minimum.get_attribute(
             'value') == '3':
         page.cancel_button.click()
     else:
         if page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") == switcher_OFF:
             page.switcher_minimum_enforce.click()
             time.sleep(2)
             assert page.switcher_minimum_enforce.get_attribute(
                 "outerHTML") != switcher_OFF  #Tickets Minimum Enforce
         if page.ticket_minimum.get_attribute('value') != '3':
             page.ticket_minimum.clear()
             page.ticket_minimum.send_keys('3')
         page.save_button.click()
     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 'Ticket Sold: 0' not in page.manifest_title.get_attribute(
                 "innerText"):
             page.close_button.click()
             time.sleep(5)
             page.event_tickets[i + 1].click()
             time.sleep(5)
             continue
         else:
             time.sleep(5)
             EventHeaderDateTimeList.append(
                 page.date_time_title.get_attribute('textContent'))
             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)
     assert page.final_alert.get_attribute(
         "textContent"
     ) == 'Minimum number of tickets (3 tickets) for the event has not been met yet. Do you want to continue?'
     page.alert_cancel_button.click()  # STEP4
     time.sleep(5)
     page.first_tickets_type.clear()
     page.first_tickets_type.send_keys('2')  # STEP5
     time.sleep(10)
     assert page.final_alert.get_attribute(
         "textContent"
     ) == 'Minimum number of tickets (3 tickets) for the event has not been met yet. Do you want to continue?'
     page.final_alert_ok_button.click()  # STEP6
     time.sleep(5)
     assert page.is_element_present(
         'enter_customer_information_button') == True
     page.enter_customer_information_button.click()  # STEP7
     time.sleep(5)
     NewFirstName = 'James'
     page.first_name.send_keys(NewFirstName)  # STEP8
     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()  # STEP9
     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)  # STEP10
     PaymentType = "Cash"
     select.select_by_visible_text(PaymentType)
     page.submit_booking_button.click()  # STEP11
     time.sleep(5)
     assert page.final_alert.get_attribute(
         "textContent") == 'Booking Successful!'
     page.final_alert_ok_button.click()  # STEP12
 def test_597(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.ticket_maximum.get_attribute("value") == '10':
         page.cancel_button.click()
     else:
         page.ticket_maximum.clear()
         page.ticket_maximum.send_keys('10')
         page.save_button.click()
     time.sleep(5)
     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 'Ticket Sold: 0' not in page.manifest_title.get_attribute(
                 "innerText"):
             page.close_button.click()
             time.sleep(5)
             page.event_tickets[i + 1].click()
             time.sleep(5)
             continue
         else:
             time.sleep(5)
             EventHeaderDateTimeList.append(
                 page.date_time_title.get_attribute('textContent'))
             page.add_booking_button.click()  # STEP2
         break
     time.sleep(5)
     page = AdminBookingPage()
     time.sleep(5)
     page.first_tickets_type.send_keys('5')  # STEP3
     time.sleep(5)
     page.second_tickets_type.send_keys('5')
     page.enter_customer_information_button.click()  # STEP6
     time.sleep(5)
     NewFirstName = 'James'
     page.first_name.send_keys(NewFirstName)  # STEP7
     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)  # STEP8
     PaymentType = "Cash"
     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()  # STEP9
     page = EventCalendarPage()  # STEP10
     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)):  # STEP11
         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 'Tickets Sold: 10' in page.manifest_title.get_attribute(
                 "innerText")
             assert 'Ticket Available: 0' in page.manifest_title.get_attribute(
                 "innerText")
             assert '5 Adult' in page.manifest_tickets.get_attribute(
                 "innerText")
             assert '5 Child' in page.manifest_tickets.get_attribute(
                 "innerText")
             page.add_booking_button.click()  # STEP12
         break
     time.sleep(5)
     page = AdminBookingPage()
     time.sleep(5)
     page.first_tickets_type.send_keys('1')  # STEP13
     time.sleep(5)
     assert page.final_alert.get_attribute(
         "textContent"
     ) == 'Booking 1 tickets will overbook this event.  Do you want to continue?'
     page.final_alert_ok_button.click()
     page.second_tickets_type.send_keys('1')
     time.sleep(5)
     assert page.final_alert.get_attribute(
         "textContent"
     ) == 'Booking 2 tickets will overbook this event.  Do you want to continue?'
     page.final_alert_ok_button.click()  # STEP14
     time.sleep(5)
     time.sleep(5)
     assert page.is_element_present(
         'enter_customer_information_button') == True
     page.enter_customer_information_button.click()  # STEP15
     time.sleep(5)
     NewFirstName = 'James'
     page.first_name.send_keys(NewFirstName)  # STEP16
     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)  # STEP17
     PaymentType = "Cash"
     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()  # STEP18
     page = EventCalendarPage()  # STEP19
     page.open()
     time.sleep(2)
     select = Select(page.activity_name)
     select.select_by_visible_text(ActivityName)
     time.sleep(5)
     page.event_tickets[0].click()
     time.sleep(5)
     for i in range(0, len(page.event_tickets)):  # STEP11
         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)
         break
     assert 'Tickets Sold: 12' in page.manifest_title.get_attribute(
         "innerText")
     assert 'Ticket Available: -2' in page.manifest_title.get_attribute(
         "innerText")
     assert '6 Adult' in page.manifest_tickets.get_attribute("innerText")
     assert '6 Child' in page.manifest_tickets.get_attribute("innerText")