Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)