def AddAccount(self, AccountName, AccountType, EnableDownloadPrint): print("...Adding a " + AccountName + " Account...") chromedriver = r"F:\software\chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) h = Helpers() h.userLogin(driver, 'admin') driver.maximize_window() self.wait = WebDriverWait(driver, 20) self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, V.addAccountBtn))).click() # Account Name self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, "input[id$='Name']"))).send_keys(AccountName) # EIP URL selectEipUrl = Select( self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, "select[id$='EipUrl']")))) selectEipUrl.select_by_visible_text("Custom URL") # Account Type selectAccountType = Select( self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, "select[id$='AccountType']")))) if AccountType == "Ent": selectAccountType.select_by_visible_text("Enterprise Edition") elif AccountType == "Pro": selectAccountType.select_by_visible_text("Pro Edition") elif AccountType == "Std": selectAccountType.select_by_visible_text("Standard Edition") # Custom EIP URL self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, "input[id$='CustomUrl']"))).send_keys(V.CustomEipUrl) # Enable Download to Print if EnableDownloadPrint: self.wait.until( EC.presence_of_element_located( (By.CSS_SELECTOR, "input[id$='DownloadToPrintEnabled']"))).click() time.sleep(1) self.wait.until(EC.presence_of_element_located( (By.XPATH, V.saveBtn))).click() print("...Successful!!\n")
def test_AddLoginForm(self): print('TC - Add Login Form...') self.wait = WebDriverWait(self.driver, 20) h = Helpers() h.userLogin(self.driver, 'user') time.sleep(1) self.driver.get(V.loginFormUrl) self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, V.addLoginFormBtn))).click() self.wait.until(EC.presence_of_element_located((By.XPATH, V.uploadLoginForm))).click() time.sleep(1) pyautogui.typewrite(r"F:\Login Forms\LOGIN PAGES TEMPLATES\new-login.pdf") time.sleep(1) pyautogui.keyDown('enter') time.sleep(1) self.wait.until(EC.presence_of_element_located((By.XPATH, V.saveBtn))).click()