def test_TenderverifiedON(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) tenderDetails = Tenderdetails() time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(4) browser = tenderDetails.estimatorProject(browser) time.sleep(1) browser = tenderDetails.estimatortender(browser) time.sleep(1) browser = tenderDetails.clicktenderverifybutton(browser) time.sleep(1) browser = tenderDetails.tenderverifyconfirm(browser) time.sleep(1) tenderverified1 = DataDriver() tenderverified_path = tenderverified1.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'tenderverified') time.sleep(1) tenderverified = browser.find_element_by_xpath( tenderverified_path) #Webelement for values time.sleep(1) if tenderverified.is_displayed(): print("Tender is verified") else: print("Tender is not verified") self.fail("Tender is not verified") logs.info("Test Case No : 100383 Passed Successfully") except Exception: logs.error("Validation with Tender is verified") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100383 failed") browser.implicitly_wait(5) finally: browser = tenderDetails.generalsettings(browser) time.sleep(1) browser = tenderDetails.tenderverifyOFF(browser) time.sleep(1) browser = tenderDetails.generalsettingssave(browser) time.sleep(1) reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) LauncheTender1.closebrowser(browser)
def test_confirmdeclinetender(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tenderDetails.suppliertender(browser) tenderDetails_decline = SubmitTenderclass() browser.implicitly_wait(5) time.sleep(1) browser = tenderDetails_decline.declineTender(browser) browser = tenderDetails_decline.declineTenderSubmission(browser) browser.implicitly_wait(5) time.sleep(1) confirmdecline = DataDriver() confirmdecline_path = confirmdecline.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'confirmdeclinesubmission') time.sleep(1) tenderdeclined_notification = browser.find_element_by_xpath( confirmdecline_path) #xpath for tender declined notification time.sleep(2) if tenderdeclined_notification.is_displayed(): print("pass") else: print("fail") logs.info("Test Case No : 100037 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100037 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100037 failed") browser.implicitly_wait(5) finally: reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) LauncheTender1.closebrowser(browser)
def test_createprojectfromapi(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) createproject = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = createproject.AuthunticateAPI() time.sleep(1) #createproject.Createproject(accesstoken) idValue = createproject.Createproject(accesstoken) time.sleep(2) LauncheTender1 = LauncheTenderclass() time.sleep(1) browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(1) ## browser = LauncheTender1.selectfirstOrganisation(browser) ## time.sleep(7) newprojectfromAPI = DataDriver() newprojectfromAPI_path = newprojectfromAPI.readfromXML(folder_path+'\Object\SwitchOrganisation.xml','eTender','newprojectfromAPI') time.sleep(1) newprojectfrom_API = browser.find_element_by_link_text(newprojectfromAPI_path) time.sleep(1) self.assertEqual(newprojectfrom_API.text,'ProjectfromRESTAPI') time.sleep(2) tenderDetails = Tenderdetails() time.sleep(1) #browser = tenderDetails.estimatorprojectAPI(browser) time.sleep(1) #browser = tenderDetails.deleteproject(browser) time.sleep(2) #browser = tenderDetails.confirmdeleteproject(browser) createproject.Deleteproject(idValue,accesstoken) time.sleep(2) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(2) ## browser = LauncheTender1.selectsecondOrganisation(browser) ## time.sleep(1) logs.info("Test Case No : 100184 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100184 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100184 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_viewunpriceditems(self): try: ## browserInstance = setupValue() ## browser = browserInstance.setupfunction() ## browser.implicitly_wait(5) ## LauncheTender1 = LauncheTenderclass() ## browser = LauncheTender1.openURL(browser) ## browser.implicitly_wait(5) ## browser = LauncheTender1.subcontractorValidlogin(browser) ## browser = LauncheTender1.list_Organisation(browser) ## browser = LauncheTender1.verifyorganisationdetails(browser) ## browser = LauncheTender1.list_project(browser) ## tenderDetails = Tenderdetails() ## browser = tenderDetails.Subcontratorproject(browser) ## browser = tenderDetails.suppliertender(browser) ## time.sleep(1) additem = ReopentenderusingRESTAPIclass() accesstoken = additem.AuthunticateAPI() additem.Additem(accesstoken) ## browser = tenderDetails.selectFilter(browser) ## time.sleep(1) ## browser = tenderDetails.selectunpriceditems(browser) ## browser = tenderDetails.closefilter(browser) ## time.sleep(1) ## unpriceditems_XML = DataDriver() ## unpriceditems = [] ## unpriceditems_path = unpriceditems_XML.readfromXML(folder_path+'\Object\Estimatorvalue.xml','eTender','pricableitems') ## unpriceditems = browser.find_elements_by_xpath(unpriceditems_path) #Webelement for values ## time.sleep(1) ## unpriceditems1 = unpriceditems[1].text ## time.sleep(1) ## self.assertEqual(unpriceditems1,'Unpriced item') ## logs.info("Test Case No : 100319 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100319 failed") #browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100319 failed") browser.implicitly_wait(5) finally: #Deleteitem = deleteorganisation() #Deleteitem.deleteitem() time.sleep(1)
def test_Confirmsubmittender(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_Organisation(browser) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) tenderDetails_submit = SubmitTenderclass() browser.implicitly_wait(5) browser = tenderDetails_submit.submitTender(browser) browser = tenderDetails_submit.confirmTendersubmission(browser) browser.implicitly_wait(5) tendersubmit = DataDriver() tendersubmit_path = tendersubmit.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'tendersubmitted') tendersubmit_element = browser.find_element_by_xpath( tendersubmit_path) #Verifying Webelement for Projectname if tendersubmit_element.is_displayed(): print("pass") else: print("fail") reopentender = ReopentenderusingRESTAPIclass() accesstoken = reopentender.AuthunticateAPI() reopentender.ReopentenderusingRESTAPI(accesstoken) logs.info("Test Case No : 100035 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100035 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100035 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_createtenderdetialsfromapi(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() tenderDetails = Tenderdetails() time.sleep(1) browser.implicitly_wait(5) time.sleep(1) createproject = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = createproject.AuthunticateAPI() time.sleep(1) idValue = createproject.Createproject(accesstoken) time.sleep(2) createproject.Createtender(idValue, accesstoken) time.sleep(2) LauncheTender1 = LauncheTenderclass() time.sleep(1) browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(1) ## browser = LauncheTender1.selectfirstOrganisation(browser) ## time.sleep(7) browser = tenderDetails.estimatorprojectAPI(browser) time.sleep(1) browser = tenderDetails.estimatortender(browser) time.sleep(2) itemdescription = DataDriver() itemdescription_path = itemdescription.readfromXML( folder_path + '\Object\SwitchOrganisation.xml', 'eTender', 'itemdescription') #Item-descrition time.sleep(1) item_description = browser.find_element_by_xpath( itemdescription_path) #Webelement for Item description time.sleep(1) itemdescription = item_description.text time.sleep(1) self.assertEqual(itemdescription, '65 mm thick') time.sleep(2) createproject.Deleteproject(idValue, accesstoken) time.sleep(2) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(1) ## browser = LauncheTender1.selectsecondOrganisation(browser) ## time.sleep(1) logs.info("Test Case No : 100186 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100186 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100186 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_estimatorshowvalue(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) tenderDetails = Tenderdetails() time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_Organisation(browser) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) browser = tenderDetails.tenderItemslist(browser) time.sleep(1) tenderDetails_submit = SubmitTenderclass() time.sleep(1) browser = tenderDetails_submit.submitTender(browser) time.sleep(1) browser = tenderDetails_submit.confirmTendersubmission(browser) time.sleep(1) ## browser = tenderDetails_submit.priceunrateditems(browser) ## time.sleep(1) ## browser = tenderDetails_submit.applypriceunrateditems(browser) ## time.sleep(1) Userprofilemenu_logout = Userprofilemenu() time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(4) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(4) browser = tenderDetails.estimatorProject(browser) time.sleep(1) browser = tenderDetails.estimatortender(browser) time.sleep(1) browser = tenderDetails.estimatorshowvalue(browser) time.sleep(2) showvalue_XML = DataDriver() showvalue = [] showvalue_path = showvalue_XML.readfromXML( folder_path + '\Object\Estimatorvalue.xml', 'eTender', 'Values') time.sleep(1) showvalue = browser.find_elements_by_xpath( showvalue_path) #Webelement for values time.sleep(3) showvalue1 = showvalue[4].text showvalue2 = showvalue[5].text showvalue3 = showvalue[6].text time.sleep(3) self.assertEqual(showvalue1, '3.10') self.assertEqual(showvalue2, '6.20') self.assertEqual(showvalue3, '9.30') logs.info("Test Case No : 100055 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100055 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100055 failed") browser.implicitly_wait(5) finally: reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) LauncheTender1.closebrowser(browser)
def test_declineStatusinEstiamtor(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) time.sleep(1) tenderDetails_decline = SubmitTenderclass() browser.implicitly_wait(5) time.sleep(1) browser = tenderDetails_decline.declineTender(browser) browser = tenderDetails_decline.declineTenderSubmission(browser) time.sleep(1) Userprofilemenu_logout = Userprofilemenu() browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) browser = tenderDetails.estimatorProject(browser) time.sleep(1) browser = tenderDetails.estimatortender(browser) time.sleep(1) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) browser = tenderDetails.tenderstatusinEstimator(browser) browser.implicitly_wait(5) declinestatus = DataDriver() #tenderstatus = [] time.sleep(1) declinestatus_path = declinestatus.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'tenderstatusfordecline') tenderstatus = browser.find_element_by_xpath( declinestatus_path) #xpath for decline status in Estimator time.sleep(1) declinestatus = tenderstatus.text self.assertEqual(declinestatus, 'Declined') logs.info("Test Case No : 100119 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100119 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100119 failed") browser.implicitly_wait(5) finally: reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) LauncheTender1.closebrowser(browser)
def test_viewdocument(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_Organisation(browser) time.sleep(1) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) time.sleep(1) browser = tenderDetails.tenderdocument(browser) time.sleep(2) browser = tenderDetails.uploadTendererdocument(browser) time.sleep(1) browser = tenderDetails.closedocumentwindow(browser) time.sleep(1) tenderDetails_submit = SubmitTenderclass() time.sleep(3) browser = tenderDetails_submit.submitTender(browser) time.sleep(1) browser = tenderDetails_submit.confirmTendersubmission(browser) time.sleep(1) Userprofilemenu_logout = Userprofilemenu() browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) browser = tenderDetails.estimatorProject(browser) time.sleep(1) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) document_count = DataDriver() documentcount_path = document_count.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'documentcountEstimator' ) #Delete option exists after uploading docs time.sleep(1) document_count = browser.find_element_by_xpath( documentcount_path) #Delete option time.sleep(1) documentcount = document_count.text self.assertEqual(documentcount, '2') time.sleep(1) browser = tenderDetails.opendocumentswindow(browser) time.sleep(1) document_count_view = DataDriver() document_count_viewlist = [] documentcount__view_path = document_count_view.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'documentviewEstimator' ) #Delete option exists after uploading docs time.sleep(1) document_count_viewlist = browser.find_elements_by_xpath( documentcount__view_path) time.sleep(1) document_count_view1 = document_count_viewlist[0].text document_count_view2 = document_count_viewlist[1].text time.sleep(1) self.assertEqual(document_count_view1, 'donotdeletefromDesktop.xlsx') self.assertEqual(document_count_view2, 'donotdeletefromDesktop.xlsx') time.sleep(1) browser = tenderDetails.closedocumentwindow(browser) time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(1) reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) time.sleep(2) browser = LauncheTender1.list_Organisation(browser) time.sleep(1) browser = LauncheTender1.list_project(browser) time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tenderDetails.suppliertender(browser) time.sleep(1) browser = tenderDetails.tenderdocument(browser) time.sleep(1) browser = tenderDetails.deletedocuments(browser) time.sleep(2) logs.info("Test Case No : 100057 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100057 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100057 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TenderverificationOFF(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) time.sleep(1) tenderDetails = Tenderdetails() time.sleep(1) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_Organisation(browser) browser = LauncheTender1.verifyorganisationdetails(browser) browser = LauncheTender1.list_project(browser) time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) time.sleep(1) tenderDetails_submit = SubmitTenderclass() time.sleep(1) browser = tenderDetails_submit.submitTender(browser) time.sleep(1) browser = tenderDetails_submit.confirmTendersubmission(browser) time.sleep(1) Userprofilemenu_logout = Userprofilemenu() time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(2) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(2) browser = tenderDetails.estimatorProject(browser) time.sleep(1) browser = tenderDetails.estimatortender(browser) time.sleep(1) tenderverifybutton1 = DataDriver() tenderverifybutton = [] tenderverifybutton_path = tenderverifybutton1.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'tenderverifybutton') time.sleep(1) tenderverifybutton = browser.find_elements_by_xpath( tenderverifybutton_path) #Webelement for values time.sleep(1) if len(tenderverifybutton) == 6: print("Tender verification button is not present") else: self.fail("Tender verification button is present") logs.info("Test Case No : 100357 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100357 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100357 failed") browser.implicitly_wait(5) finally: reopenTender = ReopentenderusingRESTAPIclass() time.sleep(1) accesstoken = reopenTender.AuthunticateAPI() time.sleep(1) reopenTender.ReopentenderusingRESTAPI(accesstoken) time.sleep(1) LauncheTender1.closebrowser(browser)