def test_TenderListfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) BacktoList = TenderAction.BacktoTenderList(browser, NewTender) time.sleep(2) TenderList = orgLink.readfromXML( folder_path + '\Data\TenderData.xml', 'eTender', 'TradeList') self.assertTrue(TenderList in browser.page_source) logs.info("Test Case No : 100212 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100212 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100212 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_Cancelfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction=TenderClass() logOut=Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin(browser) time.sleep(3) ProjName=TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName,browser) NewTender=TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) sbutton=browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','CancelButton')) browser.execute_script("arguments[0].style.visibility = 'visible';",sbutton) time.sleep(2) sbutton.click() self.assertFalse(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','PopupTitle') in browser.page_source) logs.info("Test Case No : 100255 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100255 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100255 failed") finally: browser=logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_TenderUpdationfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction=TenderClass() logOut=Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName=TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName,browser) NewTender=TenderAction.TenderCreation(browser) UpdateTender=TenderAction.TenderUpdation(NewTender,browser) time.sleep(2) self.assertTrue(UpdateTender in browser.page_source) logs.info("Test Case No : 100199 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100196 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100199 failed") finally: browser=logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_Supplierfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenDetails(browser, NewTender) time.sleep(3) TenderAction.OpenLookup(browser) time.sleep(3) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'Lookupwindow'))) browser.find_element_by_tag_name('body').send_keys(Keys.ESCAPE) logs.info("Test Case No : 100232 Passed Successfully") except Exception: browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100232 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_OntimeStatus(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenDetails(browser, NewTender) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'SelectTemplate')).click() time.sleep(3) p = browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'PlanTemplateSearch')) time.sleep(2) p.send_keys( orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'TemplateData')) checkbox = browser.find_elements_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'TemplateCheckbox')) time.sleep(2) checkbox[1].click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'SelectPlanBtn')).click() time.sleep(3) tenderStatus = browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'OntimeStatus')).get_attribute('innerHTML') time.sleep(3) self.assertEquals( tenderStatus, orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'OStagestatus')) logs.info("Test Case No : 100288 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100288 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100288 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_ExcelExport(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction=TenderClass() logOut=Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName=TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName,browser) NewTender=TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenDetails(browser,NewTender) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','SelectTemplate')).click() time.sleep(3) p=browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','PlanTemplateSearch')) time.sleep(2) p.send_keys(orgLink.readfromXML(folder_path+'\Data\TenderData.xml','eTender','TemplateData')) checkbox=browser.find_elements_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','TemplateCheckbox')) time.sleep(2) checkbox[1].click() browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','SelectPlanBtn')).click() time.sleep(2) browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','SaveBtn')).click() time.sleep(2) browser.find_element_by_link_text(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','PlanLink')).click() time.sleep(2) browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','ExportButton')).click() time.sleep(2) os.path.exists(dpathfile) if os.path.isfile(dpathfile): os.remove(dpathfile) else: raise OSError logs.info("Test Case No : 100301 Passed Successfully") except NoSuchElementException: logs.error("Validation with Test Case No: 100301 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100301 failed") except OSError: self.fail("Test Case No: 100301 failed - File doesn't exists") except Exception: logs.error("Validation with Test Case No: 100301 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100301 failed") finally: browser=logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_ForeCastDate(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction=TenderClass() logOut=Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName=TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName,browser) dateflag=0 NewTender=TenderAction.TenderCreationwithStartDate(browser,dateflag) time.sleep(3) Datevalue=TenderAction.startdate Startdate = datetime.strptime(Datevalue, '%d-%b-%Y') time.sleep(3) TenderAction.OpenDetails(browser,NewTender) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','SelectTemplate')).click() time.sleep(3) p=browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','PlanTemplateSearch')) time.sleep(2) p.send_keys(orgLink.readfromXML(folder_path+'\Data\TenderData.xml','eTender','TemplateData')) checkbox=browser.find_elements_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','TemplateCheckbox')) time.sleep(2) checkbox[1].click() browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','SelectPlanBtn')).click() time.sleep(3) foreText=browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','ForeCastDateText')).get_attribute('value') Foredate=datetime.strptime(Datevalue, '%d-%b-%Y') self.assertEquals(Startdate,Foredate) logs.info("Test Case No : 100306 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100306 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100306 failed") finally: browser=logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_ExcelDetailsExport(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction=TenderClass() logOut=Userprofilemenu() time.sleep(2) browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName=TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName,browser) NewTender=TenderAction.TenderCreation(browser) downloadfile=NewTender+".xlsx" dpath=setupValue().downloadpath dpathfile=os.path.join(dpath,downloadfile) time.sleep(2) TenderAction.OpenDetails(browser,NewTender) time.sleep(2) browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','ExportDetailButton')).click() time.sleep(2) os.path.exists(dpathfile) if os.path.isfile(dpathfile): os.remove(dpathfile) else: raise OSError logs.info("Test Case No : 100341 Passed Successfully") except NoSuchElementException: logs.error("Validation with Test Case No: 100341 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100341 failed") except OSError: self.fail("Test Case No: 100341 failed - File doesn't exists") except Exception: logs.error("Validation with Test Case No: 100341 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100341 failed") finally: browser=logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_PreviewFunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) p = browser.find_elements_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'PlanTemplateSearch')) time.sleep(2) p[1].send_keys( orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'TemplateData')) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'PreviewPlan')).click() time.sleep(2) self.assertTrue( orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'StageData') in browser.page_source) browser.find_element_by_tag_name('body').send_keys(Keys.ESCAPE) logs.info("Test Case No : 100256 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100256 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100256 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_TenderSearchfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) FalseNewTender = NewTender + "New" browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'TenderSearchBox')).send_keys(NewTender) self.assertTrue(NewTender in browser.page_source) time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'TenderSearchBox')).clear() browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'TenderSearchBox')).send_keys(FalseNewTender) self.assertFalse(FalseNewTender in browser.page_source) logs.info("Test Case No : 100242 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100242 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100242 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)