def test_363(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() InactiveActivity = 'Sometimes inactive activity' page.search_activity_field.send_keys(InactiveActivity) page.show_inactive.click() time.sleep(5) page.activity_actions.click() page.edit_activity.click() page = AddEditActivityPage() time.sleep(10) select = Select(page.activity_status) NewActivityStatus = "Inactive" select.select_by_visible_text(NewActivityStatus ) page.save_button.click() page = NavigationBar() time.sleep(8) page.main_actions_drop_down.click() page.add_a_booking.click() time.sleep(8) page = AdminBookingPage() page.activity_list.click() L=[] for i in range(0, len(page.activities_in_list)): L.append(page.activities_in_list[i].get_attribute("textContent")) assert InactiveActivity not in L
def test_214(self): page = ChannelPage() page.open() time.sleep(5) page.search_field.send_keys(ChannelNameList[0]) time.sleep(2) page.table_channel_editbutton.click() time.sleep(5) assert page.status_checkbox.is_selected() == True page.status_checkbox.click() page.save_button.click() time.sleep(7) 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('1') 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, 10)) minutes_values = ('00', '15', '30', '45') EventTimeMinutes = random.choice(minutes_values) timeday = random.choice(('AM', 'PM')) EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' + ''.join(timeday) + ' ' + ''.join(ActivityTimezone)) 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) L = [] for i in range(0, len(page.channel_list_options)): L.append(page.channel_list_options[i].get_attribute("textContent")) assert ChannelNameList[0] not in L
def test_4(self): get_driver().maximize_window() page = loginpage() page.open() page.login_field.send_keys(admin_hourly_login) page.password_field.send_keys(admin_hourly_password) page.button.click() page = NavigationBar() time.sleep(6) page.time_tracker.click() time.sleep(tracked_time_seconds) page.time_tracker_checked.click() page = loginpage() page.open() page.login_field.send_keys(admin_login) page.password_field.send_keys(admin_password) page.button.click() page = EmployeePayrollPage() page.open() time.sleep(3) page.employee_payment_due_hourly.click() L = [] for i in range(0, len(page.hourly_payment_due_enties)): if admin_hourly_name in page.hourly_payment_due_enties[ i].get_attribute("textContent"): L.append( page.hourly_employee_payment_due_amounts[i].get_attribute( "textContent")) else: continue break time.sleep(3) assert len(L) == 1 payment_due_amount_number = float("{0:.1f}".format( float(re.sub("[^\d\.]", "", L[0])))) assert payment_due_amount_number == amount_tracked
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
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_327(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 = ChannelPage() page.open() page.add_channel_button.click() time.sleep(5) NewChannelName = ("AutoTestNameOnly_" + ''.join(choice(digits) for i in range(3))) page.channel_name.send_keys(NewChannelName) ChannelNameList.append(NewChannelName) page.save_button.click() time.sleep(5) page.search_field.send_keys(NewChannelName) time.sleep(2) assert page.table_channel_name.get_attribute('textContent') == ' ('+''.join(NewChannelName)+')' assert page.table_channel_comission.get_attribute('textContent') == '' #FAILED FOR PERCENTAGE - Bug 3110 assert page.table_channel_phonenumber.get_attribute('textContent') == '' assert page.table_channel_email.get_attribute('textContent') == '' page.table_channel_editbutton.click() time.sleep(5) assert page.channel_name.get_attribute('value') == NewChannelName assert page.status_checkbox.is_selected() == True page.cancel_button.click() time.sleep(7) 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('1') 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, 10)) minutes_values = ('00', '15', '30', '45') EventTimeMinutes = random.choice(minutes_values) timeday = random.choice(('AM', 'PM')) EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' + ''.join(timeday) + ' ' + ''.join( ActivityTimezone)) 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(NewChannelName) assert select.first_selected_option.text == NewChannelName
def test_213(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 = ChannelPage() page.open() page.add_channel_button.click() time.sleep(5) NewUserName = ("AutoTest_" + ''.join(choice(digits) for i in range(4))) page.username_field.send_keys(NewUserName) NewUserPassword = ('' + ''.join(choice(digits) for i in range(8)) + 'qwer') page.password_field.send_keys(NewUserPassword) NewChannelName = ("AutoTest_" + ''.join(choice(digits) for i in range(3))) ChannelNameList.append(NewChannelName) page.channel_name.send_keys(NewChannelName) first_names = ('Ivan', 'Peter', 'John', 'Bill', 'Michael', 'Sidor', 'Alex', 'James') NewFirstName = random.choice(first_names) page.first_name_field.send_keys(NewFirstName) last_names = ('Smith', 'Baker', 'Petroff', 'Smirnoff', 'Black', 'White', 'Broun', 'Ivanoff') NewLastName = random.choice(last_names) ChannelFirstLastNameList.append(NewFirstName + ' ' + ''.join(NewLastName)) page.last_name_field.send_keys(NewLastName) NewHouseNumber = '2345' page.house_number_field.send_keys(NewHouseNumber) NewStreet = 'Main Street' page.street_field.send_keys(NewStreet) select = Select(page.country_list) NewCountry = 'United States' select.select_by_visible_text(NewCountry) time.sleep(5) select = Select(page.state_list) NewState = 'Florida' select.select_by_visible_text(NewState) NewCity = "Miami" page.city_field.send_keys(NewCity) NewZipCode = '56788' page.zip_code.send_keys(NewZipCode) NewPhone1 = ('' + ''.join(choice(digits) for i in range(10))) page.phone1_field.send_keys(NewPhone1) NewPhone2 = ('' + ''.join(choice(digits) for i in range(10))) page.phone2_field.send_keys(NewPhone2) NewEmail = ('' + ''.join(choice(digits) for i in range(10)) + '@mailinator.com') page.email_field.send_keys(NewEmail) select = Select(page.comission_type_list) NewComissionType = 'Percentage' select.select_by_visible_text(NewComissionType) NewComissionAmount = '15' page.comission_amount.send_keys(NewComissionAmount) NewBankName = 'BSB' page.bank_name_field.send_keys(NewBankName) select = Select(page.bank_account_type) NewAccountType = 'Savings' select.select_by_visible_text(NewAccountType) NewRoutingNumber = ('' + ''.join(choice(digits) for i in range(10))) page.routing_number_field.send_keys(NewRoutingNumber) NewAccountNumber = ('' + ''.join(choice(digits) for i in range(10))) page.account_number_field.send_keys(NewAccountNumber) page.save_button.click() time.sleep(5) page.search_field.send_keys(NewChannelName) time.sleep(2) assert page.table_channel_name.get_attribute( 'textContent') == NewFirstName + ' ' + ''.join( NewLastName) + ' (' + ''.join(NewChannelName) + ')' assert page.table_channel_comission.get_attribute( 'textContent') == NewComissionAmount + '%' assert page.table_channel_phonenumber.get_attribute( 'textContent') == NewPhone1 assert page.table_channel_email.get_attribute( 'textContent') == NewEmail page.table_channel_editbutton.click() time.sleep(5) assert page.username_field.get_attribute('value') == NewUserName assert page.channel_name.get_attribute('value') == NewChannelName assert page.first_name_field.get_attribute('value') == NewFirstName assert page.last_name_field.get_attribute('value') == NewLastName assert page.house_number_field.get_attribute('value') == NewHouseNumber assert page.street_field.get_attribute('value') == NewStreet select = Select(page.country_list) assert select.first_selected_option.text == NewCountry select = Select(page.state_list) assert select.first_selected_option.text == NewState assert page.city_field.get_attribute('value') == NewCity assert page.zip_code.get_attribute('value') == NewZipCode assert page.phone1_field.get_attribute('value') == NewPhone1 assert page.phone2_field.get_attribute('value') == NewPhone2 assert page.email_field.get_attribute('value') == NewEmail select = Select(page.comission_type_list) assert select.first_selected_option.text == NewComissionType assert page.bank_name_field.get_attribute('value') == NewBankName select = Select(page.bank_account_type) assert select.first_selected_option.text == NewAccountType assert page.routing_number_field.get_attribute( 'value') == NewRoutingNumber assert page.account_number_field.get_attribute( 'value') == NewAccountNumber assert page.status_checkbox.is_selected() == True page.cancel_button.click() time.sleep(7) 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('1') 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, 10)) minutes_values = ('00', '15', '30', '45') EventTimeMinutes = random.choice(minutes_values) timeday = random.choice(('AM', 'PM')) EventTimeWithZone = (EventTimeHours + ':' + ''.join(EventTimeMinutes) + ' ' + ''.join(timeday) + ' ' + ''.join(ActivityTimezone)) 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(NewChannelName) assert select.first_selected_option.text == NewChannelName
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_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 __init__(self, env, parent=None): """ Build the main window. """ QtGui.QWidget.__init__(self, parent) self.env = env self.env.main_window = self # Set title and layout for the main_window. self.setWindowTitle('Database Viewer') grid = QtGui.QGridLayout() # Add a frame to group all plot related gui elements. self.plotFrame = QtGui.QGroupBox() # XXX: This style sheet results in very flickery graphics...i have no # idea why that would happen. #self.plotFrame.setStyleSheet('border:1px solid #AAAAAA;') self.plotFrameLayout = QtGui.QVBoxLayout() self.plotFrameLayout.setMargin(1) self.plotFrame.setLayout(self.plotFrameLayout) grid.addWidget(self.plotFrame, 0, 0, 12, 8) # Add plot status bar. Needs to be done before initializing the # Waveform class. self.plotStatus = QtGui.QLabel(' ') self.plotStatus.setStyleSheet('border:0px;') font = QtGui.QFont() font.setPointSize(9) # Add the waveform viewer. self.waveforms = Waveforms(env=self.env) self.plotFrameLayout.addWidget(self.waveforms) # Add navigation widget. self.navigation = NavigationBar(env=self.env) #self.plotControlLayout.addWidget(self.navigation) self.plotFrameLayout.addWidget(self.navigation) self.plotStatus.setFont(font) self.plotFrameLayout.addWidget(self.plotStatus) # Add the menu for the time_selection. times = QtGui.QGroupBox('Timeframe') grid.addWidget(times, 0, 8, 1, 2) # Time frame layout. time_layout = QtGui.QGridLayout() # Labels. start_label = QtGui.QLabel('Starttime:') time_layout.addWidget(start_label, 0, 0) end_label = QtGui.QLabel('Endtime:') time_layout.addWidget(end_label, 1, 0) # Init date selector. self.start_date = QtGui.QDateTimeEdit(utils.toQDateTime(self.env.starttime)) self.start_date.setCalendarPopup(True) time_layout.addWidget(self.start_date, 0, 1) self.end_date = QtGui.QDateTimeEdit(utils.toQDateTime(self.env.endtime)) self.end_date.setCalendarPopup(True) time_layout.addWidget(self.end_date, 1, 1) self.time_button = QtGui.QPushButton('Apply') time_layout.addWidget(self.time_button, 2, 1) times.setLayout(time_layout) QtCore.QObject.connect(self.time_button, QtCore.SIGNAL("clicked()"), self.applyTimes) # Add the pick group box. self.picks = Picks(env=self.env) grid.addWidget(self.picks, 1, 8, 1, 2) # Add the network tree. self.nw_tree = NetworkTree(self.waveforms, env=self.env) grid.addWidget(self.nw_tree, 2, 8, 9, 2) # Add the edit lists button. self.channelListFrame = QtGui.QFrame() self.horizontalChannelListLayout = QtGui.QHBoxLayout() self.horizontalChannelListLayout.setMargin(0) self.channelListFrame.setLayout(self.horizontalChannelListLayout) self.editChannelListsButton = QtGui.QPushButton('Edit Groups') self.loadEventsButton = QtGui.QPushButton('Load events') spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalChannelListLayout.addWidget(self.loadEventsButton) self.horizontalChannelListLayout.addItem(spacerItem) self.horizontalChannelListLayout.addWidget(self.editChannelListsButton) grid.addWidget(self.channelListFrame, 11, 8, 1, 2) QtCore.QObject.connect(self.editChannelListsButton, QtCore.SIGNAL("clicked()"), self.callEditChannelListDialog) QtCore.QObject.connect(self.loadEventsButton, QtCore.SIGNAL("clicked()"), self.loadEvents) # Set the layout and therefore display everything. self.setLayout(grid)