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_registerusertypes(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) registration = RegistrationineT() browser = registration.register(browser) time.sleep(1) ValidatecontractorRole = DataDriver() time.sleep(1) contractorrole = [] supplier_path = ValidatecontractorRole.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'contractorrole') contractorrole = browser.find_elements_by_xpath(supplier_path) time.sleep(1) #maincontractor_path = ValidatesupplierRole.readfromXML(folder_path+'\Object\Object.xml','eTender','selectmaincontractorrole') #contractorrole = browser.find_element_by_xpath(maincontractor_path) time.sleep(1) if contractorrole[0].is_displayed( ) and contractorrole[1].is_displayed(): print("pass") else: self.fail("Validation with Test Case No: 100139 failed") time.sleep(1) logs.info("Test Case No : 100139 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100139 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100139 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TenderResetfunction(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) TenderAction.ResetTender(browser, NewTender) logs.info("Test Case No : 100211 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100211 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100211 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_plantemplateduedateasforecastdate(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) tenderclass = TenderClass() NewTender = tenderclass.TenderCreationforduedate(browser) time.sleep(3) browser = tendertemplate.estimatortenderpalntender( browser) #Go to Tender plan tender time.sleep(1) browser = tendertemplate.estimatortenderplan( browser) #Select Tenderplan from dropdown list time.sleep(2) browser = tendertemplate.plantemplateselectionfromlist(browser) time.sleep(1) browser = tendertemplate.plantemplateselect(browser) time.sleep(5) dateafter10days = tendertemplate.plantemplateduedateasforecastdate( browser) #forecast dates validation for test in dateafter10days: print(test) time.sleep(2) templatforecastdate1 = DataDriver() time.sleep(1) templatforecastdate = [] templatforecastdate_path = templatforecastdate1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'templateforecastdate') time.sleep(1) templatforecastdate = browser.find_elements_by_id( templatforecastdate_path) for test1 in templatforecastdate: print(test1.get_attribute('value')) time.sleep(2) forecastdatestag1 = templatforecastdate[0].get_attribute('value') forecastdatestag2 = templatforecastdate[1].get_attribute('value') forecastdatestag3 = templatforecastdate[2].get_attribute('value') forecastdatestag4 = templatforecastdate[3].get_attribute('value') forecastdatestag5 = templatforecastdate[4].get_attribute('value') forecastdatestag6 = templatforecastdate[5].get_attribute('value') forecastdatestag7 = templatforecastdate[6].get_attribute('value') time.sleep(2) #self.assertEqual(forecastdatestag7.strip(),dateafter10days[0]) self.assertEqual(forecastdatestag6.strip(), dateafter10days[0]) self.assertEqual(forecastdatestag5.strip(), dateafter10days[1]) self.assertEqual(forecastdatestag4.strip(), dateafter10days[2]) self.assertEqual(forecastdatestag3.strip(), dateafter10days[3]) self.assertEqual(forecastdatestag2.strip(), dateafter10days[4]) self.assertEqual(forecastdatestag1.strip(), dateafter10days[5]) logs.info("Test Case No : 100306 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100306 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100306 failed") browser.implicitly_wait(5) finally: browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tendertemplate.TenderDeletion(browser) time.sleep(1) LauncheTender1.closebrowser(browser)
def test_createindependentproject(self): try: i = 10 while i<11: 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(3) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(1) ## browser = LauncheTender1.selectfirstOrganisation(browser) ## time.sleep(7) Updatedetails = updatedetails() browser = Updatedetails.createproject(browser) time.sleep(2) rownum=(i) rows = sheet.row_values(rownum) projectname = rows[2] projectreference = rows[3] projectdescription = rows[4] projecttype = rows[5] projectvalue = rows[6] projectlocation1 = rows[7] time.sleep(1) browser = Updatedetails.updateprojectdetails(browser,projectname,projectreference,projectdescription,projecttype,projectvalue) #Pass the values from excel browser = Updatedetails.projectstartdate(browser) browser = Updatedetails.projectduedate(browser) time.sleep(2) browser = Updatedetails.saveprojectdetails(browser) #Save project time.sleep(3) projectdetails = DataDriver() projectName_path = projectdetails.readfromXML(folder_path+'\Object\Pairwiserupdateproject.xml','eTender','projectname1') projectName = browser.find_element_by_xpath(projectName_path) self.assertEqual(projectName.text,'ProjectchangeName1') time.sleep(1) projectRefValueDuedate = [] projectRefValueDuedate_path = projectdetails.readfromXML(folder_path+'\Object\Pairwiserupdateproject.xml','eTender','projectrefvaluedate') projectRefValueDuedate = browser.find_elements_by_xpath(projectRefValueDuedate_path) value = numbers.format_currency(100,'GBP',locale='en') time.sleep(1) self.assertEqual(projectRefValueDuedate[0].text,'ProjectChangeRef1') self.assertEqual(projectRefValueDuedate[1].text,'Value:'+value) time.sleep(1) i = i + 1 logs.info("Test Case No : 100192 Passed Successfully") browser = Updatedetails.updateproject(browser) time.sleep(2) browser = Updatedetails.deleteproject(browser) time.sleep(2) except Exception: logs.error("Validation with Test Case No: 100192 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100192 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Plantemplatestagnotesdelete(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 = tendertemplate.deletenotesforstag( browser) #clear/delete Notes for Stag time.sleep(3) browser = tendertemplate.notesforstagsave(browser) 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, '') logs.info("Test Case No : 100285 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: 100285 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100285 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TendercreationBalustradingMaterial(self): try: i = 3 while i < 4: 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[18].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[6].text,'Balustrading') time.sleep(3) i = i + 1 except Exception: logs.error("Validation with Test Case No: 100364 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100364") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_currencychangeinprojectUS(self): try: i = 1 while i < 2: 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) Updatedetails = updatedetails() browser = Updatedetails.updateproject(browser) time.sleep(2) rownum = (i) rows = sheet.row_values(rownum) projecttype = rows[1] projectcurrency = rows[2] projectvalue = rows[3] time.sleep(1) browser = Updatedetails.projectdetailscurrency( browser, projecttype, projectcurrency, projectvalue) #Pass the values from excel time.sleep(2) browser = Updatedetails.saveprojectdetails( browser) #Save project time.sleep(3) projectdetails = DataDriver() projectcurrency = [] projectcurrency_path = projectdetails.readfromXML( folder_path + '\Object\Pairwiserupdateproject.xml', 'eTender', 'projectrefvaluedate') projectcurrency = browser.find_elements_by_xpath( projectcurrency_path) time.sleep(1) value = numbers.format_currency(100, 'USD', locale='en') time.sleep(1) self.assertEqual(projectcurrency[1].text, 'Value:' + value) time.sleep(1) i = i + 1 logs.info("Test Case No : 100220 Passed Successfully") #browser = Updatedetails.updateproject(browser) time.sleep(2) #browser = Updatedetails.deleteproject(browser) time.sleep(2) except Exception: logs.error("Validation with Test Case No: 100220 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100220 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_tradexsuppliercontact(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(5) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(1) ## browser = LauncheTender1.selectsecondOrganisation(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.entersupplier(browser) time.sleep(2) browser = tradexsupplierDetails.viewtradexsupplierdetails(browser) time.sleep(2) 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(2) suppliercontact1 = suppliercontactdetails_list[6].text suppliercontact2 = suppliercontactdetails_list[7].text time.sleep(2) self.assertEqual(suppliercontact1, 'Hanks Civils Ltd') self.assertEqual(suppliercontact2, '*****@*****.**') time.sleep(1) browser = tradexsupplierDetails.closetradexuserwindow(browser) time.sleep(1) browser = tradexsupplierDetails.closetradexsupplierwindow(browser) time.sleep(1) logs.info("Test Case No : 100233 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100233 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100233 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_TenderReturnSaveVerify(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() adminfunction = Adminclass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) adminfunction.GeneralSettings(browser) time.sleep(2) try: ButtonTrue = browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'TenderReturnTrue')) ButtonTrue.click() browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'SaveBtn')).click() time.sleep(2) adminfunction.OpenTags(browser) adminfunction.GeneralSettings(browser) time.sleep(2) try: browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'TenderReturnFalse')) except NoSuchElementException: return False except NoSuchElementException: try: ButtonFalse = browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'TenderReturnFalse')) ButtonFalse.click() time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'SaveBtn')).click() adminfunction.OpenTags(browser) adminfunction.GeneralSettings(browser) time.sleep(2) try: browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\Object\GeneralSettings.xml', 'eTender', 'TenderReturnTrue')) except NoSuchElementException: return False except NoSuchElementException: return False logs.info("Test Case No : 100381 Passed Successfully") return True except Exception: logs.error("Test Case No: 100381 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100381 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_userProfileUI(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender = LauncheTenderclass() browser = LauncheTender.openURL(browser) browser = LauncheTender.subcontractorValidlogin(browser) logOut = Userprofilemenu() orgInstance = Organizationclass() orgInstance.OpenUserProfilePage(browser) time.sleep(3) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'title'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'Firstname'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'lastname'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'jobtitle'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'email'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'mphone'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'phone'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'linkedin'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'address'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'eFootNote'))) ## self.assertTrue(browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\UserProfileObject.xml','eTender','county'))) ## self.assertTrue(browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\UserProfileObject.xml','eTender','country'))) ## self.assertTrue(browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\UserProfileObject.xml','eTender','pcode'))) self.assertTrue( browser.find_element_by_xpath( orgLink.readfromXML( folder_path + '\\Object\\UserProfileObject.xml', 'eTender', 'image'))) logs.info("Test Case No : 100157 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100157 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100157 failed") browser.implicitly_wait(5) finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_StageCompletedLate(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() TenderAction = TenderClass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) time.sleep(3) ProjName = TenderAction.ProjectCreation(browser) TenderAction.OpenProject(ProjName, browser) NewTender = TenderAction.TenderCreation(browser) time.sleep(3) TenderAction.OpenDetails(browser, NewTender) time.sleep(3) TenderAction.OpenTenderPlan(browser) time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'SelectTemplate')).click() time.sleep(3) p = browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'PlanTemplateSearch')) time.sleep(2) p.send_keys( orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'TemplateData')) checkbox = browser.find_elements_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'TemplateCheckbox')) time.sleep(2) checkbox[1].click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'SelectPlanBtn')).click() time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'ForeCastDate')).click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'ForecaseCal')).click() time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'ActualDate')).click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'NextMonth')).click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'NextMonth')).click() browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'ActDatePicker')).click() time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'ConfirmBtn')).click() time.sleep(2) tenderStatus = browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\TenderPage.xml', 'eTender', 'StageStatus')).get_attribute('innerHTML') self.assertEquals( tenderStatus, orgLink.readfromXML(folder_path + '\Data\TenderData.xml', 'eTender', 'LStageStatus')) #self.assertFalse(orgLink.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','StageClosed') in browser.page_source) logs.info("Test Case No : 100289 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100289 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100289 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_Ranksupplieractivestate(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() #browser.implicitly_wait(5) #time.sleep(1) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) browser.implicitly_wait(10) #time.sleep(1) browser = LauncheTender1.estimatorValidlogin(browser) #time.sleep(7) tenderDetails = Tenderdetails() browser = tenderDetails.estimatorProject(browser) #time.sleep(1) rankDetails = Ranksupplier() browser = tenderDetails.estimatortendertradex(browser) #time.sleep(2) browser = rankDetails.ranksupplier(browser) #time.sleep(2) browser = rankDetails.ranksupplieractivestate(browser) time.sleep(2) ranklink = DataDriver() ranksupplieractive_path = ranklink.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'rankingon') #time.sleep(1) ranksupplieractive = browser.find_element_by_xpath( ranksupplieractive_path) #ranksupplier active state #time.sleep(1) if ranksupplieractive.is_displayed(): print("pass") else: self.fail("Validation with Test Case No: Rank-3 failed") rankheading_path = ranklink.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'rankdisplay') #time.sleep(1) rankheading = browser.find_elements_by_xpath( rankheading_path) #rank heading #time.sleep(1) self.assertEqual(rankheading[1].text, 'Rank') ranknumber_path = ranklink.readfromXML( folder_path + '\Object\Tradex.xml', 'eTender', 'ranknumber') #time.sleep(1) ranknumber = browser.find_elements_by_xpath( ranknumber_path) #rank heading #time.sleep(1) self.assertEqual(ranknumber[0].text, '1') self.assertEqual(ranknumber[6].text, '2') logs.info("Test Case No : Rank-3 Passed Successfully") except Exception: logs.error("Validation with Test Case No: Rank-3 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: Rank-3 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_RFxaddQuestionmultiplechoice(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.RFxMultiplechoice(browser) time.sleep(2) browser = RFxQuestions.selectdropdown(browser) time.sleep(2) browser = RFxQuestions.selectMultiplechoice(browser) time.sleep(2) browser = RFxQuestions.selectoptiontemplatedropdown(browser) time.sleep(2) browser = RFxQuestions.optiontemplatechoice(browser) time.sleep(2) browser = RFxQuestions.SaveRFxquestions(browser) time.sleep(2) templateoptions = DataDriver() time.sleep(1) templateoption = browser.find_elements_by_xpath( templateoptions.readfromXML(folder_path + '\Object\RFx.xml', 'eTender', 'templateoptions')) time.sleep(1) self.assertEqual(templateoption[0].text, 'Yes') self.assertEqual(templateoption[1].text, 'No') 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_startduedateinprojectdetails(self): try: i = 10 while i < 11: 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) Updatedetails = updatedetails() browser = Updatedetails.createproject(browser) time.sleep(2) rownum = (i) rows = sheet.row_values(rownum) projectname = rows[2] projectreference = rows[3] projectdescription = rows[4] projecttype = rows[5] projectvalue = rows[6] projectlocation1 = rows[7] time.sleep(2) browser = Updatedetails.updateprojectdetails( browser, projectname, projectreference, projectdescription, projecttype, projectvalue) #Pass the values from excel browser = Updatedetails.projectstartdate(browser) browser = Updatedetails.projectduedateprevious(browser) time.sleep(2) browser = Updatedetails.saveprojectdetails( browser) #Save project #time.sleep(2) projectdatedetails = DataDriver() duedatalertmessage_path = projectdatedetails.readfromXML( folder_path + '\Object\Pairwiserupdateproject.xml', 'eTender', 'duedatalertmessage') #print duedatalertmessage_path #time.sleep(2) duedatalertmessage = browser.find_element_by_xpath( duedatalertmessage_path) #time.sleep(1) #print duedatalertmessage.text self.assertEqual( duedatalertmessage.text, 'Project startdate is greater than project duedate.') time.sleep(1) i = i + 1 logs.info("Test Case No : 100195 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100195 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100195 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_plantemplatecount(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() time.sleep(1) 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.plantemplateselectionfromlist(browser) time.sleep(2) selecteditems1 = DataDriver() time.sleep(1) selecteditems = [] selecteditems_path = selecteditems1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'selecteditems') templatecount = browser.find_element_by_xpath(selecteditems_path) time.sleep(1) self.assertEqual(templatecount.text, 'Total Items: 2') itemcount1 = DataDriver() time.sleep(1) itemcount = [] itemcount_path = itemcount1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'itemcount') itemcount = browser.find_element_by_xpath(itemcount_path) time.sleep(1) self.assertEqual(itemcount.text, '(Selected Items: 1)') logs.info("Test Case No : 100257 Passed Successfully") time.sleep(1) browser = tendertemplate.templateclose(browser) time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100257 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100257 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_MessageOption(self): try: browserInstance = setupValue() adminfunction = Adminclass() browser = browserInstance.setupfunction() LauncheTender = LauncheTenderclass() logOut = Userprofilemenu() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) adminfunction = Adminclass() adminfunction.NotificationMessages(browser) time.sleep(3) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageTenderUpdate') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageDuedate') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageTenderDeletion') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageDueDateReminder') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageNewRegist') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageAddUser') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageRoleUpdate') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageRemoveUser') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageTenderSubmit') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageTenderDecline') in browser.page_source) self.assertTrue( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageTenderAcceptance') in browser.page_source) except Exception: logs.error("Validation with Test Case No: 100082 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100082 failed") browser.implicitly_wait(5) finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_currencyintendersupplierlogin(self): try: i = 10 while i<11: 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) ## browser = LauncheTender1.switchOrganisation(browser) ## time.sleep(2) ## browser = LauncheTender1.selectsecondOrganisation(browser) ## time.sleep(7) Updatedetails = updatedetails() browser = Updatedetails.updateproject(browser) rownum=(i) rows = sheet.row_values(rownum) projecttype = rows[5] time.sleep(1) browser = Updatedetails.projectdetailscurrencydollar(browser,projecttype) #Pass the values from excel time.sleep(1) browser = Updatedetails.saveprojectdetails(browser) #Save project time.sleep(2) Userprofilemenu_logout = Userprofilemenu() browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(3) browser = LauncheTender1.subcontractorValidlogin(browser) time.sleep(3) browser = LauncheTender1.list_project(browser) time.sleep(3) tenderDetails = Tenderdetails() browser = tenderDetails.Subcontratorproject(browser) time.sleep(1) browser = tenderDetails.suppliertender(browser) Currencyfortender = DataDriver() currencyfortenderRate_path = Currencyfortender.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','currencyfortenderRate') #Validate currencyfortenderRate currencyfortenderRate = browser.find_element_by_xpath(currencyfortenderRate_path) self.assertEqual(currencyfortenderRate.text,'Rate ($)') time.sleep(1) currencyfortenderValue_path = Currencyfortender.readfromXML(folder_path+'\Object\TenderPage.xml','eTender','currencyfortenderValue') #Validate currencyfortenderValue currencyfortenderValue = browser.find_element_by_xpath(currencyfortenderValue_path) self.assertEqual(currencyfortenderValue.text,'Value ($)') time.sleep(1) browser = Userprofilemenu_logout.logout_eTender(browser) time.sleep(3) i = i + 1 logs.info("Test Case No : 100225 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100225 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100225 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_MessageTemplateCancel(self): try: browserInstance = setupValue() adminfunction = Adminclass() logOut = Userprofilemenu() browser = browserInstance.setupfunction() LauncheTender = LauncheTenderclass() browser = LauncheTender.openURL(browser) browser = LauncheTender.estimatorValidlogin1(browser) adminfunction = Adminclass() adminfunction.NotificationMessages(browser) time.sleep(3) browser.find_element_by_link_text( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageLinkSelection')).click() time.sleep(3) p = browser.find_element_by_class_name( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'TemplateTextBox')) p.clear() time.sleep(2) browser.find_element_by_link_text( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'SaveBtn')).click() time.sleep(2) browser.find_element_by_link_text( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageLinkSelection')).click() time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'User')).click() time.sleep(1) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'Organization')).click() time.sleep(1) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'Project')).click() time.sleep(1) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'Tender')).click() time.sleep(3) browser.find_element_by_link_text( orgLink.readfromXML(folder_path + '\Object\AdminEstimator.xml', 'eTender', 'CancelBtn')).click() time.sleep(2) browser.find_element_by_link_text( orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'MessageLinkSelection')).click() time.sleep(2) Nuser = str("[" + orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'user') + "]") Norganization = str("[" + orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'organization') + "]") Nproject = str("[" + orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'project') + "]") Ntender = str("[" + orgLink.readfromXML( folder_path + '\Data\AdminEstimatorData.xml', 'eTender', 'tender') + "]") self.assertFalse(Nuser in browser.page_source) self.assertFalse(Nuser in browser.page_source) self.assertFalse(Nuser in browser.page_source) self.assertFalse(Nuser in browser.page_source) logs.info("Test Case No : 100183 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100183 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100183 failed") browser.implicitly_wait(5) finally: browser = logOut.logout_eTender(browser) LauncheTender.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_Tenderitemintenderpage(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) browser = itemdetails.tenderlink( browser) #Click on tender at the top time.sleep(1) itemsintender1 = DataDriver() itemsintender = [] time.sleep(1) itemsintender_path = itemsintender1.readfromXML( folder_path + '\Object\Itemsobject.xml', 'eTender', 'itemsintender') itemsintender = browser.find_elements_by_xpath(itemsintender_path) time.sleep(1) self.assertEqual(itemsintender[1].text, '10 mm brick') self.assertEqual(itemsintender[4].text, 'General works') logs.info("Test Case No : 100314 Passed Successfully") time.sleep(1) except Exception: logs.error("Validation with Test Case No: 100314 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100314 failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_minimumroletoUser(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender = LauncheTenderclass() browser = LauncheTender.openURL(browser) browser = LauncheTender.subcontractorValidlogin(browser) orgInstance = Organizationclass() logOut = Userprofilemenu() orgInstance.OpenaddUser(browser) browser = orgInstance.AddUserOrganization(browser) time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'saveButon')).click() time.sleep(3) orgInstance.OpenUserRole(browser) time.sleep(4) p = browser.find_elements_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'emailrolebox')) p[1].send_keys( orgLink.readfromXML(folder_path + '\Data\Data.xml', 'eTender', 'userSaveEmail')) time.sleep(5) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'adduserCheckbox')).click() time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'managerole')).click() time.sleep(4) Checkbox1 = browser.find_elements_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'adduserCheckbox')) Checkbox1[0].click() time.sleep(5) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'checkboxSelectedAll')).click() time.sleep(2) browser.find_element_by_id( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'updatebutton')).click() time.sleep(2) self.assertTrue( orgLink.readfromXML(folder_path + '\Data\Data.xml', 'eTender', 'roleMessage') in browser.page_source) time.sleep(2) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'CancelAddRole')).click() time.sleep(2) logs.info("Test Case No : 100118 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100118 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100118 failed") browser.implicitly_wait(5) finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_Plantemplatestagadditiondatecheck(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) 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) templatforecastdate1 = DataDriver() time.sleep(1) templatforecastdate = [] templatforecastdate_path = templatforecastdate1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'templateforecastdate') time.sleep(1) templatforecastdate = browser.find_elements_by_id( templatforecastdate_path) time.sleep(2) forecastdatestag6 = templatforecastdate[5].get_attribute('value') forecastdatestag7 = templatforecastdate[6].get_attribute('value') time.sleep(2) #self.assertEqual(forecastdatestag6.strip(),templateplanneddates[6].text) self.assertEqual(templateplanneddates[6].text, forecastdatestag7.strip()) logs.info("Test Case No : 100280 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100280 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100280 failed") browser.implicitly_wait(5) finally: time.sleep(1) 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_showhintAgaininSuperadmin(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.superAdminValidlogin(browser) Hintdisplay = HintInteract() browser = Hintdisplay.systemfiledsmenu(browser) time.sleep(1) browser = Hintdisplay.showhints(browser) time.sleep(1) hint = DataDriver() time.sleep(1) hinttitle = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hinttitle')) # validating hint title self.assertEqual(hinttitle.text, 'System1') hintcontent = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hintcontent')) # validating hint content self.assertEqual(hintcontent.text, 'System field Creation can be done here') hintdone = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hintbutton')) # validating hint done text self.assertEqual(hintdone.text, 'Next') browser = Hintdisplay.nexthint(browser) time.sleep(1) hinttitle = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hinttitle')) # validating hint title self.assertEqual(hinttitle.text, 'Items1') hintcontent = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hintcontent')) # validating hint content self.assertEqual(hintcontent.text, 'Total items1') hintdone = browser.find_element_by_xpath( hint.readfromXML(folder_path + '\Object\Hint.xml', 'eTender', 'hintbutton')) # validating hint done text self.assertEqual(hintdone.text, 'Done') time.sleep(1) logs.info("Test Case No : TC1502 Passed Successfully") except Exception: logs.error("Validation with Test Case No: TC1502 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: TC1502 failed") browser.implicitly_wait(5) finally: time.sleep(1) LauncheTender1.closebrowser(browser)
def test_Plantemplateplannedexclamation(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) 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) stag1planneddate = templateplanneddates[0].text planneddatestag1 = datetime.datetime.strptime( stag1planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag1weekno1 = planneddatestag1.weekday() if planneddatestag1weekno1 >= 5: stag1dateplanned = 1 else: stag1dateplanned = 0 stag2planneddate = templateplanneddates[1].text planneddatestag2 = datetime.datetime.strptime( stag2planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag2weekno1 = planneddatestag2.weekday() if planneddatestag2weekno1 >= 5: stag2dateplanned = 1 else: stag2dateplanned = 0 stag3planneddate = templateplanneddates[2].text planneddatestag3 = datetime.datetime.strptime( stag3planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag3weekno1 = planneddatestag3.weekday() if planneddatestag3weekno1 >= 5: stag3dateplanned = 1 else: stag3dateplanned = 0 stag4planneddate = templateplanneddates[3].text planneddatestag4 = datetime.datetime.strptime( stag4planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag4weekno1 = planneddatestag4.weekday() if planneddatestag4weekno1 >= 5: stag4dateplanned = 1 else: stag4dateplanned = 0 stag5planneddate = templateplanneddates[4].text planneddatestag5 = datetime.datetime.strptime( stag5planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag5weekno1 = planneddatestag5.weekday() if planneddatestag5weekno1 >= 5: stag5dateplanned = 1 else: stag5dateplanned = 0 stag6planneddate = templateplanneddates[5].text planneddatestag6 = datetime.datetime.strptime( stag6planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag6weekno1 = planneddatestag6.weekday() if planneddatestag6weekno1 >= 5: stag6dateplanned = 1 else: stag6dateplanned = 0 stag7planneddate = templateplanneddates[6].text planneddatestag7 = datetime.datetime.strptime( stag7planneddate, '%d-%b-%Y') time.sleep(2) planneddatestag7weekno1 = planneddatestag7.weekday() if planneddatestag7weekno1 >= 5: stag7dateplanned = 1 else: stag7dateplanned = 0 planneddates = stag1dateplanned + stag2dateplanned + stag3dateplanned + stag4dateplanned + stag5dateplanned + stag6dateplanned + stag7dateplanned if planneddates == 0: print("There are no weekends") elif planneddates == 1: planneddateexclamation1 = DataDriver() time.sleep(1) planneddateexclamation = [] planneddateexclamation_path = planneddateexclamation1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'planneddateexclamation') time.sleep(1) planneddateexclamation = browser.find_element_by_xpath( planneddateexclamation_path) if planneddateexclamation.is_displayed(): print( "Day is weekend hence planneddateexclamation is present" ) elif planneddates >= 2: planneddateexclamation1 = DataDriver() time.sleep(1) planneddateexclamation = [] planneddateexclamation_path = planneddateexclamation1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'planneddateexclamation') time.sleep(1) planneddateexclamation = browser.find_elements_by_xpath( planneddateexclamation_path) for exclamation in planneddateexclamation: print(exclamation) time.sleep(2) if exclamation.is_displayed(): print( "Day is weekend hence planneddateexclamation is present" ) logs.error("Validation with Test Case No: 100279 passed") except Exception: logs.error("Validation with Test Case No: 100279 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100279 failed") browser.implicitly_wait(5) finally: time.sleep(1) LauncheTender1.closebrowser(browser)
def test_registerestimatoradminselectorg(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(5) LauncheTender1 = LauncheTenderclass() browser = LauncheTender1.openURL(browser) registration = RegistrationineT() browser = registration.register(browser) time.sleep(1) browser = registration.selectmaincontractorRole(browser) time.sleep(1) browser = registration.selectestimatoradminRole(browser) time.sleep(1) browser = registration.registrationForm(browser) time.sleep(1) browser = registration.organisationselect(browser) time.sleep(1) browser = registration.supplierRegistration(browser) time.sleep(1) browser = LauncheTender1.superAdminValidlogin(browser) time.sleep(1) browser = registration.supplierAuthorisation(browser) time.sleep(1) emailvalidate = DataDriver() validateemail = [] time.sleep(1) emailvalidate_path = emailvalidate.readfromXML( folder_path + '\Object\Object.xml', 'eTender', 'emailvalidate') validateemail = browser.find_elements_by_xpath(emailvalidate_path) time.sleep(1) email = validateemail[1].text time.sleep(1) self.assertEqual(email, '*****@*****.**') time.sleep(1) browser = registration.supplierAccept(browser) time.sleep(1) browser = registration.selectusersmenu(browser) time.sleep(1) browser = registration.suppliersearch(browser) time.sleep(1) browser = registration.supplierDeletion(browser) time.sleep(1) browser = registration.organisationmenu(browser) time.sleep(1) browser = registration.organisationsearchdelete(browser) time.sleep(1) ## Delete = deleteorganisation() ## browser = Delete.orgId(browser) ## time.sleep(1) ## browser = Delete.orguser(browser) ## time.sleep(1) ## browser = Delete.organisation(browser) ## time.sleep(1) logs.info("Test Case No : 100168 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100168 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100168 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_updateprojectdetailsInfrastructures(self): try: i = 4 while i < 5: 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) Updatedetails = updatedetails() browser = Updatedetails.updateproject(browser) rownum = (i) rows = sheet.row_values(rownum) projectname = rows[2] projectreference = rows[3] projectdescription = rows[4] projecttype = rows[5] projectvalue = rows[6] projectlocation1 = rows[7] time.sleep(1) browser = Updatedetails.updateprojectdetails( browser, projectname, projectreference, projectdescription, projecttype, projectvalue) #Pass the values from excel time.sleep(2) Infrastructures1 = DataDriver() env = Infrastructures1.readfromXML( folder_path + '\Env\Setup.xml', 'eTender', 'env') if env == 'StageURL': Infrastructures_path = Infrastructures1.readfromXML( folder_path + '\Object\PairwiserupdateprojectStaging.xml', 'eTender', 'Infrastructures') #Validate image id Infrastructures = browser.find_element_by_xpath( Infrastructures_path) time.sleep(2) if Infrastructures.is_displayed(): print("pass") else: print("fail") elif env == 'PreStageURL': Infrastructures_path = Infrastructures1.readfromXML( folder_path + '\Object\Pairwiserupdateproject.xml', 'eTender', 'Infrastructures') #Validate image id Infrastructures = browser.find_element_by_xpath( Infrastructures_path) time.sleep(2) if Infrastructures.is_displayed(): print("pass") else: print("fail") elif env == 'MasterURL': Infrastructures_path = Infrastructures1.readfromXML( folder_path + '\Object\PairwiserupdateprojectStaging.xml', 'eTender', 'Infrastructures') #Validate image id Infrastructures = browser.find_element_by_xpath( Infrastructures_path) time.sleep(2) if Infrastructures.is_displayed(): print("pass") else: print("fail") browser = Updatedetails.saveprojectdetails( browser) #Save project time.sleep(3) i = i + 1 except Exception: logs.error("Validation with Test Case No: Infrastructures failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: Infrastructures failed") browser.implicitly_wait(5) finally: LauncheTender1.closebrowser(browser)
def test_Plantemplatestagaddition(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.stagaddition(browser) #Stag addition time.sleep(2) browser = tendertemplate.tenderplansave(browser) #Save tender plan time.sleep(3) templatestages1 = DataDriver() env = templatestages1.readfromXML(folder_path + '\Env\Setup.xml', 'eTender', 'env') if env == 'StageURL': time.sleep(1) templatestages = [] templatestages_path = templatestages1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'templatestages') time.sleep(1) templatestages = browser.find_elements_by_xpath( templatestages_path) time.sleep(1) templatestagescount = str(len(templatestages)).strip() self.assertEqual(templatestagescount, '7') self.assertEqual(templatestages[0].text, 'Stag One Automation') self.assertEqual(templatestages[1].text, 'Stag Two Automation') self.assertEqual(templatestages[2].text, 'Automation Stage') self.assertEqual(templatestages[3].text, 'StagDelete') self.assertEqual(templatestages[4].text, 'Stag Three Automation') self.assertEqual(templatestages[5].text, 'Stag Four Automation') self.assertEqual(templatestages[6].text, 'Stag Five Automation') elif env == 'PreStageURL': time.sleep(1) templatestages = [] templatestages_path = templatestages1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'templatestages') time.sleep(1) templatestages = browser.find_elements_by_xpath( templatestages_path) time.sleep(1) templatestagescount = str(len(templatestages)).strip() self.assertEqual(templatestagescount, '7') self.assertEqual(templatestages[0].text, 'Stag One Automation') self.assertEqual(templatestages[1].text, 'Stag Two Automation') self.assertEqual(templatestages[2].text, 'Automation Stage') self.assertEqual(templatestages[3].text, 'StagDelete') self.assertEqual(templatestages[4].text, 'Stag Three Automation') self.assertEqual(templatestages[5].text, 'Stag Four Automation') self.assertEqual(templatestages[6].text, 'Stag Five Automation') elif env == 'MasterURL': time.sleep(1) templatestages = [] templatestages_path = templatestages1.readfromXML( folder_path + '\Object\TenderplanObjects.xml', 'eTender', 'templatestages') time.sleep(1) templatestages = browser.find_elements_by_xpath( templatestages_path) time.sleep(1) templatestagescount = str(len(templatestages)).strip() self.assertEqual(templatestagescount, '7') self.assertEqual(templatestages[0].text, 'Stag One Automation') self.assertEqual(templatestages[1].text, 'Stag Two Automation') self.assertEqual(templatestages[2].text, 'Automation Stage') self.assertEqual(templatestages[3].text, 'StagDelete') self.assertEqual(templatestages[4].text, 'Stag Three Automation') self.assertEqual(templatestages[5].text, 'Stag Four Automation') self.assertEqual(templatestages[6].text, 'Stag Five Automation') logs.info("Test Case No : 100271 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100271 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100271 failed") browser.implicitly_wait(5) finally: time.sleep(1) LauncheTender1.closebrowser(browser)