|
|
@@ -18,20 +18,20 @@ driver = webdriver.Chrome(DRIVER_PATH)
|
|
|
|
|
|
def checkIn():
|
|
|
############### Start of check In #################
|
|
|
- textboxes = driver.find_elements_by_class_name("quantumWizTextinputPaperinputInput")
|
|
|
+ textboxes = driver.find_elements_by_xpath("//input[@class='whsOnd zHQkBf']")
|
|
|
textboxes[0].send_keys("Michael Tang")
|
|
|
checkInRadio = driver.find_element_by_css_selector("#i9")
|
|
|
checkInRadio.click()
|
|
|
- nextButton = driver.find_element_by_class_name("quantumWizButtonPaperbuttonLabel")
|
|
|
+ nextButton = driver.find_element_by_class_name("uArJ5e")
|
|
|
nextButton.click()
|
|
|
time.sleep(2)
|
|
|
# check In
|
|
|
# get textboxes
|
|
|
- textboxes2 = driver.find_elements_by_class_name("quantumWizTextinputPaperinputInput")
|
|
|
+ textboxes2 = driver.find_elements_by_xpath("//input[@class='whsOnd zHQkBf']")
|
|
|
# get radio buttons
|
|
|
- radiobuttons = driver.find_elements_by_class_name("docssharedWizToggleLabeledLabelWrapper")
|
|
|
+ radiobuttons = driver.find_elements_by_id("i21")
|
|
|
# get submit button
|
|
|
- buttons = driver.find_elements_by_class_name("quantumWizButtonPaperbuttonLabel")
|
|
|
+ buttons = driver.find_elements_by_xpath("//div[@class='uArJ5e UQuaGc YhQJj zo8FOc IT3Lge']")
|
|
|
|
|
|
# email [0]
|
|
|
textboxes2[0].send_keys("michael.tang@epsb.ca")
|
|
|
@@ -53,19 +53,23 @@ def checkIn():
|
|
|
print('waiting 2 seconds for final page to load')
|
|
|
time.sleep(2)
|
|
|
|
|
|
- buttons = driver.find_elements_by_class_name("quantumWizButtonPaperbuttonLabel")
|
|
|
+ buttons = driver.find_elements_by_xpath("//div[@class='uArJ5e UQuaGc Y5sE8d VkkpIf NqnGTe M9Bg4d']")
|
|
|
# find the submit button
|
|
|
- buttonText = buttons[1].text
|
|
|
+ #buttonText = buttons[0].text
|
|
|
pressSubmit = input("Press submit? (y/n)")
|
|
|
if pressSubmit == "y":
|
|
|
- print(buttons[1].text)
|
|
|
- buttons[1].click()
|
|
|
+ print(buttons.text)
|
|
|
+ buttons.click()
|
|
|
time.sleep(1)
|
|
|
print("quitting")
|
|
|
driver.quit()
|
|
|
elif pressSubmit == "n":
|
|
|
print("Manual mode")
|
|
|
- buttons[0].click()
|
|
|
+ #buttons[0].click()
|
|
|
+ #find back button
|
|
|
+ backButton = driver.find_element_by_xpath("//div[@class='uArJ5e UQuaGc YhQJj zo8FOc IT3Lge']")
|
|
|
+ print(backButton.text + " clicked.")
|
|
|
+ backButton.click()
|
|
|
else:
|
|
|
print("invalid key pressed.")
|
|
|
|
|
|
@@ -73,36 +77,43 @@ def checkIn():
|
|
|
|
|
|
def checkOut():
|
|
|
############################ start Check Out ############################
|
|
|
- textboxes = driver.find_elements_by_class_name("quantumWizTextinputPaperinputInput")
|
|
|
+ textboxes = driver.find_elements_by_xpath("//input[@class='whsOnd zHQkBf']")
|
|
|
textboxes[0].send_keys("Michael Tang")
|
|
|
checkOutRadio = driver.find_element_by_css_selector("#i12")
|
|
|
- checkOutRadio.click()
|
|
|
-
|
|
|
- nextButton = driver.find_element_by_css_selector(".quantumWizButtonPaperbuttonLabel")
|
|
|
+ try:
|
|
|
+ checkOutRadio.click()
|
|
|
+ except:
|
|
|
+ print("exception")
|
|
|
+
|
|
|
+ nextButton = driver.find_element_by_class_name("uArJ5e")
|
|
|
nextButton.click()
|
|
|
time.sleep(3) # wait for next page to load
|
|
|
# Next page of check Out
|
|
|
try:
|
|
|
- whoWereYouHereFor = driver.find_element_by_css_selector(".exportTextarea")
|
|
|
+ whoWereYouHereFor = driver.find_element_by_xpath("//textarea[@class='KHxj8b tL9Q4c']")
|
|
|
+ whoWereYouHereFor.click()
|
|
|
whoWereYouHereFor.send_keys(whoHereFor)
|
|
|
except NoSuchElementException:
|
|
|
print("no text area to enter")
|
|
|
# Automated click of submit
|
|
|
- buttons = driver.find_elements_by_class_name("quantumWizButtonPaperbuttonLabel")
|
|
|
+ submitButton = driver.find_elements_by_xpath("//div[@class='uArJ5e UQuaGc Y5sE8d VkkpIf NqnGTe M9Bg4d']")
|
|
|
# find the submit button
|
|
|
- buttonText = buttons[1].text
|
|
|
- pressSubmit = input("Press submit? (y/n)")
|
|
|
- if pressSubmit == "y":
|
|
|
- print(buttons[1].text)
|
|
|
- buttons[1].click()
|
|
|
- time.sleep(1)
|
|
|
- print("quitting")
|
|
|
- driver.quit()
|
|
|
- elif pressSubmit == "n":
|
|
|
- print("Manual mode")
|
|
|
- buttons[0].click()
|
|
|
- else:
|
|
|
- print("invalid key pressed.")
|
|
|
+ # buttonText = submitButton[0].innerText
|
|
|
+ pressSubmit = input("Press submit? (y/n)")
|
|
|
+ if pressSubmit == "y":
|
|
|
+ #print(buttonText)
|
|
|
+ submitButton[0].click()
|
|
|
+ time.sleep(1)
|
|
|
+ print("quitting")
|
|
|
+ driver.quit()
|
|
|
+ elif pressSubmit == "n":
|
|
|
+ print("Manual mode")
|
|
|
+ # find the back button
|
|
|
+ backButton = driver.find_elements_by_xpath("//div[@role='button']")
|
|
|
+ #print(backButton[0].innerText)
|
|
|
+ backButton[0].click()
|
|
|
+ else:
|
|
|
+ print("invalid key pressed.")
|
|
|
############################ end Check Out ##############################
|
|
|
|
|
|
def locationSelector():
|