def approvePendingRequests(): start() login() pyautogui.click(115, 185, interval=7) # 1 - click on "Tratamento de Ponto" - Wait 2 pyautogui.click(1184, 454, interval=1) # 2 - click on Aprov Pendentes - Wait 1 pyautogui.click(1191, 507, interval=1) # 3 - click on Sim - Wait 2 pyautogui.click(utils.waitUntil (r"Certponto\Gerar_button.PNG")) pyautogui.click(utils.waitUntil (r"Certponto\Checkbox_gray_back.PNG")) pyautogui.click(utils.waitUntil (r"Certponto\Acoes_button.PNG")) pyautogui.click(utils.waitUntil (r"Certponto\Aprovar_Linhas_Selecionadas.PNG")) pyautogui.click(utils.waitUntil (r"Certponto\sim_button.PNG"))
def automate(process_name, first_step=1, last_step=100): processDir = r'C:\AlessandroBAM\2017m01 - Abbott DPE-PgM-PM\CIC Brazil\Automation\Processes' autoDir = os.path.join(processDir, process_name) files = [] for r, d, f in os.walk(os.path.join(processDir, process_name)): for file in f: files.append(file) for f in files: i = getIndex(f) # print(first_step) # print(last_step) if i >= first_step and i <= last_step: x_offset = getArgument(f, "x") y_offset = getArgument(f, "y") sleep = getArgument(f, "s") # print("index: " + str(getIndex(f)) + " X_offset: " + str(x_offset) + " Y_offset: " + str(y_offset) + " sleep: " + str(sleep) + " File Name: " + f) if not isOptional(f): r = utils.waitUntil(os.path.join(autoDir, f)) else: r = utils.waitUntil(os.path.join(autoDir, f), attempts=5) print("optional: " + f) if r != False: if not isWait(f): utils.click(r, x_offset, y_offset) else: time.sleep(sleep) print(r) else: if not isOptional(f): msgbox("Error", "Automation failed. File not found: " + f, 0) sys.exit()
def findProfessional(): serial = pyautogui.prompt(text='Search Who?', title='Serial' , default='') myhours = pyMyHours() myhours.start() utils.waitUntil("myhours\lupa.PNG") time.sleep(3) pyautogui.press("pagedown") time.sleep(1) # pyautogui.scroll(-100) pyautogui.click(utils.waitUntil("myhours\clearall.PNG")) time.sleep(3) # print(utils.waitUntil("myhours\lupa.PNG")) # utils.clickImg("myhours\lupa.PNG", x_offset=-100,y_offset=0) myhours.ClickOnSearchBox() pyautogui.typewrite(serial) myhours.ClickSearch() time.sleep(3) pyautogui.press("pagedown") time.sleep(2) myhours.ClickResource() # myhours.start(wait=2) # try: # myhours.clickClearAllFiltes(4) # except: # pass # myhours.ClickOnSearchBox() # pyautogui.typewrite(serial) # print ("------------>" + serial) # myhours.ClickSearch(wait=4) # pyautogui.scroll(-4000) # time.sleep(2)
def start(): print("about to initiate a browser") subprocess.Popen(pars.firefoxApp + " " + verse) utils.waitUntil(utils.img("verse\compose_button.PNG"))
def start(self): subprocess.Popen(pars.firefoxApp + " " + self.url) utils.waitUntil(utils.img("verse\compose_button.PNG")) time.sleep(1)
def downloadFilesKTLO(): start() utils.waitUntil("BaseReport.PNG") downloadFile("BaseReport.PNG", saveDir) downloadFile("Closed Tickets.PNG", saveDir)
def isSSORequired(): utils.waitUntil(utils.expandPath("firefox\home_button.PNG", "img")) r = utils.waitUntil(utils.expandPath("sso\SSO_LogingScreen.PNG", "img"), attempts=5) return r != False