def __init__(self, driver): """ Inits BasePage class Returns: None """ super(BasePage, self).__init__(driver) self.driver = driver self.util = Util() self.stat = Status(driver)
def classSetup(self, oneTimeSetUp): self.date = DatePickerPage(self.driver) self.ts = Status(self.driver)
def objectSetup(self, oneTimeSetUp): self.lp = LoginPage(self.driver) self.ts = Status(self.driver)
def run_All_testCase(self, testCaseJson, baseURL): wdf = WebDriverFactory(self.driver) if baseURL == '': self.log.error("Base URL not Inserted") self.driver = wdf.getWebDriverInstance(baseURL=baseURL) self.stat = Status(self.driver) self.util = Util() for test in testCaseJson: self.element = test['FindElement'] self.Action = test['ActionCommand'] self.elementType = test['FindElementType'] self.Data = test['ActionParameters'] self.waitAfterCmd = int(float(test['WaitAfterCommand'])) self.timeOut = int(float(test['Wait-Timeout'])) if self.Action == "login": email = self.Data.strip().split(",")[0] password = self.Data.strip().split(",")[1] email_locator = self.element.strip().split(",")[0] password_locator = self.element.strip().split(",")[1] self.sendKeys(email, email_locator, self.elementType) time.sleep(self.waitAfterCmd) self.sendKeys(password, password_locator, self.elementType) self.waitForElement(self.element, self.elementType, self.timeOut) elif self.Action == "isElementPresent": result = self.isElementPresent(self.element, self.elementType) self.stat.markFinal("Test" + self.element, result, "") self.reports.update({test['ActionNo']: result}) elif self.Action == "elementClick": self.elementClick(self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "verifyTextContains": exceptedText = self.getText(self.element, self.elementType) result = self.util.verifyTextContains(self.Data, exceptedText) self.stat.markFinal("Test" + self.element, result, "Text Contains") self.reports.update({test['ActionNo']: result}) elif self.Action == "sendKeys": self.sendKeys(self.Data, self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "waitForElement": self.waitForElement(self.element, self.elementType, self.timeOut) elif self.Action == "isElementPresent": result = self.isElementPresent(self.element, self.elementType) self.stat.markFinal("Test" + self.element, result, "") self.reports.update({test['ActionNo']: result}) elif self.Action == "clearField": self.clearField(self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "getTitle": result = self.getTitle() print(result) elif self.Action == "isElementDisplayed": self.isElementDisplayed(self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "scrollIntoView": self.scrollIntoView(self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "mouseHover": self.mouseHover(self.element, self.elementType) self.waitForElement(self.element, self.elementType, self.timeOut) elif self.Action == "mouseClick": self.mouseClick(self.element, self.elementType) time.sleep(self.waitAfterCmd) elif self.Action == "webScroll": self.webScroll(self.Data) time.sleep(self.waitAfterCmd) self.driver.quit()
def classSetup(self, oneTimeSetUp): self.lp = LoginPage(self.driver) self.ts = Status(self.driver) """
def classSetup(self, oneTimeSetUp): self.check = CheckboxPage(self.driver) self.ts = Status(self.driver)
def classSetup(self, oneTimeSetUp): self.forms = FormsPage(self.driver) self.ts = Status(self.driver)
def objectSetup(self, oneTimeSetUp): self.so = CreateSalesOrderPage(self.driver) self.ts = Status(self.driver) self.db = DashboardPage(self.driver)
def classSetup(self, oneTimeSetUp): self.tn = TopNav(self.driver) self.ts = Status(self.driver)
def classSetup(self, oneTimeSetUp): self.courses = RegisterCoursesPage(self.driver) self.ts = Status(self.driver)
def objectSetup(self, oneTimeSetUp): self.cp = ControllerPages(self.driver) self.ts = Status(self.driver)
def objectSetup(self, oneTimeSetUp): self.courses = RegisterCoursesPage(self.driver) self.ts = Status(self.driver) self.nav = NavigationPage(self.driver)
def classSetup(self, oneTimeSetUp): self.drop = DropdownPage(self.driver) self.ts = Status(self.driver)