def test_userSelectionverification(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() browser.implicitly_wait(10) LauncheTender = LauncheTenderclass() browser = LauncheTender.openURL(browser) browser = LauncheTender.subcontractorValidlogin(browser) orgInstance = Organizationclass() logOut = Userprofilemenu() orgInstance.OpenUserRole(browser) time.sleep(3) browser.find_element_by_xpath( orgLink.readfromXML(folder_path + '\Object\Object.xml', 'eTender', 'managerole')).click() self.assertTrue( orgLink.readfromXML(folder_path + '\Data\Data.xml', 'eTender', 'warninginRole') in browser.page_source) time.sleep(3) 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") finally: browser = logOut.logout_eTender(browser) LauncheTender.closebrowser(browser)
def test_cancelButton(self): try: browserInstance = setupValue() browser = browserInstance.setupfunction() LauncheTender = LauncheTenderclass() browser = LauncheTender.openURL(browser) logOut = Userprofilemenu() browser.implicitly_wait(10) LauncheTender.subcontractorValidlogin(browser) orgInstance = Organizationclass() orgInstance.OpenaddUser(browser) time.sleep(2) if (orgLink.readfromXML(folder_path + '\Data\Data.xml', 'eTender', 'userSaveEmail') in browser.page_source): orgInstance.RemoveUserOrganization(browser) orgInstance.AddUserOrganizationCancel(browser) time.sleep(2) orgInstance.OpenUserRole(browser) time.sleep(2) orgInstance.OpenaddUser(browser) time.sleep(2) self.assertFalse( orgLink.readfromXML(folder_path + '\Data\Data.xml', 'eTender', 'userSaveEmail') in browser.page_source) logs.info("Test Case No : 100103 Passed Successfully") except Exception: logs.error("Validation with Test Case No: 100103 failed") browser.save_screenshot(fullpath) traceback.print_exc(file=sys.stdout) self.fail("Test Case No: 100103 failed") finally: browser = logOut.logout_eTender(browser) LauncheTender.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)