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_124(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.add_location_button.click()
     page = AddStartingLocationPage()
     OldLocationNamePart = "AutoTestLoc"
     page.search_location.send_keys(OldLocationNamePart)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if OldLocationNamePart in page.location_links[i].get_attribute(
                 "textContent"):
             if page.location_links[i].is_displayed():
                 page.location_links[i].click()
     page = AddStartingLocationPage()
     ExistedLocationName = page.location_name.get_attribute('value')
     get_driver().back()
     page.location_name.send_keys(ExistedLocationName)
     time.sleep(4)
     assert page.is_element_present('alert_message') == True
     assert page.save_button.is_enabled() == False
Ejemplo n.º 3
0
 def test_728(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.add_location_button.click()
     page = AddStartingLocationPage()
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     select = Select(page.location_state)
     time.sleep(3)
     select.select_by_visible_text('Florida')
     page.location_zipcode.send_keys('54321')
     State = select.first_selected_option.text
     Zip = page.location_zipcode.get_attribute('value')
     select = Select(page.location_Country)
     select.select_by_visible_text('Canada')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('Mexico')
     time.sleep(3)
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
Ejemplo n.º 4
0
 def test_116(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()
     activity_partnames = ('AutoTest', 'test1', '3110', '25102017',
                           'TESTEDIT', 'REGRESSION', 'Regr')
     activity_partname = random.choice(activity_partnames)
     page.search_activity_field.send_keys(activity_partname)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     ActivityName = page.activity_name.get_attribute('value')
     page.ticket_maximum.clear()
     page.ticket_maximum.send_keys('50')
     page.ticket_minimum.clear()
     page.ticket_minimum.send_keys('51')
     page.ticket_maximum.click()
     assert page.ticket_maximum.get_attribute('value') == '50'
     assert page.ticket_minimum.get_attribute('value') == '51'
     time.sleep(5)
     assert page.is_element_present('ticket_maximum_alert') == True
     assert page.ticket_maximum_alert.is_displayed()
     page.save_button.click()
     time.sleep(5)
     assert page.ticket_maximum_alert.is_displayed()
     page.ticket_maximum.clear()
     page.ticket_maximum.send_keys('10')
     page.ticket_minimum.clear()
     page.ticket_minimum.send_keys('9')
     assert page.ticket_maximum.get_attribute('value') == '10'
     assert page.ticket_minimum.get_attribute('value') == '9'
     time.sleep(5)
     assert page.is_element_present('ticket_maximum_alert') == False
     page.save_button.click()
     page.save_button.click()
     time.sleep(5)
     page = ActivityHubPage()
     get_driver().refresh()
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.ticket_maximum.get_attribute('value') == '10'
     assert page.ticket_minimum.get_attribute('value') == '9'
     assert page.is_element_present('ticket_maximum_alert') == False
Ejemplo n.º 5
0
 def test_121(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.show_inactive.click()
     page.search_activity_field.send_keys('TestEdit')
     ExistedActivityName = page.activity_title.get_attribute("textContent")
     page.add_activity_button.click()
     time.sleep(10)
     page = AddEditActivityPage()
     page.activity_name.send_keys(ExistedActivityName)
     page.activity_url.click()
     time.sleep(5)
     assert page.is_element_present('alert_message') == True
     select = Select(page.activity_status)
     NewActivityStatus = "Active"
     select.select_by_visible_text(NewActivityStatus)
     select = Select(page.branch)
     NewActivityBranch = "First branch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Hotel California"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Central"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityCancellationPolicy = 'We can cancel an event any time we want.'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivityDurationDays = '0'
     page.activity_duration_days.send_keys(NewActivityDurationDays)
     NewActivityDurationHours = '2'
     page.activity_duration_hours.send_keys(NewActivityDurationHours)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "1h 30 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityFirstTicketType = "Adult"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '9.99'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     page.save_button.click()
     time.sleep(5)
     assert page.is_element_present(
         'alert_message') == True  #failed - bug 2432
     assert get_driver().current_url == page.url  #failed - bug 2432
Ejemplo n.º 6
0
 def test_314(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()
     activity_partnames = ('test1', '3110', '25102017', 'TESTEDIT', 'REGRESSION', 'Regr')
     activity_partname = random.choice(activity_partnames)
     page.search_activity_field.send_keys(activity_partname)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     ActivityName = page.activity_name.get_attribute('value')
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys('-100')
     assert page.first_ticket_price.get_attribute('value')=='100'
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys('abc')
     assert page.first_ticket_price.get_attribute('value')==''
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys('0.01')
     assert page.first_ticket_price.get_attribute('value')=='0.01'
     page.save_button.click()
     time.sleep(5)
     page = ActivityHubPage()
     get_driver().refresh()
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.first_ticket_price.get_attribute('value') == '0.01'
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys('0.9')
     assert page.first_ticket_price.get_attribute('value') == '0.9'
     page.save_button.click()
     time.sleep(5)
     page = ActivityHubPage()
     get_driver().refresh()
     page.search_activity_field.send_keys(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.first_ticket_price.get_attribute('value') == '0.9'
Ejemplo n.º 7
0
 def test_510(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(Activity1)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.is_element_present('remove_fourth_linked_activity') == True:
         page.remove_fourth_linked_activity.click()
     if page.is_element_present('remove_third_linked_activity') == True:
         page.remove_third_linked_activity.click()
     if page.is_element_present('remove_second_linked_activity') == True:
         page.remove_second_linked_activity.click()
     if page.is_element_present('remove_first_linked_activity') == True:
         page.remove_first_linked_activity.click()
     time.sleep(7)
     select = Select(page.first_linked_activity)
     time.sleep(5)
     select.select_by_visible_text(Activity2)
     page.save_button.click()
     page = ActivityHubPage()
     page.search_activity_field.send_keys(Activity1)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity2
     page.cancel_button.click()
     page = ActivityHubPage()
     page.search_activity_field.send_keys(Activity2)
     time.sleep(5)
     text = page.activity_title.get_attribute("textContent")
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
 def test_729(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.add_location_button.click()
     page = AddStartingLocationPage()
     page.search_location.send_keys('Chris Falvey')
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if page.location_links[i].is_displayed():
             page.location_links[i].click()
     page = AddStartingLocationPage()
     select = Select(page.location_state)
     State = select.first_selected_option.text
     Zip = page.location_zipcode.get_attribute('value')
     select = Select(page.location_Country)
     select.select_by_visible_text('Canada')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('Mexico')
     time.sleep(3)
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
Ejemplo n.º 9
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
Ejemplo n.º 10
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_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
Ejemplo n.º 12
0
 def test_599(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() #STEP1
     page.open()
     page.add_activity_button.click()#STEP2
     page=AddEditActivityPage()
     time.sleep(15)
     for i in range(0, len(page.switchers1)):#STEP3
         if page.switchers1[i].get_attribute("outerHTML") != switcher_OFF:
             page.switchers1[i].click()
         else:
             continue
     for i in range(0, len(page.switchers2)):
         if page.switchers2[i].get_attribute("outerHTML") != switcher_OFF:
             page.switchers2[i].click()
         else:
             continue
     if page.switcher_minimum_enforce.get_attribute("outerHTML") != switcher_OFF:
         page.switcher_minimum_enforce.click()
     NewActivityName = ("AutoTestMinAlert" + ''.join(choice(digits) for i in range(4)))
     page.activity_name.send_keys(NewActivityName)
     NewActivityURL = ("http://" + NewActivityName + '.com')
     page.activity_url.send_keys(NewActivityURL)
     select = Select(page.activity_status)
     NewActivityStatus = "Inactive"
     select.select_by_visible_text(NewActivityStatus)
     select = Select(page.branch)
     NewActivityBranch = "HA Branch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Chris Falvey's Place"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Hawaii"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityDesription = 'This activity has been edited'
     page.activity_description.send_keys(NewActivityDesription)
     NewActivityCancellationPolicy = 'We can not cancel event'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivitySalesTax = '15'
     page.sales_tax.send_keys(NewActivitySalesTax)
     NewActivityDurationDays = '0'
     page.activity_duration_days.send_keys(NewActivityDurationDays)
     NewActivityDurationHours = '2'
     page.activity_duration_hours.send_keys(NewActivityDurationHours)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     select = Select(page.activity_color)
     NewActivityColor = "Water"
     select.select_by_visible_text(NewActivityColor)
     NewActivityMaxTickets = '99'
     page.ticket_maximum.send_keys(NewActivityMaxTickets)
     page.sell_out_alert.click()
     select = Select(page.sell_out_alert)
     NewActivitySellOut = "90%"
     select.select_by_visible_text(NewActivitySellOut)
     page.alert_guide_upon_sellout.click()
     select = Select(page.alert_guide_upon_sellout)
     NewActivityGuideUponSellout = "Yes"
     select.select_by_visible_text(NewActivityGuideUponSellout)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "2 h 00 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityMinTickets = '2'
     page.ticket_minimum.send_keys(NewActivityMinTickets)
     NewActivityStopbookingNoSales = '2'
     page.stop_no_sales.send_keys(NewActivityStopbookingNoSales)
     NewActivityFirstTicketType = "Child"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '12.59'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     select = Select(page.first_guide)
     NewActivityFirstGuide = "Joseph Super"
     select.select_by_visible_text(NewActivityFirstGuide)
     select = Select(page.first_linked_activity)
     NewActivityLinked = "Test AT"
     select.select_by_visible_text(NewActivityLinked)
     NewActivityWhatIncluded = 'Nothing.'
     page.what_included.send_keys(NewActivityWhatIncluded)
     NewActivityWhatKnow = 'You should know all'
     page.what_know.send_keys(NewActivityWhatKnow)
     NewActivityWhatBring = 'Drink and eat'
     page.what_bring.send_keys(NewActivityWhatBring)
     select = Select(page.review_redirect)
     NewActivityStarsReview = "4 Stars"
     select.select_by_visible_text(NewActivityStarsReview)
     page.review_website.send_keys(NewActivityURL)
     page.minimum_not_met_alert.send_keys('-1')#STEP4
     page.ticket_minimum.click()
     assert page.minimum_not_met_alert.get_attribute('value')=='0'
     page.minimum_not_met_alert.clear()#STEP5
     page.minimum_not_met_alert.send_keys('10000001')
     page.ticket_minimum.click()
     assert page.minimum_not_met_alert.get_attribute('value')=='100'
     page.minimum_not_met_alert.clear()#STEP6
     page.minimum_not_met_alert.send_keys('1')
     page.ticket_minimum.click()
     assert page.minimum_not_met_alert.get_attribute('value')=='1'
     page.save_button.click()
     page = ActivityHubPage()#STEP7
     time.sleep(5)
     page.show_inactive.click()
     time.sleep(10)
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     time.sleep(5)
     page = AddEditActivityPage()
     assert page.minimum_not_met_alert.get_attribute('value') == '1'
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)#STEP8
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 activity_alert_minimumnotmet_hours, activity_name FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[0] == 1
     assert row[1] == NewActivityName
 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
Ejemplo n.º 14
0
 def test_84(self):
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.show_inactive.click()
     time.sleep(10)
     page.search_activity_field.send_keys(ActivityNameList[1])
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page=AddEditActivityPage()
     time.sleep(15)
     OldActivityName = page.activity_name.get_attribute('value')
     OldActivityURL = page.activity_url.get_attribute('value')
     select = Select(page.activity_status)
     OldActivityStatus = select.first_selected_option.text
     select = Select(page.time_zone)
     OldActivityTimezone = select.first_selected_option.text
     select = Select(page.branch)
     OldActivityBranch = select.first_selected_option.text
     select = Select(page.starting_location)
     OldActivityLocation = select.first_selected_option.text
     OldActivityDesription = page.activity_description.get_attribute('value')
     OldActivityCancellationPolicy = page.cancellation_policy.get_attribute('value')
     OldActivitySalesTax = page.sales_tax.get_attribute('value')
     OldActivityDurationDays = page.activity_duration_days.get_attribute('value')
     OldActivityDurationHours = page.activity_duration_hours.get_attribute('value')
     OldActivityDurationMinutes = page.activity_duration_minutes.get_attribute('value')
     select = Select(page.activity_color)
     OldActivityColor = select.first_selected_option.text
     OldActivityMaxTickets = page.ticket_maximum.get_attribute('value')
     select = Select(page.sell_out_alert)
     OldActivitySellOut = select.first_selected_option.text
     select = Select(page.alert_guide_upon_sellout)
     OldActivityGuideUponSellout = select.first_selected_option.text
     select = Select(page.stop_booking_sold)
     OldActivityStopbookingSold = select.first_selected_option.text
     OldActivityMinTickets = page.ticket_minimum.get_attribute('value')
     OldActivityNotmetAlert = page.minimum_not_met_alert.get_attribute('value')
     OldActivityStopbookingNoSales = page.stop_no_sales.get_attribute('value')
     OldActivityFirstTicketType = page.first_ticket_type.get_attribute('value')
     OldActivityFirstTicketPrice = page.first_ticket_price.get_attribute('value')
     select = Select(page.first_guide)
     OldActivityFirstGuide = select.first_selected_option.text
     select = Select(page.first_linked_activity)
     OldActivityLinked = select.first_selected_option.text
     OldActivityWhatIncluded = page.what_included.get_attribute('value')
     OldActivityWhatKnow = page.what_know.get_attribute('value')
     OldActivityWhatBring = page.what_bring.get_attribute('value')
     select = Select(page.review_redirect)
     OldActivityStarsReview = select.first_selected_option.text
     OldReviewURL = page.review_website.get_attribute('value')
     select = Select(page.first_ticket_viator)
     OldActivityFirstViatorType = select.first_selected_option.text
     OldActivityName = page.activity_name.get_attribute('value')
     for i in range(0, len(page.switchers1)):
         if page.switchers1[i].get_attribute("outerHTML") == switcher_OFF:
             page.switchers1[i].click()
         else:
             continue
     for i in range(0, len(page.switchers2)):
         if page.switchers2[i].get_attribute("outerHTML") == switcher_OFF:
             page.switchers2[i].click()
         else:
             continue
     if page.switcher_minimum_enforce.get_attribute("outerHTML") == switcher_OFF:
         page.switcher_minimum_enforce.click()
     NewActivityName = ("NoEdit"+''.join(choice(digits) for i in range(4)))
     page.activity_name.clear()
     page.activity_name.send_keys(NewActivityName)
     NewActivityURL = ("http://"+NewActivityName+'.com')
     page.activity_url.clear()
     page.activity_url.send_keys(NewActivityURL)
     select = Select(page.activity_status)
     NewActivityStatus = "Private Party"
     select.select_by_visible_text(NewActivityStatus )
     select = Select(page.time_zone)
     NewActivityTimezone = "Alaska"
     select.select_by_visible_text(NewActivityTimezone)
     select = Select(page.branch)
     NewActivityBranch = "Nealon Branch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Bud Rip's"
     select.select_by_visible_text(NewActivityLocation)
     NewActivityDesription = 'This activity has been edited CANCEL'
     page.activity_description.clear()
     page.activity_description.send_keys(NewActivityDesription)
     NewActivityCancellationPolicy = 'We can not cancel event CANCEL'
     page.cancellation_policy.clear()
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivitySalesTax = '84'
     page.sales_tax.clear()
     page.sales_tax.send_keys(NewActivitySalesTax)
     NewActivityDurationDays = '2'
     page.activity_duration_days.clear()
     page.activity_duration_days.send_keys(NewActivityDurationDays)
     NewActivityDurationHours = '16'
     page.activity_duration_hours.clear()
     page.activity_duration_hours.send_keys(NewActivityDurationHours)
     NewActivityDurationMinutes = '45'
     page.activity_duration_minutes.clear()
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     select = Select(page.activity_color)
     NewActivityColor = "Topaz"
     select.select_by_visible_text(NewActivityColor)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '343'
     page.ticket_maximum.send_keys(NewActivityMaxTickets)
     select = Select(page.sell_out_alert)
     NewActivitySellOut = "60%"
     select.select_by_visible_text(NewActivitySellOut)
     select = Select(page.alert_guide_upon_sellout)
     NewActivityGuideUponSellout = "No"
     select.select_by_visible_text(NewActivityGuideUponSellout)
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "10h 30 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityMinTickets = '23'
     page.ticket_minimum.clear()
     page.ticket_minimum.send_keys(NewActivityMinTickets)
     NewActivityNotmetAlert = '5'
     page.minimum_not_met_alert.clear()
     page.minimum_not_met_alert.send_keys(NewActivityNotmetAlert)
     NewActivityFirstTicketType = "Senior"
     page.first_ticket_type.clear()
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '111.11'
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     select = Select(page.first_ticket_viator)
     NewActivityFirstViatorType = "Infant"
     select.select_by_visible_text(NewActivityFirstViatorType)
     select = Select(page.first_guide)
     NewActivityFirstGuide = "Peter Petrov"
     select.select_by_visible_text(NewActivityFirstGuide)
     select = Select(page.first_linked_activity)
     NewActivityLinked = "Test MT Time"
     select.select_by_visible_text(NewActivityLinked)
     NewActivityWhatIncluded = 'All INCLUDED.'
     page.what_included.clear()
     page.what_included.send_keys(NewActivityWhatIncluded)
     NewActivityWhatKnow = 'CANCEL BUTTON CHECK'
     page.what_know.clear()
     page.what_know.send_keys(NewActivityWhatKnow)
     NewActivityWhatBring = 'NOTHING'
     page.what_bring.clear()
     page.what_bring.send_keys(NewActivityWhatBring)
     select = Select(page.review_redirect)
     NewActivityStarsReview = "3 Stars"
     select.select_by_visible_text(NewActivityStarsReview)
     NewReviewURL = 'http://tut.by'
     page.review_website.clear()
     page.review_website.send_keys(NewReviewURL)
     page.cancel_button.click()
     page = ActivityHubPage()
     page.show_inactive.click()
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     assert page.is_element_present('activity_actions') == False
     get_driver().refresh()
     time.sleep(5)
     page.show_inactive.click()
     time.sleep(10)
     page.search_activity_field.send_keys(OldActivityName)
     time.sleep(5)
     page.activity_actions.click()
     text = page.activity_title.get_attribute("textContent")
     assert text == OldActivityName
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.activity_name.get_attribute('value') == OldActivityName
     assert page.activity_url.get_attribute('value')== OldActivityURL
     select = Select(page.activity_status)
     assert select.first_selected_option.text == OldActivityStatus
     select = Select(page.branch)
     assert select.first_selected_option.text == OldActivityBranch
     select = Select(page.starting_location)
     assert select.first_selected_option.text == OldActivityLocation
     select = Select(page.time_zone)
     assert select.first_selected_option.text == OldActivityTimezone
     assert page.activity_description.get_attribute('value') == OldActivityDesription
     assert page.cancellation_policy.get_attribute('value') == OldActivityCancellationPolicy
     assert page.sales_tax.get_attribute('value') == OldActivitySalesTax
     assert page.activity_duration_days.get_attribute('value') == OldActivityDurationDays
     assert page.activity_duration_hours.get_attribute('value') == OldActivityDurationHours
     assert page.activity_duration_minutes.get_attribute('value') == OldActivityDurationMinutes
     select = Select(page.activity_color)
     assert select.first_selected_option.text == OldActivityColor
     assert page.ticket_maximum.get_attribute('value') == OldActivityMaxTickets
     select = Select(page.sell_out_alert)
     assert select.first_selected_option.text == OldActivitySellOut
     select = Select(page.alert_guide_upon_sellout)
     assert select.first_selected_option.text == OldActivityGuideUponSellout
     select = Select(page.stop_booking_sold)
     assert select.first_selected_option.text == OldActivityStopbookingSold
     assert page.ticket_minimum.get_attribute('value') == OldActivityMinTickets
     assert page.minimum_not_met_alert.get_attribute('value') == OldActivityNotmetAlert
     assert page.stop_no_sales.get_attribute('value') == OldActivityStopbookingNoSales
     assert page.first_ticket_type.get_attribute('value') == OldActivityFirstTicketType
     assert page.first_ticket_price.get_attribute('value') == OldActivityFirstTicketPrice
     select = Select(page.first_guide)
     assert select.first_selected_option.text == OldActivityFirstGuide
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == OldActivityLinked
     assert page.what_included.get_attribute('value') == OldActivityWhatIncluded
     assert page.what_know.get_attribute('value') == OldActivityWhatKnow
     assert page.what_bring.get_attribute('value') == OldActivityWhatBring
     select = Select(page.review_redirect)
     assert select.first_selected_option.text == OldActivityStarsReview
     assert page.review_website.get_attribute('value') == OldReviewURL
     for i in range(0, len(page.switchers1)):
          assert page.switchers1[i].get_attribute("outerHTML") == switcher_OFF
     for i in range(0, len(page.switchers2)):
          assert page.switchers2[i].get_attribute("outerHTML") == switcher_OFF
     assert page.switcher_minimum_enforce.get_attribute("outerHTML") == switcher_OFF
     select = Select(page.first_ticket_viator)
     assert select.first_selected_option.text == OldActivityFirstViatorType
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)#STEP8
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 * FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[0] == ActivityIDList[0]
     assert row[1] == 68#company id
     assert row[2] == 20#location_id
     assert row[3] == 524#branch_id
     assert row[4] == 6 #timezone_id
     assert row[5] == 3  #color_id
     assert row[6] == OldActivityName
     assert row[7] == OldActivityDesription
     assert row[8] == OldActivityWhatKnow
     assert row[9] == OldActivityWhatBring
     assert row[10] == OldActivityWhatIncluded
     assert row[11] == OldActivityCancellationPolicy
     assert row[12] == OldActivityURL
     assert row[14] == 0#Firstsalecloseevent
     assert row[15] == 2  # StopBookingNoSales
     assert row[16] == 120  # StopBookingSold
     assert row[17] == 0  # StopBookingMidBefore
     assert (int(row[19])) == 90
     assert row[20] == int(OldActivityNotmetAlert)
     assert row[21] == 1665 #Duration
     assert row[22] == int(OldActivityMinTickets)
     assert row[23] == int(OldActivityMaxTickets)
     assert (int(row[25])) == 15
     assert row[27] == 4
     assert row[28] == OldActivityURL
     assert row[32] == True #GuideUponSellout
     assert row[33]==0 #ActivityStatus
     assert row[36] == 0 #Tickets Minimum Enforce
     assert row[37] == 0  # Viator
     assert row[39] == 0  # 2-step Check In
 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")
 def test_81(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.add_activity_button.click()
     page = AddEditActivityPage()
     time.sleep(5)
     NewActivityName = ("AutoTest81_" +
                        ''.join(choice(digits) for i in range(4)))
     ActivityNameList.append(NewActivityName)
     page.activity_name.send_keys(NewActivityName)
     select = Select(page.activity_status)
     NewActivityStatus = "Active"
     select.select_by_visible_text(NewActivityStatus)
     select = Select(page.branch)
     NewActivityBranch = "AlexeyBranch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Hotel California"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Pacific"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityCancellationPolicy = 'We can cancel an event any time we want.'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '100'
     page.ticket_maximum.send_keys(NewActivityMaxTickets)
     NewActivityFirstTicketType = "Adult"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '9.99'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "15 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     page.save_button.click()
     time.sleep(5)
     page = ActivityHubPage()
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     page.activity_actions.click()
     text = page.activity_title.get_attribute("textContent")
     assert text == NewActivityName
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.activity_name.get_attribute('value') == NewActivityName
     select = Select(page.activity_status)
     assert select.first_selected_option.text == NewActivityStatus
     select = Select(page.branch)
     assert select.first_selected_option.text == NewActivityBranch
     select = Select(page.starting_location)
     assert select.first_selected_option.text == NewActivityLocation
     select = Select(page.time_zone)
     assert select.first_selected_option.text == NewActivityTimezone
     assert page.cancellation_policy.get_attribute(
         'value') == NewActivityCancellationPolicy
     assert page.activity_duration_minutes.get_attribute(
         'value') == NewActivityDurationMinutes
     assert page.ticket_maximum.get_attribute(
         'value') == NewActivityMaxTickets
     assert page.first_ticket_type.get_attribute(
         'value') == NewActivityFirstTicketType
     assert page.first_ticket_price.get_attribute(
         'value') == NewActivityFirstTicketPrice
     for i in range(0, len(page.switchers1)):
         assert page.switchers1[i].get_attribute(
             "outerHTML") == switcher_OFF
     for i in range(0, len(page.switchers2)):
         assert page.switchers2[i].get_attribute(
             "outerHTML") == switcher_OFF
     assert page.switcher_minimum_enforce.get_attribute(
         "outerHTML") == switcher_OFF
     select = Select(page.stop_booking_sold)
     assert select.first_selected_option.text == NewActivityStopbookingSold
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' +
         password)  #STEP8
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[1] == 68  #company id
     assert row[2] == 47  #location_id
     assert row[3] == 386  #branch_id
     assert row[4] == 9  #timezone_id
     assert row[6] == NewActivityName
     assert row[11] == NewActivityCancellationPolicy
     assert row[14] == 0  #Firstsalecloseevent
     assert row[15] == 0  # StopBookingNoSales
     assert row[16] == 15  # StopBookingSold
     assert row[17] == 0  # StopBookingMidBefore
     assert row[21] == 15  #Duration
     assert row[32] == True  #GuideUponSellout
     assert row[33] == 1  #ActivityStatus
     assert row[36] == 0  #Tickets Minimum Enforce
     assert row[37] == 0  # Viator
     assert row[39] == 0  # 2-step Check In
 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
Ejemplo n.º 18
0
 def test_519(self):
     page = ActivityHubPage()  #STEP1
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity3)  #STEP2
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     page.remove_third_linked_activity.click()  #STEP3
     page.remove_second_linked_activity.click()
     page.remove_first_linked_activity.click()
     assert page.is_element_present('third_linked_activity') == False
     assert page.is_element_present('second_linked_activity') == False
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == '-- Select Activity --'
     page.save_button.click()  #STEP4
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity1)  # STEP5
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity4
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == '-- Select Activity --'
     page.cancel_button.click()  # STEP6
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity2)  # STEP7
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity4
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == '-- Select Activity --'
     page.cancel_button.click()  # STEP8
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity3)  # STEP9
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == '-- Select Activity --'
     assert page.is_element_present('second_linked_activity') == False
     assert page.is_element_present('third_linked_activity') == False
     page.cancel_button.click()  # STEP10
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity4)  # STEP7
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == '-- Select Activity --'
Ejemplo n.º 19
0
 def test_512(self):
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity3)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.is_element_present('remove_fourth_linked_activity') == True:
         page.remove_fourth_linked_activity.click()
     if page.is_element_present('remove_third_linked_activity') == True:
         page.remove_third_linked_activity.click()
     if page.is_element_present('remove_second_linked_activity') == True:
         page.remove_second_linked_activity.click()
     if page.is_element_present('remove_first_linked_activity') == True:
         page.remove_first_linked_activity.click()
         page.save_button.click()
     page = ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity4)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.is_element_present('remove_fourth_linked_activity') == True:
         page.remove_fourth_linked_activity.click()
     if page.is_element_present('remove_third_linked_activity') == True:
         page.remove_third_linked_activity.click()
     if page.is_element_present('remove_second_linked_activity') == True:
         page.remove_second_linked_activity.click()
     if page.is_element_present('remove_first_linked_activity') == True:
         page.remove_first_linked_activity.click()
         page.save_button.click()
     page = ActivityHubPage()  #STEP1
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity3)  #STEP2
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     time.sleep(5)
     select.select_by_visible_text(Activity4)  #STEP3
     page.save_button.click()
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity1)  #STEP4
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.second_linked_activity)  # STEP5
     time.sleep(5)
     select.select_by_visible_text(Activity4)
     actions = ActionChains(get_driver())
     actions.move_to_element(page.tooltip_linked_activity).perform()
     time.sleep(3)
     assert page.tooltip_linked_activity_msg.get_attribute('textContent') ==\
            "Activity '"+''.join(Activity4)+"' is linked with 1 other activity. After saving changes your activity will be linked to all activities already linked with '"+''.join(Activity4)+"'."
     page.save_button.click()  # STEP6
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity1)  # STEP7
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity3
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == Activity4
     page.cancel_button.click()  # STEP8
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity2)  # STEP9
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity3
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == Activity4
     page.cancel_button.click()  # STEP10
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity3)  # STEP11
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == Activity4
     page.cancel_button.click()  # STEP12
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(Activity4)  # STEP13
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == Activity1
     select = Select(page.second_linked_activity)
     assert select.first_selected_option.text == Activity2
     select = Select(page.third_linked_activity)
     assert select.first_selected_option.text == Activity3
