def test_Createbusiness(self): Login.test_Login(self) time.sleep(5) Createbusinesslink = self.getValue.getElement("XPATH", "Createbusinesslink") BusinessName = self.getValue.getElement("XPATH", "BusinessName") Estimate_price = self.getValue.getElement("XPATH", "Estimate_price") CreatebusinessBtn = self.getValue.getElement("XPATH", "CreatebusinessBtn") IBusinessName = self.getValue.getInputValue("Createbusiness", "IBusinessName") IEstimate_price = self.getValue.getInputValue("Createbusiness", "IEstimate_price") self.driver.find_element_by_xpath(Createbusinesslink).click() time.sleep(5) self.driver.find_element_by_xpath(BusinessName).send_keys( IBusinessName) self.driver.find_element_by_xpath(Estimate_price).send_keys( IEstimate_price) self.driver.find_element_by_xpath(CreatebusinessBtn).click() time.sleep(5) self.getscreenshotTest.screenshot("Createbusiness")
def test_Lookbusiness(self): Login.test_Login(self) time.sleep(10) Lookbusinesslink = self.getValue.getElement("XPATH", "Lookbusinesslink") self.driver.find_element_by_xpath(Lookbusinesslink).click() time.sleep(15) self.getscreenshotTest.screenshot("Lookbusiness")
def test_LookClue(self): Login.test_Login(self) time.sleep(5) LookClueLink = self.getValue.getElement("XPATH", "LookClueLink") self.driver.find_element_by_xpath(LookClueLink).click() time.sleep(5) self.getscreenshotTest.screenshot("LookClue")
def test_CreateCustomer(self): Login.test_Login(self) CreateCustomerlink = self.getValue.getElement("XPATH", "CreateCustomerlink") KfName = self.getValue.getElement("XPATH", "KfName") KfBcBtn = self.getValue.getElement("XPATH", "KfBcBtn") IKfName = self.getValue.getInputValue("CreateCustomer", "KfName") time.sleep(20) self.driver.find_element_by_xpath(CreateCustomerlink).click() self.driver.find_element_by_xpath(KfName).send_keys(IKfName) self.driver.find_element_by_xpath(KfBcBtn).click() time.sleep(5) self.getscreenshotTest.screenshot("Createcustomer")
def test_Createschedule(self): Login.test_Login(self) time.sleep(10) Createschedulelink = self.getValue.getElement("XPATH", "Createschedulelink") Subject = self.getValue.getElement("XPATH", "Subject") Description = self.getValue.getElement("XPATH", "Description") Createschedulebtn = self.getValue.getElement("XPATH", "Createschedulebtn") ISubject = self.getValue.getInputValue("Createschedule", "ISubject") IDescription = self.getValue.getInputValue("Createschedule", "IDescription") self.driver.find_element_by_xpath(Createschedulelink).click() time.sleep(10) self.driver.find_element_by_xpath(Subject).send_keys(ISubject) self.driver.find_element_by_xpath(Description).send_keys(IDescription) self.driver.find_element_by_xpath(Createschedulebtn).click() time.sleep(5) self.getscreenshotTest.screenshot("Createschedule")
def test_CreateClue(self): Login.test_Login(self) CreateClueLink = self.getValue.getElement("XPATH", "CreateClueLink") LxName = self.getValue.getElement("XPATH", "LxName") LxPhone = self.getValue.getElement("XPATH", "LxPhone") LXEmail = self.getValue.getElement("XPATH", "LXEmail") Ilxname = self.getValue.getInputValue("CreateClue", "Ilxname") Ilxphone = self.getValue.getInputValue("CreateClue", "Ilxphone") Ilxemail = self.getValue.getInputValue("CreateClue", "Ilxemail") time.sleep(5) self.driver.find_element_by_xpath(CreateClueLink).click() self.driver.find_element_by_xpath(LxName).send_keys(Ilxname) self.driver.find_element_by_xpath(LxPhone).send_keys(Ilxphone) self.driver.find_element_by_xpath(LXEmail).send_keys(Ilxemail) time.sleep(5) self.getscreenshotTest.screenshot("CreateClue")
def test_Createtask(self): Login.test_Login(self) time.sleep(5) Createtasklink = self.getValue.getElement("XPATH", "Createtasklink") TaskSubject = self.getValue.getElement("XPATH", "TaskSubject") Tasker = self.getValue.getElement("XPATH", "Tasker") TaskDescription = self.getValue.getElement("XPATH", "TaskDescription") ITaskSubject = self.getValue.getInputValue("CreateTask", "ITaskSubject") ITaskDescription = self.getValue.getInputValue("CreateTask", "ITaskDescription") ITasker = self.getValue.getInputValue("CreateTask", "ITasker") Createtaskbtn = self.getValue.getElement("XPATH", "Createtaskbtn") self.driver.find_element_by_xpath(Createtasklink).click() self.driver.find_element_by_xpath(TaskSubject).send_keys(ITaskSubject) self.driver.find_element_by_xpath(Tasker).send_keys(ITasker) self.driver.find_element_by_xpath(TaskDescription).send_keys(ITaskDescription) self.driver.find_element_by_xpath(Createtaskbtn).click() time.sleep(5) self.getscreenshotTest.screenshot("Createtask")
def tearDown(self): Login.tearDown(self)
import unittest from hpeu.CRM.Login import Login from hpeu.CRM.CreateClue import CreateClue from hpeu.CRM.LookClue import LookClue from hpeu.CRM.CreateCustomer import CreateCustomer from hpeu.CRM.LookCustomer import LookCustomer from hpeu.CRM.Createbusiness import Createbusiness from hpeu.CRM.Lookbusiness import Lookbusiness from hpeu.CRM.Createschedule import Createschedule from hpeu.CRM.Lookschedule import Lookschedule from hpeu.CRM.Createtask import Createtask from hpeu.CRM.Looktask import Looktask if __name__ == "__nain__": suite = unittest.suite() suite.addTest(Login("test_Login")) suite.addTest(CreateClue("test_CreateClue")) suite.addTest(LookClue("test_LookClue")) suite.addTest(CreateCustomer("test_CreateCustomer")) suite.addTest(LookCustomer("test_LookCustomer")) suite.addTest(Createbusiness("test_Createbusiness")) suite.addTest(Lookbusiness("test_Lookbusiness")) suite.addTest(Createschedule("test_Createschedule")) suite.addTest(Lookschedule("test_Lookschedule")) suite.addTest(Createtask("test_Createtask")) suite.addTest(Looktask("test_Looktask")) Runner = unittest.TextTestRunner() Runner.run(suite)