def test_Tenderadditem(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(5) tendertemplate = Tenderplans() tenderDetails = Tenderdetails() itemdetails = ItemDetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) tenderclass = TenderClass() browser = itemdetails.localtender(browser) #Go to new tender time.sleep(1) #browser = itemdetails.estimatoritemdefault(browser) #Select Details from dropdown list #time.sleep(1) browser = itemdetails.edititems( browser) #click edit tender items button time.sleep(1) browser = itemdetails.additemclick( browser) #click add items button time.sleep(1) browser = itemdetails.additem( browser) #Enter item details to create new item time.sleep(1) browser = itemdetails.additemsave(browser) #Save item details time.sleep(1) new_item = DataDriver() time.sleep(1) newitem_path = new_item.readfromXML( folder_path + '\Object\Itemsobject.xml', 'eTender', 'itemsintender') newitem = browser.find_elements_by_xpath(newitem_path) time.sleep(1) self.assertEqual(newitem[1].text, '10 mm brick') self.assertEqual(newitem[4].text, 'General works') logs.info("Test Case No : 100311 Passed Successfully") time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100311 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100311 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_viewtenderdetailsinEstimator(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(1) browser = tenderDetails.estimatorProject(browser) browser = tenderDetails.estimatortender(browser) time.sleep(1) itemdescription = DataDriver() itemdescription_path = itemdescription.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'itemdescription') #Item-descrition item_description = browser.find_element_by_xpath( itemdescription_path) #Webelement for Item description itemdescription = item_description.text self.assertEqual(itemdescription, '1000 x 600 mm high1') logs.info("Test Case No : 100052 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100052 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100052 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_RFxaddQuestionfileupload(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) browser = tenderDetails.estimatortender1(browser) time.sleep(2) RFxQuestions = RFxQuestionnaire() browser = RFxQuestions.RFxQuestionsTab(browser) time.sleep(2) browser = RFxQuestions.RFxAddQuestions(browser) time.sleep(2) browser = RFxQuestions.RFxFileupload(browser) time.sleep(2) browser = RFxQuestions.selectdropdown(browser) time.sleep(2) browser = RFxQuestions.selectFileupload(browser) time.sleep(2) browser = RFxQuestions.SaveRFxquestions(browser) time.sleep(2) RFxupload = DataDriver() time.sleep(1) disabledpathforuploadfile = browser.find_elements_by_xpath( RFxupload.readfromXML(folder_path + '\Object\RFx.xml', 'eTender', 'disabled')) time.sleep(1) if disabledpathforuploadfile[3].is_displayed(): print "Textbox for upload file is disabled after saving details" else: self.fail("Upload file Question not saved") logs.info("Test Case No : RFX Passed Successfully") time.sleep(1) except Exception: logs.error("Validation with Test Case No: RFX failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: RFX failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_estimatorproject(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) browser = LauncheTender1.estimatorValidlogin(browser) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) time.sleep(3) tradelist = DataDriver() tradelist1 = [] tradelist1_path = tradelist.readfromXML(folder_path+'\Object\Object.xml','eTender','tenderdetailsestimator') tradelist1 = browser.find_elements_by_xpath(tradelist1_path) #Trades list time.sleep(1) #tradesecond_path = tradelist.readfromXML(folder_path+'\Object\Object.xml','eTender','tradesecondest') #tradesecond = browser.find_element_by_xpath(tradesecond_path) #Trades list time.sleep(1) self.assertEqual(tradelist1[2].text,'A - Preliminaries - A1303 - Te..') self.assertEqual(tradelist1[3].text,'A - Preliminaries - A1304 - Ed..') logs.info("Test Case No : 100046 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100046 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100046 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_documentlinkfileURL(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.projectdocIcon(browser) time.sleep(1) self.assertTrue( 'http://bg-etender-fs:8080/fileserver/api/file/raw/5a7445cd0ee3c5610bdcde35' in browser.page_source) logs.info("Test Case No : TC1026 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC1026 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1026 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_addhyperlinkdisplayed(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.projectdocIcon(browser) time.sleep(1) hyperlink1 = DataDriver() time.sleep(1) hyperlinkdisplayed_path = hyperlink1.readfromXML( folder_path + '\Object\Project.xml', 'eTender', 'hyperlink') hyperlinkdisplayed = browser.find_element_by_xpath( hyperlinkdisplayed_path) #Xpath for hover time.sleep(2) self.assertEqual(hyperlinkdisplayed.text, 'Add hyperlink') logs.info("Test Case No : TC1039 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC1039 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1039 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TendercreationBalustradingDuplicate(self): try: i = 9 while i < 10: 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.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) tenderclass = TenderClass() rownum = (i) rows = sheet.row_values(rownum) tendername = rows[1] tenderreference = rows[2] tenderdescription = rows[3] tendertype = rows[4] time.sleep(1) browser = tenderclass.TenderCreation( browser, tendername, tenderreference, tenderdescription, tendertype) #Pass the values from excel tendercreation = DataDriver() duplicatetender_path = tendercreation.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'duplicatetender') #Validate tender duplication duplicatetender = browser.find_element_by_xpath( duplicatetender_path) self.assertEqual(duplicatetender.text, 'Duplicate tender in the project.') time.sleep(3) i = i + 1 time.sleep(2) browser = tenderclass.Backtotradelist(browser) time.sleep(1) browser = tenderclass.TenderDeletion(browser) time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100380 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100380") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Plantemplatestagnotesupdate(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) tendertemplate = Tenderplans() tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) browser = tenderDetails.estimatortender2(browser) time.sleep(2) browser = tendertemplate.estimatortenderpalntender( browser) #Go to Tender plan tender #time.sleep(1) #browser = tendertemplate.estimatortenderplan(browser) #Select Tenderplan from dropdown list time.sleep(5) browser = tendertemplate.notesforfirststag( browser) #Click on Notes icon for Stag time.sleep(1) browser = tenderDetails.updatingNotes(browser) # Updating notes time.sleep(1) browser = tendertemplate.notesforfirststag( browser) #Click on Notes icon for Stag time.sleep(1) enteredNotes = DataDriver() enterednotes_path = enteredNotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'addingnotes') #adding notes time.sleep(1) enterednotes = browser.find_element_by_xpath( enterednotes_path) #Webelement for entered notes actualnotes = enterednotes.text time.sleep(1) self.assertEqual(actualnotes, 'Update Notes 1') logs.info("Test Case No : 100284 Passed Successfully") time.sleep(1) browser = tendertemplate.notesforstagsave(browser) time.sleep(1) browser = tendertemplate.tenderplansave(browser) time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100284 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100284 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_internaldocumentlinkfileURL(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.projectdocIcon(browser) time.sleep(1) self.assertTrue( 'https://jira.causeway.com/secure/attachment/47719/JSON%20Object.txt' in browser.page_source) logs.info("Test Case No : TC1027 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC1027 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1027 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_externaldocumentlinkfileURL(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.projectdocIcon(browser) time.sleep(1) self.assertTrue( 'https://drive.google.com/file/d/0BxabpQwGNM-aWnJzVTNIRHN3LUU/view?ths=true' in browser.page_source) logs.info("Test Case No : TC1028 Passed Successfully") time.sleep(1) browser = tenderDetails.deletedocuments(browser) time.sleep(1) except Exception: logs.error("Validation with Test Case No: TC1028 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1028 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TendercreationBalconiesMaterial(self): try: i = 12 while i<13: 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.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) tenderclass = TenderClass() rownum=(i) rows = sheet.row_values(rownum) tendername = rows[1] tenderreference = rows[2] tenderdescription = rows[3] tendertype = rows[4] time.sleep(1) browser = tenderclass.TenderCreation(browser,tendername,tenderreference,tenderdescription,tendertype) #Pass the values from excel time.sleep(2) todaysdate = datetime.datetime.today().strftime('%d-%m-%Y') tendercreation = DataDriver() tenderstatus = [] tenderstatus_path = tendercreation.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','tenderstatus') #Validate tender status tenderstatus = browser.find_elements_by_xpath(tenderstatus_path) self.assertEqual(tenderstatus[4].text,'Active') #self.assertEqual(tendertype,'MATERIAL') #self.assertEqual(tenderstatus[30].text,todaysdate) tendername_path = tendercreation.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','tenderName') #Validate tender name tendername = browser.find_elements_by_xpath(tendername_path) #self.assertEqual(tendername[9].text,'Balconies2') time.sleep(3) i = i + 1 except Exception: logs.error("Validation with Test Case No: 100373 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100373") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_RFxsupplierquestionstabClick(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliersecondtender(browser) time.sleep(2) RFxAnswers = RFxQuestionnaire() browser = RFxAnswers.RFxQuestionsTabinsupplier(browser) time.sleep(2) RFxAnswerstab1 = DataDriver() time.sleep(1) RFxEstimatorQuestion_path = RFxAnswerstab1.readfromXML(folder_path+'\Object\RFx.xml','eTender','rfxanswer1') RFxEstimatorQuestion = browser.find_element_by_xpath(RFxEstimatorQuestion_path) time.sleep(1) self.assertEqual(RFxEstimatorQuestion.text,'1. Have you ISO Certified?') logs.info("Test Case No : 100291 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100291 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100291 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_deletetradexsuppliercontact(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.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) time.sleep(1) tradexsupplierDetails = Tradexsupplier() browser = tenderDetails.estimatortendertradex(browser) time.sleep(2) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) browser = tradexsupplierDetails.estimatortradexaddsupplier(browser) time.sleep(2) browser = tradexsupplierDetails.entersupplier(browser) time.sleep(2) browser = tradexsupplierDetails.viewtradexsupplierdetails(browser) time.sleep(2) browser = tradexsupplierDetails.selectsuppliercontact(browser) time.sleep(2) browser = tradexsupplierDetails.deletesuppliercontact(browser) time.sleep(2) deletesuppliercontactdetails = DataDriver() deletesuppliercontactdetails_path = deletesuppliercontactdetails.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'trades') deletesuppliercontactdetails_list = [] time.sleep(1) deletesuppliercontactdetails_list = browser.find_elements_by_xpath( deletesuppliercontactdetails_path) #Contact details list suppliercount = len(deletesuppliercontactdetails_list) #print suppliercount if suppliercount == 6: print("supplier contact has been deleted") else: print("supplier contact has not been deleted") self.fail("supplier contact has not been deleted") browser = tradexsupplierDetails.closetradexsupplierwindow(browser) time.sleep(1) logs.info("Test Case No : 100237 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100237 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100237 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_RFxsupplieransweruploadfiles(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser = LauncheTender1.subcontractorValidlogin(browser) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliersecondtender(browser) time.sleep(2) RFxAnswers = RFxQuestionnaire() browser = RFxAnswers.RFxQuestionsTabinsupplier(browser) time.sleep(2) RFxAnswerstab1 = DataDriver() time.sleep(1) RFxEstimatorQuestion_path = RFxAnswerstab1.readfromXML( folder_path + '\Object\RFx.xml', 'eTender', 'rfxanswer1') RFxEstimatorQuestion = browser.find_elements_by_xpath( RFxEstimatorQuestion_path) time.sleep(1) self.assertEqual(RFxEstimatorQuestion[0].text, '1. Have you ISO Certified?') self.assertEqual(RFxEstimatorQuestion[1].text, '2. Do you have template format?') self.assertEqual(RFxEstimatorQuestion[2].text, '3. Are you Big contractor or Small?') self.assertEqual(RFxEstimatorQuestion[3].text, '4. Upload relevent files') RFxmultipleoptions_path = RFxAnswerstab1.readfromXML( folder_path + '\Object\RFx.xml', 'eTender', 'radiobuttonoptions') RFxmultipleoptions = browser.find_elements_by_xpath( RFxmultipleoptions_path) time.sleep(1) ## self.assertEqual(RFxmultipleoptions[0].text,'Yes') ## self.assertEqual(RFxmultipleoptions[1].text,'No') ## ## self.assertEqual(RFxmultipleoptions[2].text,'No') ## self.assertEqual(RFxmultipleoptions[3].text,'Yes') #browser = RFxAnswers.uploadFile(browser) #time.sleep(2) logs.info("Test Case No : 100291 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100291 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100291 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_RFxQuestionsrequired(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) browser = tenderDetails.estimatortender1(browser) time.sleep(2) RFxQuestions = RFxQuestionnaire() browser = RFxQuestions.RFxQuestionsTab(browser) time.sleep(2) RFxaddquestion1 = DataDriver() time.sleep(1) RFxaddquestion_path = RFxaddquestion1.readfromXML( folder_path + '\Object\RFx.xml', 'eTender', 'addquestion') RFxaddquestion = browser.find_element_by_xpath(RFxaddquestion_path) time.sleep(1) self.assertEqual(RFxaddquestion.text, 'Add question') addquestionserialnum_path = RFxaddquestion1.readfromXML( folder_path + '\Object\RFx.xml', 'eTender', 'addquestionserialnum') addquestionserialnum = browser.find_element_by_xpath( addquestionserialnum_path) time.sleep(1) self.assertEqual(addquestionserialnum.text, '1.') RFxcheckboxes_path = RFxaddquestion1.readfromXML( folder_path + '\Object\RFx.xml', 'eTender', 'checkboxes') RFxcheckboxes = browser.find_elements_by_xpath(RFxcheckboxes_path) time.sleep(1) self.assertEqual(RFxcheckboxes[0].text, 'Additional response required') self.assertEqual(RFxcheckboxes[1].text, 'Required') logs.info("Test Case No : RFX Passed Successfully") time.sleep(1) except Exception: logs.error("Validation with Test Case No: RFX failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: RFX failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_addnewtradexsupplier(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.estimatorValidlogin(browser) time.sleep(7) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) time.sleep(1) tradexsupplierDetails = Tradexsupplier() browser = tenderDetails.estimatortendertradex(browser) time.sleep(2) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) browser = tradexsupplierDetails.estimatortradexaddsupplier(browser) time.sleep(2) browser = tradexsupplierDetails.supplierinvite(browser) time.sleep(1) browser = tradexsupplierDetails.addnewsupplier(browser) time.sleep(1) browser = tradexsupplierDetails.enternewsupplierdetails(browser) time.sleep(1) suppliercontactdetails = DataDriver() suppliercontactdetails_path = suppliercontactdetails.readfromXML(folder_path+'\Object\Tradex.xml','eTender','trades') suppliercontactdetails_list = [] time.sleep(1) suppliercontactdetails_list = browser.find_elements_by_xpath(suppliercontactdetails_path) #Contact details list time.sleep(1) suppliercontact1 = suppliercontactdetails_list[5].text suppliercontact2 = suppliercontactdetails_list[6].text suppliercontact3 = suppliercontactdetails_list[7].text time.sleep(1) self.assertEqual(suppliercontact1,'New supplier') self.assertEqual(suppliercontact2,'Richwood') self.assertEqual(suppliercontact3,'*****@*****.**') time.sleep(1) browser = tradexsupplierDetails.closetradexsupplierwindow(browser) time.sleep(1) logs.info("Test Case No : TC - 1007 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC - 1007 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC - 1007 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_sendtoenquirysuccessmessage(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.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) time.sleep(1) tradexsupplierDetails = Tradexsupplier() browser = tenderDetails.estimatortendertradex(browser) time.sleep(2) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) browser = tradexsupplierDetails.estimatortradexaddsupplier(browser) time.sleep(2) browser = tradexsupplierDetails.entersupplier(browser) time.sleep(2) browser = tradexsupplierDetails.viewtradexsupplierdetails(browser) time.sleep(2) browser = tradexsupplierDetails.selectsuppliercontact(browser) time.sleep(2) browser = tradexsupplierDetails.sendenquirytosupplier(browser) time.sleep(2) sendenquirysuccessmessage = DataDriver() sendenquirysuccessmessage_path = sendenquirysuccessmessage.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'sendenquirysuccessmessage') time.sleep(1) sendenquirysuccessmessage_list = browser.find_element_by_xpath( sendenquirysuccessmessage_path) #send enquiry success message self.assertEqual( sendenquirysuccessmessage_list.text, 'Tender enquiry has been sent to the selected supplier(s)') time.sleep(1) logs.info("Test Case No : 100238 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100238 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100238 failed") browser.implicitly_wait(5) finally: 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_Tenderitemselectcount(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(5) tendertemplate = Tenderplans() tenderDetails = Tenderdetails() itemdetails = ItemDetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) tenderclass = TenderClass() browser = itemdetails.localtender(browser) #Go to new tender time.sleep(1) #browser = itemdetails.estimatoritemdefault(browser) #Select Details from dropdown list #time.sleep(1) browser = itemdetails.edititems( browser) #click edit tender items button time.sleep(1) browser = itemdetails.selectitem(browser) #select first item time.sleep(1) select_item = DataDriver() time.sleep(1) selectitemcount_path = select_item.readfromXML( folder_path + '\Object\Itemsobject.xml', 'eTender', 'selectitemcount') selectitemcount = browser.find_element_by_xpath( selectitemcount_path) time.sleep(1) self.assertEqual(selectitemcount.text, 'Total Items: 2 (Selected Items: 1)') logs.info("Test Case No : 100315 Passed Successfully") time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100315 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100315 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_ColumnsinTradeList(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() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.verifyColumnsinTradeList(browser) time.sleep(1) columns_XML = DataDriver() columns_path = columns_XML.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'tradecolumns') trade_columns = [] time.sleep(1) trade_columns = browser.find_elements_by_xpath(columns_path) time.sleep(1) browser.implicitly_wait(5) tradecolumn1 = trade_columns[0].text tradecolumn2 = trade_columns[1].text tradecolumn3 = trade_columns[2].text time.sleep(1) tradecolumn4 = trade_columns[3].text ## tradecolumn5 = trade_columns[4].text ## tradecolumn6 = trade_columns[5].text ## time.sleep(1) ## tradecolumn7 = trade_columns[6].text self.assertEqual(tradecolumn1, 'DOMESTIC') #self.assertEqual(tradecolumn2,'Received date:May 14, 2018') time.sleep(1) #self.assertEqual(tradecolumn3,'Due date:Jul 25, 2018') self.assertEqual(tradecolumn4, 'Responded date:') time.sleep(1) ## self.assertEqual(tradecolumn5,'Received date') ## self.assertEqual(tradecolumn6,'Due date') ## time.sleep(1) ## self.assertEqual(tradecolumn7,'Document') logs.info("Test Case No : 100008 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100008 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100008 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_createtenderfromapi(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) idValue = createproject.Createproject(accesstoken) time.sleep(2) createproject.Createtender(idValue,accesstoken) time.sleep(2) LauncheTender1 = LauncheTenderclass() time.sleep(2) 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) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.estimatorprojectAPI(browser) newtenderfromAPI = DataDriver() newtenderfrom_API = [] tendererslist_path = newtenderfromAPI.readfromXML(folder_path+'\Object\Object.xml','eTender','tenderdetailsestimator') time.sleep(1) newtenderfrom_API = browser.find_elements_by_xpath(tendererslist_path) time.sleep(1) self.assertEqual(newtenderfrom_API[2].text,'Mini Piling') time.sleep(2) #browser = tenderDetails.deleteproject(browser) time.sleep(2) #browser = tenderDetails.confirmdeleteproject(browser) 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 : 100185 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100185 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100185 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Plantemplatestagstatuscompleted(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) tendertemplate = Tenderplans() tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) browser = tenderDetails.estimatortender2(browser) time.sleep(2) tenderclass = TenderClass() browser = tendertemplate.estimatortenderpalntender( browser) #Go to Tender plan tender #time.sleep(1) #browser = tendertemplate.estimatortenderplan(browser) #Select Tenderplan from dropdown list time.sleep(5) browser = tendertemplate.tenderplansave(browser) time.sleep(2) Stagstatus1 = DataDriver() time.sleep(1) selecteditems = [] stagstatus_path = Stagstatus1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'stagstatus') stagstatus = browser.find_element_by_xpath(stagstatus_path) time.sleep(1) self.assertEqual(stagstatus.text, 'Completed') logs.info("Test Case No : 100290 Passed Successfully") time.sleep(2) browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tendertemplate.TenderDeletion(browser) time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100290 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100290 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
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_newtradexsupplierinvitelink(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.estimatorValidlogin(browser) time.sleep(7) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) time.sleep(1) tradexsupplierDetails = Tradexsupplier() browser = tenderDetails.estimatortendertradex(browser) time.sleep(2) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(1) browser = tradexsupplierDetails.estimatortradexaddsupplier(browser) time.sleep(2) browser = tradexsupplierDetails.supplierinvite(browser) time.sleep(2) newsupplierinvitelink = DataDriver() newsupplierinvitelink_path = newsupplierinvitelink.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'supplierinvite') time.sleep(1) newsupplierinvitelink = browser.find_element_by_xpath( newsupplierinvitelink_path) #Contact details list time.sleep(1) newsupplierinvitelink1 = newsupplierinvitelink.text time.sleep(1) self.assertEqual(newsupplierinvitelink1, 'Supplier not in the list? Send invite directly') time.sleep(1) browser = tradexsupplierDetails.closetradexsupplierwindow(browser) time.sleep(1) logs.info("Test Case No : TC - 1014 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC - 1014 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC - 1014 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Plantemplateplanneddates(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) tendertemplate = Tenderplans() tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(2) browser = tenderDetails.estimatortender2(browser) time.sleep(2) browser = tendertemplate.estimatortenderpalntender(browser) #Go to Tender plan tender #time.sleep(1) #browser = tendertemplate.estimatortenderplan(browser) #Select Tenderplan from dropdown list time.sleep(5) dateafter10days = tendertemplate.plantemplateplanneddates(browser) #Planned dates validation time.sleep(2) templateplanneddates1 = DataDriver() time.sleep(1) templateplanneddates = [] templateplanneddates_path = templateplanneddates1.readfromXML(folder_path+'\Object\TenderplanObjects.xml','eTender','templateplanneddate') time.sleep(1) templateplanneddates = browser.find_elements_by_xpath(templateplanneddates_path) time.sleep(2) self.assertEqual(templateplanneddates[0].text,dateafter10days[0]) self.assertEqual(templateplanneddates[1].text,dateafter10days[1]) self.assertEqual(templateplanneddates[2].text,dateafter10days[2]) self.assertEqual(templateplanneddates[3].text,dateafter10days[3]) self.assertEqual(templateplanneddates[4].text,dateafter10days[4]) self.assertEqual(templateplanneddates[5].text,dateafter10days[5]) self.assertEqual(templateplanneddates[6].text,dateafter10days[6]) logs.info("Test Case No : 100277 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100277 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100277 failed") browser.implicitly_wait(5) finally: time.sleep(1) LauncheTender1.closebrowser(browser)
def test_pendingtradefilter(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.subcontractorloginPendingtrades(browser) time.sleep(2) browser = LauncheTender1.switchOrganisation(browser) time.sleep(1) browser = LauncheTender1.selectfirstOrganisationPtrades(browser) time.sleep(3) tenderDetails = Tenderdetails() browser = tenderDetails.SubcontratorprojectPtrade(browser) time.sleep(1) browser = tenderDetails.Selectpendingtrades(browser) time.sleep(7) pending_trades = DataDriver() pendingtrades = [] pendingtrades_path = pending_trades.readfromXML( folder_path + '\Object\Project.xml', 'eTender', 'pendingtradeslist') pendingtrades = browser.find_elements_by_xpath(pendingtrades_path) time.sleep(1) for pendingtrades1 in pendingtrades: print(pendingtrades1.text) time.sleep(5) if pendingtrades[1].text == '': print("fail") self.fail("Test Case No: 100308 failed") else: self.assertEqual(pendingtrades1.text, 'Pending trades: 1') logs.info("Test Case No : 100308 Passed Successfully") time.sleep(2) except Exception: logs.error("Validation with Test Case No: 100308 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100308 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_addingNotes(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(2) 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.hoverThemousefornoteButton(browser) browser = tenderDetails.dialogueBoxtoAddaNote(browser) browser = tenderDetails.addingNotes(browser) time.sleep(3) enteredNotes = DataDriver() click_notesbubble = [] clicknotesbubble_path = enteredNotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'clicknotesbubble') time.sleep(1) click_notesbubble = browser.find_elements_by_xpath( clicknotesbubble_path) #Click on Notes bubble time.sleep(3) click_notesbubble[4].click() enterednotes_path = enteredNotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'addingnotes') #adding notes time.sleep(1) enterednotes = browser.find_element_by_xpath( enterednotes_path) #Webelement for entered notes actualnotes = enterednotes.text time.sleep(1) self.assertEqual(actualnotes, 'Notes 1') savenotes_path = enteredNotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'savenotes') Save_Notes = browser.find_element_by_xpath( savenotes_path) #Save button Save_Notes.click() time.sleep(2) browser = tenderDetails.deleteNotes(browser) time.sleep(1) logs.info("Test Case No : 100024 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100024 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100024 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_activetendersinEstimator(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.estimatorValidlogin(browser) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) browser = tenderDetails.activetendersInestimator(browser) time.sleep(2) activetendersinestimator = DataDriver() tendererslist = [] time.sleep(1) tendererslist_path = activetendersinestimator.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'activetender1') tendererslist1 = browser.find_element_by_xpath( tendererslist_path) #Notes in Estimator Login time.sleep(1) tendererslist_path = activetendersinestimator.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'activetender2') tendererslist2 = browser.find_element_by_xpath( tendererslist_path) #Notes in Estimator Login activetender1 = tendererslist1.text activetender2 = tendererslist2.text time.sleep(1) browser.implicitly_wait(5) self.assertEqual(activetender1, 'A - Preliminaries - A1303 - Temp Proppin') time.sleep(1) self.assertEqual(activetender2, 'A - Preliminaries - A1304 - Edge Protect') time.sleep(2) logs.info("Test Case No : 100050 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100050 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100050 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_invitecolleaguesearch(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser = LauncheTender1.subcontractorValidlogin(browser) time.sleep(1) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) itemDetails_actions = ItemDetails() time.sleep(1) browser = itemDetails_actions.moreactions(browser) time.sleep(1) browser = itemDetails_actions.invitecolleague(browser) time.sleep(1) browser = itemDetails_actions.invitecolleagueSearch(browser) time.sleep(2) emailSearch1 = DataDriver() emailSearch = [] emailSearch_path = emailSearch1.readfromXML( folder_path + '\Object\Itemsobject.xml', 'eTender', 'searchemail') time.sleep(1) emailSearch = browser.find_elements_by_xpath( emailSearch_path) #Verifying search results self.assertEqual(emailSearch[0].text, '*****@*****.**') #if len(emailSearch) == 1 and (self.assertEqual(emailSearch[0].text,'*****@*****.**')): if len(emailSearch) == 1: print("pass") else: self.fail("Validation with Test Case No: TC1033 failed") logs.info("Test Case No : TC1033 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC1033 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1033 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)