Ejemplo n.º 20
0
 def test_83(self):
     page=ActivityHubPage()
     page.open()
     time.sleep(5)
     page.search_activity_field.send_keys(ActivityNameList[0])
     time.sleep(5)
     wait = WebDriverWait(get_driver(), 15)
     wait.until(lambda driver: page.is_element_present('activity_actions'))
     page.activity_actions.click()
     page.edit_activity.click()
     page=AddEditActivityPage()
     time.sleep(15)
     for i in range(0, len(page.switchers1)):
         if page.switchers1[i].get_attribute("outerHTML") != switcher_OFF:
             page.switchers1[i].click()
         else:
             continue
     for i in range(0, len(page.switchers2)):
         if page.switchers2[i].get_attribute("outerHTML") != switcher_OFF:
             page.switchers2[i].click()
         else:
             continue
     if page.switcher_minimum_enforce.get_attribute("outerHTML") != switcher_OFF:
         page.switcher_minimum_enforce.click()
     NewActivityName = ("TestEdit"+''.join(choice(digits) for i in range(4)))
     ActivityNameList.append(NewActivityName)
     page.activity_name.clear()
     page.activity_name.send_keys(NewActivityName)
     NewActivityURL = ("http://"+NewActivityName+'.com')
     page.activity_url.clear()
     page.activity_url.send_keys(NewActivityURL)
     select = Select(page.activity_status)
     NewActivityStatus = "Inactive"
     select.select_by_visible_text(NewActivityStatus )
     select = Select(page.branch)
     NewActivityBranch = "HA Branch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Chris Falvey's Place"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Hawaii"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityDesription = 'This activity has been edited'
     page.activity_description.clear()
     page.activity_description.send_keys(NewActivityDesription)
     NewActivityCancellationPolicy = 'We can not cancel event'
     page.cancellation_policy.clear()
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivitySalesTax = '15'
     page.sales_tax.clear()
     page.sales_tax.send_keys(NewActivitySalesTax)
     NewActivityDurationDays = '1'
     page.activity_duration_days.clear()
     page.activity_duration_days.send_keys(NewActivityDurationDays)
     NewActivityDurationHours = '3'
     page.activity_duration_hours.clear()
     page.activity_duration_hours.send_keys(NewActivityDurationHours)
     NewActivityDurationMinutes = '45'
     page.activity_duration_minutes.clear()
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     select = Select(page.activity_color)
     NewActivityColor = "Water"
     select.select_by_visible_text(NewActivityColor)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '99'
     page.ticket_maximum.send_keys(NewActivityMaxTickets )
     page.sell_out_alert.click()
     select = Select(page.sell_out_alert)
     NewActivitySellOutNumber = 90
     NewActivitySellOut = str(NewActivitySellOutNumber) + '%'
     select.select_by_visible_text(NewActivitySellOut)
     page.alert_guide_upon_sellout.click()
     select = Select(page.alert_guide_upon_sellout)
     NewActivityGuideUponSellout = "Yes"
     select.select_by_visible_text(NewActivityGuideUponSellout)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "2 h 00 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityMinTickets = '2'
     page.ticket_minimum.clear()
     page.ticket_minimum.send_keys(NewActivityMinTickets)
     NewActivityNotmetAlert = '1'
     page.minimum_not_met_alert.clear()
     page.minimum_not_met_alert.send_keys(NewActivityNotmetAlert)
     NewActivityStopbookingNoSales = '2'
     page.stop_no_sales.clear()
     page.stop_no_sales.send_keys(NewActivityStopbookingNoSales)
     NewActivityFirstTicketType = "Child"
     page.first_ticket_type.clear()
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '12.59'
     page.first_ticket_price.clear()
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     select = Select(page.first_guide)
     NewActivityFirstGuide = "Joseph Super"
     select.select_by_visible_text(NewActivityFirstGuide)
     select = Select(page.first_linked_activity)
     NewActivityLinked = "Test06122018"
     select.select_by_visible_text(NewActivityLinked)
     NewActivityWhatIncluded = 'Nothing.'
     page.what_included.clear()
     page.what_included.send_keys(NewActivityWhatIncluded)
     NewActivityWhatKnow = 'You should know all'
     page.what_know.clear()
     page.what_know.send_keys(NewActivityWhatKnow)
     NewActivityWhatBring = 'Drink and eat'
     page.what_bring.clear()
     page.what_bring.send_keys(NewActivityWhatBring )
     select = Select(page.review_redirect)
     NewActivityStarsReviewNumber = 4
     NewActivityStarsReview = str(str(NewActivityStarsReviewNumber)+' Stars')
     select.select_by_visible_text(NewActivityStarsReview)
     page.review_website.clear()
     page.review_website.send_keys(NewActivityURL)
     page.save_button.click()
     page = ActivityHubPage()
     time.sleep(5)
     page.show_inactive.click()
     time.sleep(10)
     page.search_activity_field.send_keys(ActivityNameList[1])
     time.sleep(5)
     text = page.activity_title.get_attribute("textContent")
     assert text == NewActivityName
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     for i in range(0, len(page.switchers1)):
          assert page.switchers1[i].get_attribute("outerHTML") == switcher_OFF
     for i in range(0, len(page.switchers2)):
          assert page.switchers2[i].get_attribute("outerHTML") == switcher_OFF
     assert page.switcher_minimum_enforce.get_attribute("outerHTML") == switcher_OFF
     assert page.activity_name.get_attribute('value') == NewActivityName
     assert page.activity_url.get_attribute('value')== NewActivityURL
     select = Select(page.activity_status)
     assert select.first_selected_option.text == NewActivityStatus
     select = Select(page.branch)
     assert select.first_selected_option.text == NewActivityBranch
     select = Select(page.starting_location)
     assert select.first_selected_option.text == NewActivityLocation
     select = Select(page.time_zone)
     assert select.first_selected_option.text == NewActivityTimezone
     assert page.activity_description.get_attribute('value') == NewActivityDesription
     assert page.cancellation_policy.get_attribute('value') == NewActivityCancellationPolicy
     assert page.sales_tax.get_attribute('value') == NewActivitySalesTax+' %'
     assert page.activity_duration_days.get_attribute('value') == NewActivityDurationDays
     assert page.activity_duration_hours.get_attribute('value') == NewActivityDurationHours
     assert page.activity_duration_minutes.get_attribute('value') == NewActivityDurationMinutes
     select = Select(page.activity_color)
     assert select.first_selected_option.text == NewActivityColor
     assert page.ticket_maximum.get_attribute('value') == NewActivityMaxTickets
     select = Select(page.sell_out_alert)
     assert select.first_selected_option.text == NewActivitySellOut
     select = Select(page.alert_guide_upon_sellout)
     assert select.first_selected_option.text == NewActivityGuideUponSellout
     select = Select(page.stop_booking_sold)
     assert select.first_selected_option.text == NewActivityStopbookingSold
     assert page.ticket_minimum.get_attribute('value') == NewActivityMinTickets
     assert page.minimum_not_met_alert.get_attribute('value') == NewActivityNotmetAlert
     assert page.stop_no_sales.get_attribute('value') == NewActivityStopbookingNoSales
     assert page.first_ticket_type.get_attribute('value') == NewActivityFirstTicketType
     assert page.first_ticket_price.get_attribute('value') == NewActivityFirstTicketPrice
     select = Select(page.first_guide)
     assert select.first_selected_option.text == NewActivityFirstGuide
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == NewActivityLinked
     assert page.what_included.get_attribute('value') == NewActivityWhatIncluded
     assert page.what_know.get_attribute('value') == NewActivityWhatKnow
     assert page.what_bring.get_attribute('value') == NewActivityWhatBring
     select = Select(page.review_redirect)
     assert select.first_selected_option.text == NewActivityStarsReview
     assert page.review_website.get_attribute('value') == NewActivityURL
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)#STEP8
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 * FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[0] == ActivityIDList[0]
     assert row[1] == 68#company id
     assert row[2] == 20#location_id
     assert row[3] == 524#branch_id
     assert row[4] == 6 #timezone_id
     assert row[5] == 3  #color_id
     assert row[6] == NewActivityName
     assert row[7] == NewActivityDesription
     assert row[8] == NewActivityWhatKnow
     assert row[9] == NewActivityWhatBring
     assert row[10] == NewActivityWhatIncluded
     assert row[11] == NewActivityCancellationPolicy
     assert row[12] == NewActivityURL
     assert row[14] == 0#Firstsalecloseevent
     assert row[15] == int(NewActivityStopbookingNoSales)  # StopBookingNoSales
     assert row[16] == 120  # StopBookingSold
     assert row[17] == 0  # StopBookingMidBefore
     assert (int(row[19])) == NewActivitySellOutNumber
     assert row[20] == int(NewActivityNotmetAlert)
     assert row[21] == 1665 #Duration
     assert row[22] == int(NewActivityMinTickets)
     assert row[23] == int(NewActivityMaxTickets)
     assert (int(row[25])) == int(NewActivitySalesTax)
     assert row[27] == int(NewActivityStarsReviewNumber)
     assert row[28] == NewActivityURL
     assert row[32] == True #GuideUponSellout
     assert row[33]==0 #ActivityStatus
     assert row[36] == 0 #Tickets Minimum Enforce
     assert row[37] == 0  # Viator
     assert row[39] == 0  # 2-step Check In
