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