def test_Projectlist(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) browser.implicitly_wait(5) list_project = DataDriver() projectlist1 = list_project.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'projectlist') #Project browser.implicitly_wait(5) project_list = browser.find_element_by_link_text(projectlist1) project_list1 = project_list.text self.assertEqual(project_list1, 'Test Project') logs.info("Test Case No : 100006 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100006 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100006 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_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_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_OrganidetailsofOrganisation(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.implicitly_wait(5) orgDetails = DataDriver() organisation1_text = orgDetails.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'organisation-text') #organisation organisation = browser.find_element_by_link_text( organisation1_text) browser.implicitly_wait(5) pending_tenders = [] pendingTrades_count = orgDetails.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'pendingTrades') #pending trades pending_tenders = browser.find_elements_by_xpath( pendingTrades_count) browser.implicitly_wait(5) org_website = orgDetails.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'orgwebsite') #organisation website organisation_website = browser.find_element_by_link_text( org_website) browser.implicitly_wait(5) organisation1 = organisation.text pending_tenders1 = pending_tenders[1].text organisation_website1 = organisation_website.text self.assertEqual(organisation1, 'GSE Civil Engineering Ltd') self.assertEqual(pending_tenders1, 'Pending trades: 2') self.assertEqual(organisation_website1, 'http://www.gse-group.co.uk/') logs.info("Test Case No : 100004 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100004 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100004 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_clearmessageineditor(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.Actionslist(browser) time.sleep(1) browser = tenderDetails.editmessageinEditor(browser) time.sleep(1) browser = tenderDetails.clearmessageineditor(browser) time.sleep(1) nomessage = DataDriver() nomessage_path = nomessage.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'notesinsendmessage') nomessage_ineditor = browser.find_element_by_xpath(nomessage_path) nomessage_ineditor1 = nomessage_ineditor.text self.assertEqual(nomessage_ineditor1, '') time.sleep(1) browser = tenderDetails.backtotenderdetailswindow(browser) time.sleep(1) Userprofilemenu_logout = Userprofilemenu() browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(1) logs.info("Test Case No : 100026 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100026 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100026 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_uploaddocment(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.Actionslist(browser) time.sleep(2) browser = tenderDetails.uploadTendererdocument(browser) browser.implicitly_wait(5) time.sleep(1) uploaddoc = DataDriver() uploaddoc_path = uploaddoc.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'delete') #Delete option exists after uploading docs time.sleep(1) upload_document = browser.find_element_by_xpath( uploaddoc_path) #Delete option time.sleep(1) uploaddocument = upload_document.text self.assertEqual(uploaddocument, 'Delete') time.sleep(1) browser = tenderDetails.deletedocuments(browser) time.sleep(1) logs.info("Test Case No : 100030 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100030 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100030 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_deletingNotes(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) time.sleep(1) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tenderDetails.suppliertender(browser) time.sleep(4) browser = tenderDetails.deleteNotes(browser) time.sleep(1) browser.implicitly_wait(5) notesbubble = DataDriver() time.sleep(1) notesbubble_path = notesbubble.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'notesbubble') #notesbubble time.sleep(1) notes_bubble = browser.find_element_by_xpath( notesbubble_path) #Webelement for notesbubble if notes_bubble.is_displayed(): print("PASS") else: print("FAIL") time.sleep(2) logs.info("Test Case No : 100096 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100096 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100096 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_submittender(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(5) browser = LauncheTender1.subcontractorValidlogin(browser) time.sleep(1) browser = LauncheTender1.list_Organisation(browser) browser = LauncheTender1.verifyorganisationdetails(browser) time.sleep(1) browser = LauncheTender1.list_project(browser) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) tenderDetails_submit = SubmitTenderclass() browser.implicitly_wait(5) time.sleep(1) browser = tenderDetails_submit.submitTender(browser) browser.implicitly_wait(5) time.sleep(1) confirmsubmit = DataDriver() confirmsubmit_path = confirmsubmit.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'confirmsubmit') time.sleep(1) confirmsubmit_element = browser.find_element_by_xpath( confirmsubmit_path ) #Verifying Webelement for Confirm Submit button if confirmsubmit_element.is_displayed(): print("pass") else: print("fail") logs.info("Test Case No : 100034 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100034 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100034 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_dialogboxtoAddnote(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.hoverThemousefornoteButton(browser) time.sleep(1) browser = tenderDetails.dialogueBoxtoAddaNote(browser) time.sleep(2) dialogbox1 = DataDriver() dialogbox_path = dialogbox1.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'dialogbox') #dialogbox time.sleep(1) add_noteswindow = browser.find_element_by_xpath( dialogbox_path) #Webelement for dialogbox time.sleep(1) windowtitle = add_noteswindow.text time.sleep(1) self.assertEqual(windowtitle, 'Add a note') time.sleep(2) logs.info("Test Case No : 100023 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100023 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100023 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
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_viewdeleteditemsinsupplier(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) browser = tenderDetails.selectFilter(browser) time.sleep(1) browser = tenderDetails.selectdeleteditemsinsupplier(browser) browser = tenderDetails.closefilter(browser) time.sleep(1) deleteditems_XML = DataDriver() deleteditems = [] deleteditems_path = deleteditems_XML.readfromXML( folder_path + '\Object\Estimatorvalue.xml', 'eTender', 'deleteitems') deleteditems = browser.find_elements_by_xpath( deleteditems_path) #Webelement for values time.sleep(1) deleteditems1 = deleteditems[31].text time.sleep(1) self.assertEqual(deleteditems1, 'Deleted item') logs.info("Test Case No : 100331 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100331 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100331 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_tenderdetails(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.implicitly_wait(5) tradelist = DataDriver() trades = [] tradefirst_path = tradelist.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'quicktenders') trades = browser.find_elements_by_xpath( tradefirst_path) #Trades list time.sleep(3) #tradesecond_path = tradelist.readfromXML(folder_path+'\Object\Object.xml','eTender','tradesecondsub') #tradesecond = browser.find_element_by_xpath(tradesecond_path) #Trades list #time.sleep(1) trade1 = trades[0].text trade2 = trades[1].text self.assertEqual(trade1, 'A - Preliminaries - A1303 - Te..') self.assertEqual(trade2, 'A - Preliminaries - A1304 - Ed..') logs.info("Test Case No : 100007 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100007 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100007 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Warningwhennorates(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) 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.suppliersecondtender(browser) time.sleep(2) tenderDetails_submit = SubmitTenderclass() browser = tenderDetails_submit.submitTender(browser) time.sleep(1) warningmessage1 = DataDriver() warningmessage_path = warningmessage1.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'warningmessage') #User friendly message to the user warningmessage = browser.find_element_by_xpath(warningmessage_path) time.sleep(1) self.assertEqual( warningmessage.text, 'You must enter a value for the package, you can enter a total in the totals box at the bottom of the page.' ) time.sleep(1) 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_Insertrates(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) browser = tenderDetails.tenderItemslist(browser) browser.implicitly_wait(5) rates = DataDriver() rates_path = rates.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'values') #rates time.sleep(1) Value1 = [] Value1 = browser.find_elements_by_xpath(rates_path) time.sleep(1) Value2 = Value1[10].text self.assertEqual(Value2, '6.20') time.sleep(1) logs.info("Test Case No : 100016 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100016 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100016 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_suppliertender(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) browser.implicitly_wait(5) itemdescription = DataDriver() itemdescription_path = itemdescription.readfromXML( folder_path + '\Object\Object.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, '1000 x 600 mm high1') logs.info("Test Case No : 100012 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100012 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100012 failed") browser.implicitly_wait(5) finally: 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_notesinEstimator(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) tenderDetails = Tenderdetails() time.sleep(1) browser = tenderDetails.Subcontratorproject(browser) browser = tenderDetails.suppliertender(browser) time.sleep(1) browser = tenderDetails.hoverThemousefornoteButton(browser) browser = tenderDetails.dialogueBoxtoAddaNote(browser) time.sleep(1) browser = tenderDetails.addingNotes(browser) enteredNotes = DataDriver() time.sleep(1) 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 click_notesbubble[4].click() time.sleep(2) 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 time.sleep(1) subcontractornotes = enterednotes.text addingnotes = DataDriver() savenotes_path = addingnotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'savenotes') Save_Notes = browser.find_element_by_xpath( savenotes_path) #Save button time.sleep(1) Save_Notes.click() time.sleep(1) SubmitTender = SubmitTenderclass() browser = SubmitTender.submitTender(browser) time.sleep(1) browser = SubmitTender.confirmTendersubmission(browser) Userprofilemenu_logout = Userprofilemenu() time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) browser = LauncheTender1.estimatorValidlogin(browser) time.sleep(1) browser = tenderDetails.estimatorProject(browser) browser = tenderDetails.estimatortender(browser) time.sleep(3) browser = tenderDetails.notesinEstimator(browser) estimatornotes = DataDriver() time.sleep(1) notesinestimator_path = estimatornotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'NotesinEstimatorLogin') text_noteswindow_Estimatorlogin = browser.find_element_by_xpath( notesinestimator_path) #Notes in Estimator Login time.sleep(1) time.sleep(1) estimatornotes1 = text_noteswindow_Estimatorlogin.text time.sleep(1) browser.implicitly_wait(5) if subcontractornotes == estimatornotes1: print("pass") else: print("fail") time.sleep(1) #estimatornotes1 = DataDriver() cancelwindow_path = estimatornotes.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'cancelwindow') cancel_notewindow = browser.find_element_by_xpath( cancelwindow_path) # Click on cancel link time.sleep(1) cancel_notewindow.click() time.sleep(1) logs.info("Test Case No : 100058 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100058 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100058 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_TenderverificationONStatus(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.generalsettings(browser) time.sleep(1) browser = tenderDetails.tenderverifyON(browser) time.sleep(1) browser = tenderDetails.generalsettingssave(browser) time.sleep(1) Userprofilemenu_logout = Userprofilemenu() time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(4) 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) browser = tenderDetails.viewsupplierdetails(browser) time.sleep(2) tenderverifystatus1 = DataDriver() tenderverifystatus_path = tenderverifystatus1.readfromXML( folder_path + '\Object\TenderPage.xml', 'eTender', 'tenderverifystatus') time.sleep(1) tenderverifystatus = browser.find_element_by_xpath( tenderverifystatus_path) #Webelement for values time.sleep(1) self.assertEqual(tenderverifystatus.text, 'Review pending') logs.info("Test Case No : 100383 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100383 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100383 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_viewnewbillitems(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) browser = tenderDetails.selectFilter(browser) time.sleep(1) browser = tenderDetails.selectnewbillitems(browser) browser = tenderDetails.closefilter(browser) time.sleep(1) newbillitems_XML = DataDriver() newbillitems = [] newbillitems_path = newbillitems_XML.readfromXML( folder_path + '\Object\Estimatorvalue.xml', 'eTender', 'pricableitems') newbillitems = browser.find_elements_by_xpath( newbillitems_path) #Webelement for values time.sleep(1) ## newbillitems1 = newbillitems[1].text ## newbillitems2 = newbillitems[4].text ## newbillitems3 = newbillitems[7].text time.sleep(1) env = newbillitems_XML.readfromXML(folder_path + '\Env\Setup.xml', 'eTender', 'env') if env == 'StageURL': newbillitems1 = newbillitems[1].text newbillitems2 = newbillitems[4].text #newbillitems3 = newbillitems[7].text self.assertEqual(newbillitems1, 'New Bill item') #self.assertEqual(newbillitems2,'65 mm thick; curved work') self.assertEqual(newbillitems2, '80 mm thick') logs.info("Test Case No : 100318 Passed Successfully") if env == 'PreStageURL': newbillitems1 = newbillitems[1].text newbillitems2 = newbillitems[4].text newbillitems3 = newbillitems[7].text self.assertEqual(newbillitems1, 'New Bill item') self.assertEqual(newbillitems2, '80 mm thick') self.assertEqual(newbillitems3, '65 mm thick; curved work') logs.info("Test Case No : 100318 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100318 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100318 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)
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)