Ejemplo n.º 21
0
 def test_108(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.add_location_button.click()
     page = AddStartingLocationPage()
     OldLocationNamePart = "AutoTestLoc"
     page.search_location.send_keys(OldLocationNamePart)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if OldLocationNamePart in page.location_links[i].get_attribute("textContent"):
             if page.location_links[i].is_displayed():
                 page.location_links[i].click()
     page = AddStartingLocationPage()
     OldLocationName = page.location_name.get_attribute('value')
     OldLocationAddress1 = page.location_address_1.get_attribute('value')
     OldLocationAddress2 = page.location_address_2.get_attribute('value')
     select = Select(page.location_Country)
     OldLocationCountry = select.first_selected_option.text
     select = Select(page.location_state)
     OldLocationState = select.first_selected_option.text
     OldLocationCity = page.location_city.get_attribute('value')
     OldLocationZipcode = page.location_zipcode.get_attribute('value')
     OldLocationDescription = page.location_description.get_attribute('value')
     NewLocationName = ("ATLedit" + ''.join(choice(digits) for i in range(3)))
     page.location_name.send_keys(NewLocationName)
     NewLocationAddress1 = 'MAIN STREET'
     page.location_address_1.send_keys(NewLocationAddress1)
     NewLocationAddress2 = '10-123 1/2'
     page.location_address_2.send_keys(NewLocationAddress2)
     NewLocationCountry = "Canada"
     select = Select(page.location_Country)
     select.select_by_visible_text(NewLocationCountry)
     NewLocationState = "Quebec"
     select = Select(page.location_state)
     select.select_by_visible_text(NewLocationState)
     NewLocationCity = "Montreal"
     page.location_city.send_keys(NewLocationCity)
     NewLocationZipcode = "H3Z 2Y7"
     page.location_zipcode.send_keys(NewLocationZipcode)
     NewLocationDescription = "Edited location"
     page.location_description.clear()
     page.location_description.send_keys(NewLocationDescription)
     page.save_button.click()
     page.search_location.send_keys(NewLocationName)
     time.sleep(3)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if NewLocationName in page.location_links[i].get_attribute("textContent"):
             page.location_links[i].click()
     time.sleep(5)
     page = AddStartingLocationPage()
     assert page.location_name.get_attribute('value') == NewLocationName
     assert page.location_address_1.get_attribute('value') == NewLocationAddress1
     assert page.location_address_2.get_attribute('value') == NewLocationAddress2
     select = Select(page.location_Country)
     assert select.first_selected_option.text == NewLocationCountry
     select = Select(page.location_state)
     assert select.first_selected_option.text == NewLocationState
     assert page.location_city.get_attribute('value') == NewLocationCity
     assert page.location_zipcode.get_attribute('value') == NewLocationZipcode
     assert page.location_description.get_attribute('value') == NewLocationDescription
     page = ActivityHubPage()
     page.open()
     page.add_activity_button.click()
     page = AddEditActivityPage()
     time.sleep(10)
     select = Select(page.starting_location)
     select.select_by_visible_text(NewLocationName)
     assert select.first_selected_option.text == NewLocationName
Ejemplo n.º 22
0
 def test_115(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(ActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     if page.first_ticket_type.get_attribute('value') != FirstTicketType:
         page.first_ticket_type.clear()
         page.first_ticket_type.send_keys(FirstTicketType)
     if page.is_element_present('second_ticket_type') == False:
         page.add_ticket_type.click()
         page.second_ticket_type.send_keys(SecondTicketType)
         page.second_ticket_price.send_keys(NewActivitySecondTicketPrice)
     else:
         if page.second_ticket_type.get_attribute(
                 'value') != SecondTicketType:
             page.second_ticket_type.clear()
             page.second_ticket_type.send_keys(SecondTicketType)
             page.second_ticket_price.clear()
             page.second_ticket_price.send_keys(
                 NewActivitySecondTicketPrice)
     if page.is_element_present('third_ticket_type') == False:
         page.add_ticket_type.click()
         page.third_ticket_type.send_keys(ThirdTicketType)
         page.third_ticket_price.send_keys(NewActivityThirdTicketPrice)
     else:
         if page.third_ticket_type.get_attribute(
                 'value') != ThirdTicketType:
             page.third_ticket_type.clear()
             page.third_ticket_type.send_keys(ThirdTicketType)
             page.third_ticket_price.clear()
             page.third_ticket_price.send_keys(NewActivityThirdTicketPrice)
     if page.is_element_present('fourth_ticket_type') == False:
         page.add_ticket_type.click()
         page.fourth_ticket_type.send_keys(FourthTicketType)
         page.fourth_ticket_price.send_keys(NewActivityFourthTicketPrice)
     else:
         if page.fourth_ticket_type.get_attribute(
                 'value') != FourthTicketType:
             page.fourth_ticket_type.clear()
             page.fourth_ticket_type.send_keys(FourthTicketType)
             page.fourth_ticket_price.clear()
             page.fourth_ticket_price.send_keys(
                 NewActivityFourthTicketPrice)
     FirstTicketPrice = page.first_ticket_price.get_attribute('value')
     SecondTicketPrice = page.second_ticket_price.get_attribute('value')
     ThirdTicketPrice = page.third_ticket_price.get_attribute('value')
     FourthTicketPrice = page.fourth_ticket_price.get_attribute('value')
     page.delete_fourth_ticket_type.click()  #STEP3
     assert page.is_element_present('fourth_ticket_type') == False
     page.save_button.click()  #STEP4
     time.sleep(5)
     page = ActivityHubPage()
     page.search_activity_field.send_keys(ActivityName)  #STEP5
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.is_element_present('fourth_ticket_type') == False
     assert page.first_ticket_type.get_attribute('value') == FirstTicketType
     assert page.second_ticket_type.get_attribute(
         'value') == SecondTicketType
     assert page.third_ticket_type.get_attribute('value') == ThirdTicketType
     assert page.first_ticket_price.get_attribute(
         'value') == FirstTicketPrice
     assert page.second_ticket_price.get_attribute(
         'value') == SecondTicketPrice
     assert page.third_ticket_price.get_attribute(
         'value') == ThirdTicketPrice
     page.delete_third_ticket_type.click()  #STEP6
     page.delete_first_ticket_type.click()
     assert page.is_element_present('third_ticket_type') == False
     assert page.is_element_present('second_ticket_type') == False
     assert page.first_ticket_type.get_attribute(
         'value') == SecondTicketType
     assert page.first_ticket_price.get_attribute(
         'value') == SecondTicketPrice
     page.save_button.click()  # STEP7
     time.sleep(5)
     page = ActivityHubPage()
     page.search_activity_field.send_keys(ActivityName)  # STEP8
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.is_element_present('fourth_ticket_type') == False
     assert page.is_element_present('third_ticket_type') == False
     assert page.is_element_present('second_ticket_type') == False
     assert page.first_ticket_type.get_attribute(
         'value') == SecondTicketType
     assert page.first_ticket_price.get_attribute(
         'value') == SecondTicketPrice
     page.first_ticket_type.clear()  #STEP9
     page.first_ticket_price.clear()
     assert page.first_ticket_type.get_attribute('value') == ''
     assert page.first_ticket_price.get_attribute('value') == ''
     page.save_button.click()  #STEP10
     time.sleep(10)
     assert page.ticket_type_alert.is_displayed()
     assert page.ticket_price_alert.is_displayed()
Ejemplo n.º 23
0
 def test_82(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.add_activity_button.click()
     page=AddEditActivityPage()
     time.sleep(5)
     for i in range(0, len(page.switchers1)):
         page.switchers1[i].click()
     for i in range(0, len(page.switchers2)):
         page.switchers2[i].click()
     page.switcher_minimum_enforce.click()
     time.sleep(10)
     NewActivityName = ("AutoTest_"+''.join(choice(digits) for i in range(4)))
     ActivityNameList.append(NewActivityName)
     page.activity_name.send_keys(NewActivityName)
     NewActivityURL = ("http://"+NewActivityName+'.com')
     page.activity_url.send_keys(NewActivityURL)
     select = Select(page.activity_status)
     NewActivityStatus = "Active"
     select.select_by_visible_text(NewActivityStatus )
     select = Select(page.branch)
     NewActivityBranch = "AlexeyBranch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Hotel California"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Pacific"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityDesription = 'The activity is created automatically.'
     page.activity_description.send_keys(NewActivityDesription)
     NewActivityCancellationPolicy = 'We can cancel an event any time we want.'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivitySalesTax = '5'
     page.sales_tax.send_keys(NewActivitySalesTax)
     NewActivityDurationDays = '0'
     page.activity_duration_days.send_keys(NewActivityDurationDays)
     NewActivityDurationHours = '2'
     page.activity_duration_hours.send_keys(NewActivityDurationHours)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     select = Select(page.activity_color)
     NewActivityColor = "Alabaster"
     select.select_by_visible_text(NewActivityColor)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '100'
     page.ticket_maximum.send_keys(NewActivityMaxTickets )
     page.sell_out_alert.click()
     select = Select(page.sell_out_alert)
     NewActivitySellOutNumber = 80
     NewActivitySellOut = str(NewActivitySellOutNumber)+'%'
     select.select_by_visible_text(NewActivitySellOut)
     page.alert_guide_upon_sellout.click()
     select = Select(page.alert_guide_upon_sellout)
     NewActivityGuideUponSellout = "No"
     select.select_by_visible_text(NewActivityGuideUponSellout)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "1h 30 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityMinTickets = '20'
     page.ticket_minimum.send_keys(NewActivityMinTickets)
     NewActivityNotmetAlert = '10'
     page.minimum_not_met_alert.send_keys(NewActivityNotmetAlert)
     NewActivityFirstTicketType = "Adult"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '9.99'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     select = Select(page.first_ticket_viator)
     NewActivityFirstViatorType = "Adult"
     select.select_by_visible_text(NewActivityFirstViatorType)
     select = Select(page.first_guide)
     NewActivityFirstGuide = "Holly Flat"
     select.select_by_visible_text(NewActivityFirstGuide)
     select = Select(page.first_linked_activity)
     NewActivityLinked = "test06102017"
     select.select_by_visible_text(NewActivityLinked)
     NewActivityWhatIncluded = 'Good mood.'
     page.what_included.send_keys(NewActivityWhatIncluded)
     NewActivityWhatKnow = 'Everything will be fine.'
     page.what_know.send_keys(NewActivityWhatKnow)
     NewActivityWhatBring = 'Just bring a lot of money.'
     page.what_bring.send_keys(NewActivityWhatBring )
     select = Select(page.review_redirect)
     NewActivityStarsReviewNumber = 5
     NewActivityStarsReview = str(str(NewActivityStarsReviewNumber)+' Stars')
     select.select_by_visible_text(NewActivityStarsReview)
     page.review_website.send_keys(NewActivityURL)
     page.save_button.click()
     page = ActivityHubPage()
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     text = page.activity_title.get_attribute("textContent")
     assert text == NewActivityName
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.activity_name.get_attribute('value') == NewActivityName
     assert page.activity_url.get_attribute('value')== NewActivityURL
     select = Select(page.activity_status)
     assert select.first_selected_option.text == NewActivityStatus
     select = Select(page.branch)
     assert select.first_selected_option.text == NewActivityBranch
     select = Select(page.starting_location)
     assert select.first_selected_option.text == NewActivityLocation
     select = Select(page.time_zone)
     assert select.first_selected_option.text == NewActivityTimezone
     assert page.activity_description.get_attribute('value') == NewActivityDesription
     assert page.cancellation_policy.get_attribute('value') == NewActivityCancellationPolicy
     assert page.sales_tax.get_attribute('value') == NewActivitySalesTax+' %'
     assert page.activity_duration_days.get_attribute('value') == NewActivityDurationDays
     assert page.activity_duration_hours.get_attribute('value') == NewActivityDurationHours
     assert page.activity_duration_minutes.get_attribute('value') == NewActivityDurationMinutes
     select = Select(page.activity_color)
     assert select.first_selected_option.text == NewActivityColor
     assert page.ticket_maximum.get_attribute('value') == NewActivityMaxTickets
     select = Select(page.sell_out_alert)
     assert select.first_selected_option.text == NewActivitySellOut
     select = Select(page.alert_guide_upon_sellout)
     assert select.first_selected_option.text == NewActivityGuideUponSellout
     select = Select(page.stop_booking_sold)
     assert select.first_selected_option.text == NewActivityStopbookingSold+' '
     assert page.ticket_minimum.get_attribute('value') == NewActivityMinTickets
     assert page.minimum_not_met_alert.get_attribute('value') == NewActivityNotmetAlert
     assert page.stop_no_sales.is_enabled()==False
     assert page.first_ticket_type.get_attribute('value') == NewActivityFirstTicketType
     assert page.first_ticket_price.get_attribute('value') == NewActivityFirstTicketPrice
     select = Select(page.first_guide)
     assert select.first_selected_option.text == NewActivityFirstGuide
     select = Select(page.first_linked_activity)
     assert select.first_selected_option.text == NewActivityLinked
     assert page.what_included.get_attribute('value') == NewActivityWhatIncluded
     assert page.what_know.get_attribute('value') == NewActivityWhatKnow
     assert page.what_bring.get_attribute('value') == NewActivityWhatBring
     select = Select(page.review_redirect)
     assert select.first_selected_option.text == NewActivityStarsReview
     assert page.review_website.get_attribute('value') == NewActivityURL
     for i in range(0, len(page.switchers1)):
          assert page.switchers1[i].get_attribute("outerHTML") != switcher_OFF
     for i in range(0, len(page.switchers2)):
          assert page.switchers2[i].get_attribute("outerHTML") != switcher_OFF
     assert page.switcher_minimum_enforce.get_attribute("outerHTML") != switcher_OFF
     select = Select(page.first_ticket_viator)
     assert select.first_selected_option.text == NewActivityFirstViatorType
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)#STEP8
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 * FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     ActivityIDList.append(row[0])
     assert row[1] == 68#company id
     assert row[2] == 47#location_id
     assert row[3] == 386#branch_id
     assert row[4] == 9 #timezone_id
     assert row[5] == 15  #color_id
     assert row[6] == NewActivityName
     assert row[7] == NewActivityDesription
     assert row[8] == NewActivityWhatKnow
     assert row[9] == NewActivityWhatBring
     assert row[10] == NewActivityWhatIncluded
     assert row[11] == NewActivityCancellationPolicy
     assert row[12] == NewActivityURL
     assert row[14] == 1#Firstsalecloseevent
     assert row[15] == 0  # StopBookingNoSales
     assert row[16] == 90  # StopBookingSold
     assert row[17] == 1  # StopBookingMidBefore
     assert (int(row[19])) == NewActivitySellOutNumber
     assert row[20] == int(NewActivityNotmetAlert)
     assert row[21] == 135 #Duration
     assert row[22] == int(NewActivityMinTickets)
     assert row[23] == int(NewActivityMaxTickets)
     assert (int(row[25])) == int(NewActivitySalesTax)
     assert row[27] == int(NewActivityStarsReviewNumber)
     assert row[28] == NewActivityURL
     assert row[32] == False #GuideUponSellout
     assert row[33]==1 #ActivityStatus
     assert row[36] == 1 #Tickets Minimum Enforce
     assert row[37] == 1  # Viator
     assert row[39] == 1  # 2-step Check In
 def test_924(self):
     page = ActivityHubPage()  #STEP1
     page.open()
     page.search_activity_field.send_keys(ActivityNameList[0])  #STEP2
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     L = []
     if page.is_element_present(
             'second_ticket_type') == False and page.is_element_present(
                 'second_ticket_price') == False:  #STEP3
         page.add_ticket_type.click()
         time.sleep(5)
         NewActivitySecondTicketType = "Child"
         page.second_ticket_type.send_keys(NewActivitySecondTicketType)
         NewActivitySecondTicketPrice = '9.99'
         page.second_ticket_price.send_keys(NewActivitySecondTicketPrice)
     if page.switchers1[1].get_attribute(
             "outerHTML") == switcher_OFF:  #STEP4
         page.switchers1[1].click()
     time.sleep(5)
     assert page.first_ticket_type.is_displayed(
     ) and page.first_ticket_price.is_displayed(
     ) and page.first_ticket_viator.is_displayed()
     L.append(page.first_ticket_type.get_attribute('value'))
     assert page.second_ticket_type.is_displayed(
     ) and page.second_ticket_price.is_displayed(
     ) and page.second_ticket_viator.is_displayed()
     L.append(page.second_ticket_type.get_attribute('value'))
     if page.is_element_present(
             'third_ticket_type') == True and page.is_element_present(
                 'third_ticket_price') == True:
         L.append(page.third_ticket_type.get_attribute('value'))
         assert page.third_ticket_type.is_displayed(
         ) and page.third_ticket_price.is_displayed(
         ) and page.third_ticket_viator.is_displayed()
     if page.is_element_present(
             'fourth_ticket_type') == True and page.is_element_present(
                 'fourth_ticket_price') == True:
         L.append(page.fourth_ticket_type.get_attribute('value'))
         assert page.fourth_ticket_type.is_displayed(
         ) and page.fourth_ticket_price.is_displayed(
         ) and page.fourth_ticket_viator.is_displayed()
     select = Select(page.first_ticket_viator)  #STEP5
     select.select_by_visible_text(NewFirstViatorType)
     page.save_button.click()  #STEP6
     assert page.is_element_present('viator1_alert') == False
     assert page.is_element_present('viator2_alert') == True
     if len(L) > 2:
         assert page.is_element_present('viator3_alert') == True
         assert page.viator3_alert.is_displayed()
     else:
         assert page.is_element_present('viator3_alert') == False
     if len(L) > 3:
         assert page.is_element_present('viator4_alert') == True
     else:
         assert page.is_element_present('viator4_alert') == False
     select = Select(page.second_ticket_viator)  # STEP7
     select.select_by_visible_text(NewSecondViatorType)
     if len(L) > 2:
         select = Select(page.third_ticket_viator)
         select.select_by_visible_text(NewThirdViatorType)
     if len(L) > 3:
         select = Select(page.fourth_ticket_viator)
         select.select_by_visible_text(NewFourthViatorType)
     time.sleep(5)
     page.second_ticket_type.click()
     time.sleep(5)
     assert page.is_element_present('viator1_alert') == False
     assert page.is_element_present('viator2_alert') == False
     assert page.is_element_present('viator3_alert') == False
     assert page.is_element_present('viator4_alert') == False
     time.sleep(5)
     page.save_button.click()  # STEP8
     page = ActivityHubPage()
     page.search_activity_field.send_keys(ActivityNameList[0])  # STEP9
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.switchers1[1].get_attribute(
         "outerHTML") != switcher_OFF  # STEP10
     select = Select(page.first_ticket_viator)
     assert select.first_selected_option.text == NewFirstViatorType
     select = Select(page.second_ticket_viator)
     assert select.first_selected_option.text == NewSecondViatorType
     if len(L) > 2:
         select = Select(page.third_ticket_viator)
         assert select.first_selected_option.text == NewThirdViatorType
     if len(L) > 3:
         select = Select(page.fourth_ticket_viator)
         assert select.first_selected_option.text == NewFourthViatorType
     select = Select(page.first_ticket_viator)  #STEP11
     select.select_by_visible_text('----Choose Viator Ticket Type-----')
     time.sleep(3)
     assert select.first_selected_option.text == NewFirstViatorType
     page.switchers1[1].click()  #STEP12
     time.sleep(3)
     assert page.switchers1[1].get_attribute("outerHTML") == switcher_OFF
     assert page.is_element_present('first_ticket_viator') == False
     assert page.is_element_present('second_ticket_viator') == False
     assert page.is_element_present('third_ticket_viator') == False
     assert page.is_element_present('fourth_ticket_viator') == False
     page.save_button.click()  # STEP13
     page = ActivityHubPage()
     page.search_activity_field.send_keys(ActivityNameList[0])  # STEP14
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.switchers1[1].get_attribute(
         "outerHTML") == switcher_OFF  # STEP15
     assert page.is_element_present('first_ticket_viator') == False
     assert page.is_element_present('second_ticket_viator') == False
     assert page.is_element_present('third_ticket_viator') == False
     assert page.is_element_present('fourth_ticket_viator') == False
Ejemplo n.º 25
0
 def test_106(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.add_location_button.click()
     page = AddStartingLocationPage()
     NewLocationName = ("AutoTestLoc" +
                        ''.join(choice(digits) for i in range(3)))
     page.location_name.send_keys(NewLocationName)
     NewLocationAddress1 = '221 Breckenridge St'
     page.location_address_1.send_keys(NewLocationAddress1)
     NewLocationAddress2 = 'qwerty'
     page.location_address_2.send_keys(NewLocationAddress2)
     NewLocationCountry = "United States"
     select = Select(page.location_Country)
     select.select_by_visible_text(NewLocationCountry)
     NewLocationState = "Montana"
     select = Select(page.location_state)
     select.select_by_visible_text(NewLocationState)
     NewLocationCity = "Helena"
     page.location_city.send_keys(NewLocationCity)
     NewLocationZipcode = "59601"
     page.location_zipcode.send_keys(NewLocationZipcode)
     NewLocationDescription = "This location has been created automatically"
     page.location_description.clear()
     page.location_description.send_keys(NewLocationDescription)
     page.save_button.click()
     page.search_location.send_keys(NewLocationName)
     time.sleep(3)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if NewLocationName in page.location_links[i].get_attribute(
                 "textContent"):
             page.location_links[i].click()
     time.sleep(5)
     page = AddStartingLocationPage()
     assert page.location_name.get_attribute('value') == NewLocationName
     assert page.location_address_1.get_attribute(
         'value') == NewLocationAddress1
     assert page.location_address_2.get_attribute(
         'value') == NewLocationAddress2
     select = Select(page.location_Country)
     assert select.first_selected_option.text == NewLocationCountry
     select = Select(page.location_state)
     assert select.first_selected_option.text == NewLocationState
     assert page.location_city.get_attribute('value') == NewLocationCity
     assert page.location_zipcode.get_attribute(
         'value') == NewLocationZipcode
     assert page.location_description.get_attribute(
         'value') == NewLocationDescription
     page = ActivityHubPage()
     page.open()
     page.add_activity_button.click()
     page = AddEditActivityPage()
     time.sleep(10)
     select = Select(page.starting_location)
     select.select_by_visible_text(NewLocationName)
     assert select.first_selected_option.text == NewLocationName
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM location ORDER BY location_id DESC")
     row = cursor.fetchone()
     assert row[1] == 68  # company id
     assert row[2] == NewLocationName
     assert row[3] == NewLocationAddress1
     assert row[4] == NewLocationAddress2
     assert row[5] == NewLocationCity
     assert row[6] == 'MT'  #Location STATE
     assert row[7] == 'USA'  # Location country
     assert row[8] == NewLocationZipcode
     assert row[9] == NewLocationDescription
     assert row[11] == 1  #Location status
 def test_600(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() #STEP1
     page.open()
     page.add_activity_button.click() #STEP2
     page=AddEditActivityPage()
     time.sleep(15)
     assert page.switchers1[0].get_attribute("outerHTML") == switcher_OFF
     page.stop_no_sales.send_keys('-1')#STEP3
     page.minimum_not_met_alert.click()
     assert page.stop_no_sales.get_attribute('value')=='0'
     page.stop_no_sales.send_keys('10000001')#STEP4
     page.minimum_not_met_alert.click()
     assert page.stop_no_sales.get_attribute('value')=='100'
     page.stop_no_sales.clear()#STEP5
     page.stop_no_sales.send_keys('1')
     page.minimum_not_met_alert.click()
     assert page.stop_no_sales.get_attribute('value')=='1'
     NewActivityName = ("AutoTest600_" + ''.join(choice(digits) for i in range(4)))
     page.activity_name.send_keys(NewActivityName)
     select = Select(page.activity_status)
     NewActivityStatus = "Inactive"
     select.select_by_visible_text(NewActivityStatus)
     select = Select(page.branch)
     NewActivityBranch = "AlexeyBranch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Hotel California"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Pacific"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityCancellationPolicy = 'We can cancel an event any time we want.'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '100'
     page.ticket_maximum.send_keys(NewActivityMaxTickets)
     NewActivityFirstTicketType = "Adult"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '9.99'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "15 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     page.save_button.click()
     time.sleep(5)
     page = ActivityHubPage()
     time.sleep(5)
     page.show_inactive.click()
     page.search_activity_field.send_keys(NewActivityName)  # STEP6
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.switchers1[0].get_attribute("outerHTML") == switcher_OFF
     assert page.stop_no_sales.get_attribute('value') == '1'
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)# STEP7
     cursor = cnxn.cursor()
     cursor.execute("SELECT TOP 1 activity_stopbooking_hoursbefore, activity_stopbooking_midnightbefore, activity_name FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[0] == 1
     assert row[1] == 0
     assert row[2] == NewActivityName
     page.switchers1[0].click()#STEP8
     assert page.switchers1[0].get_attribute("outerHTML") != switcher_OFF
     assert page.stop_no_sales.get_attribute('value') == ''
     assert page.stop_no_sales.is_enabled()==False
     page.save_button.click()#STEP9
     time.sleep(5)
     page = ActivityHubPage()
     time.sleep(5)
     page.show_inactive.click()
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     page.activity_actions.click()
     page.edit_activity.click()
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.switchers1[0].get_attribute("outerHTML") != switcher_OFF
     assert page.stop_no_sales.is_enabled() == False
     cursor.execute("SELECT TOP 1 activity_stopbooking_hoursbefore, activity_stopbooking_midnightbefore, activity_name FROM activity ORDER BY activity_id DESC")#STEP10
     row = cursor.fetchone()
     assert row[0] == 0
     assert row[1] == 1
     assert row[2] == NewActivityName
 def test_859(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()  #STEP1
     page.open()
     page.add_activity_button.click()
     page = AddEditActivityPage()  #STEP2
     time.sleep(15)
     NewActivityName = ("PrivatePartyAutoTest859_" +
                        ''.join(choice(digits) for i in range(4)))
     ActivityNameList.append(NewActivityName)
     page.activity_name.send_keys(NewActivityName)
     select = Select(page.activity_status)
     NewActivityStatus = "Private Party"
     select.select_by_visible_text(NewActivityStatus)
     select = Select(page.branch)
     NewActivityBranch = "AlexeyBranch"
     select.select_by_visible_text(NewActivityBranch)
     select = Select(page.starting_location)
     NewActivityLocation = "Hotel California"
     select.select_by_visible_text(NewActivityLocation)
     select = Select(page.time_zone)
     NewActivityTimezone = "Pacific"
     select.select_by_visible_text(NewActivityTimezone)
     NewActivityCancellationPolicy = 'We can cancel an event any time we want.'
     page.cancellation_policy.send_keys(NewActivityCancellationPolicy)
     NewActivityDurationMinutes = '15'
     page.activity_duration_minutes.send_keys(NewActivityDurationMinutes)
     page.ticket_maximum.clear()
     NewActivityMaxTickets = '100'
     page.ticket_maximum.send_keys(NewActivityMaxTickets)
     NewActivityFirstTicketType = "Adult"
     page.first_ticket_type.send_keys(NewActivityFirstTicketType)
     NewActivityFirstTicketPrice = '9.99'
     page.first_ticket_price.send_keys(NewActivityFirstTicketPrice)
     page.stop_booking_sold.click()
     select = Select(page.stop_booking_sold)
     NewActivityStopbookingSold = "15 m"
     select.select_by_visible_text(NewActivityStopbookingSold)
     NewActivityMinTickets = '4'  #MIN TICKETS #STEP3
     page.ticket_minimum.send_keys(NewActivityMinTickets)
     page.switchers1[0].click()
     page.switchers2[0].click()
     page.switcher_minimum_enforce.click()
     assert page.switchers1[0].get_attribute(
         "outerHTML") != switcher_OFF  #Stop Booking Midnight Before
     assert page.switchers2[0].get_attribute(
         "outerHTML") != switcher_OFF  #First Sale Closes Event
     assert page.switcher_minimum_enforce.get_attribute(
         "outerHTML") != switcher_OFF  #Tickets Minimum Enforce
     page.save_button.click()  #STEP5
     time.sleep(5)
     page = ActivityHubPage()
     page.search_activity_field.send_keys(NewActivityName)
     time.sleep(5)
     page.activity_actions.click()  #STEP6
     text = page.activity_title.get_attribute("textContent")
     assert text == NewActivityName
     page.edit_activity.click()  #STEP7
     page = AddEditActivityPage()
     time.sleep(15)
     assert page.activity_name.get_attribute('value') == NewActivityName
     select = Select(page.activity_status)
     assert select.first_selected_option.text == NewActivityStatus
     select = Select(page.branch)
     assert select.first_selected_option.text == NewActivityBranch
     select = Select(page.starting_location)
     assert select.first_selected_option.text == NewActivityLocation
     select = Select(page.time_zone)
     assert select.first_selected_option.text == NewActivityTimezone
     assert page.cancellation_policy.get_attribute(
         'value') == NewActivityCancellationPolicy
     assert page.activity_duration_minutes.get_attribute(
         'value') == NewActivityDurationMinutes
     assert page.ticket_maximum.get_attribute(
         'value') == NewActivityMaxTickets
     assert page.first_ticket_type.get_attribute(
         'value') == NewActivityFirstTicketType
     assert page.first_ticket_price.get_attribute(
         'value') == NewActivityFirstTicketPrice
     assert page.ticket_minimum.get_attribute(
         'value') == NewActivityMinTickets
     assert page.switchers1[0].get_attribute("outerHTML") != switcher_OFF
     assert page.switchers2[0].get_attribute("outerHTML") != switcher_OFF
     assert page.switcher_minimum_enforce.get_attribute(
         "outerHTML") != switcher_OFF
     select = Select(page.stop_booking_sold)
     assert select.first_selected_option.text == NewActivityStopbookingSold
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' +
         password)  #STEP8
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM activity ORDER BY activity_id DESC")
     row = cursor.fetchone()
     assert row[1] == 68  #company id
     assert row[2] == 47  #location_id
     assert row[3] == 386  #branch_id
     assert row[4] == 9  #timezone_id
     assert row[6] == NewActivityName
     assert row[11] == NewActivityCancellationPolicy
     assert row[14] == 1  #Firstsalecloseevent
     assert row[15] == 0  # StopBookingNoSales
     assert row[16] == 15  # StopBookingSold
     assert row[17] == 1  # StopBookingMidBefore
     assert row[21] == 15  #Duration
     assert row[32] == True  #GuideUponSellout
     assert row[33] == 2  #ActivityStatus
     assert row[36] == 1  #Tickets Minimum Enforce
     assert row[37] == 0  # Viator
     assert row[39] == 0  # 2-step Check In
     page.cancel_button.click()  #STEP9
     page = ActivityHubPage()
     time.sleep(5)
     page.search_activity_field.send_keys(NewActivityName)  #STEP10
     time.sleep(5)
     page.activity_actions.click()  #STEP11
     page.add_events.click()  #STEP12
     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(
         'Repeating Event (Throughout Day)')  #STEP13
     page.rep_mult_begin_field.click()  #STEP14
     page.next_button_calendar_begin.click()
     NewDateBegin = random.randint(8, 18)
     nextMonthDate = datetime.date.today() + relativedelta(months=1)
     NewFullDateBegin = (nextMonthDate.strftime("%B") + ' ' +
                         ''.join(str(NewDateBegin)))
     DateList.append(NewDateBegin)
     nextMonthDate = datetime.date.today() + relativedelta(months=1)
     for i in range(0, len(page.date_calendar)):
         if i + 1 == NewDateBegin:
             page.date_calendar[i].click()
         else:
             continue
         break
     time.sleep(5)
     NewDateEnd = NewDateBegin + 10
     DateList.append(NewDateEnd)
     NewFullDateEnd = (nextMonthDate.strftime("%B") + ' ' +
                       ''.join(str(NewDateEnd)))
     page.rep_mult_end_field.click()
     page.next_button_calendar_enddate_repmult.click()
     time.sleep(5)
     end_date_list = []
     for i in range(0, len(page.date_calendar_end)):
         if page.date_calendar_end[i].is_displayed():
             end_date_list.append(page.date_calendar_end[i])
     for i in range(0, len(end_date_list)):
         if i + 1 == NewDateEnd:
             end_date_list[i].click()
         else:
             continue
         break
     NewTimeHoursBegin = str(random.randint(1, 10))
     select = Select(page.rep_mult_hours_begin)
     select.select_by_visible_text(NewTimeHoursBegin)
     minutes_values = ('00', '05', '10', '15', '20', '25', '30', '35', '40',
                       '45', '50', '55')
     NewTimeMinutesBegin = random.choice(minutes_values)
     select = Select(page.rep_mult_min_begin)
     select.select_by_visible_text(NewTimeMinutesBegin)
     NewTimeAMPM = random.choice(('AM', 'PM'))
     timeEvent = (NewTimeHoursBegin + ':' + ''.join(NewTimeMinutesBegin) +
                  ' ' + ''.join(NewTimeAMPM))
     TimeList.append(timeEvent)
     select = Select(page.rep_mult_appm_begin)
     select.select_by_visible_text(NewTimeAMPM)
     NewTimeHoursEnd = str(int(NewTimeHoursBegin) + 2)
     select = Select(page.rep_mult_hours_end)
     select.select_by_visible_text(NewTimeHoursEnd)
     NewTimeMinutesEnd = NewTimeMinutesBegin
     select = Select(page.rep_mult_min_end)
     select.select_by_visible_text(NewTimeMinutesEnd)
     select = Select(page.rep_mult_appm_end)
     select.select_by_visible_text(NewTimeAMPM)
     time.sleep(6)
     EveryMinutesRuns = '60'
     page.rep_every_min.send_keys(EveryMinutesRuns)
     page.rep_add_mult.click()  #STEP15
     time.sleep(5)
     assert page.is_element_present('popup_OK') == True
     page.popup_OK.click()  #STEP16
     time.sleep(5)
     page = ActivityHubPage()
     assert get_driver().current_url == page.url