Example #1
0
 def test_Profilelocation(self):
     try:
         browserInstance = setupValue()
         browser = browserInstance.setupfunction()
         LauncheTender = LauncheTenderclass()
         logOut=Userprofilemenu()
         browser = LauncheTender.openURL(browser)
         browser= LauncheTender.subcontractorValidlogin(browser)
         orgInstance=Organizationclass()
         orgInstance.OpenProfilePage(browser)
         time.sleep(2)
         textvalue=orgLink.readfromXML(folder_path+'\Data\Data.xml','eTender','locationtext')
         time.sleep(2)
         savebutton=browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\Object.xml','eTender','saveinprofile'))
         browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\Object.xml','eTender','locationprofile')).send_keys(textvalue)
         p=browser.find_elements_by_css_selector(orgLink.readfromXML(folder_path+'\Object\Object.xml','eTender','locationLink'))
         p[0].click()
         time.sleep(2)
         self.assertEqual(browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\Object.xml','eTender','addresstextbox')).get_attribute('value'),orgLink.readfromXML(folder_path+'\Data\Data.xml','eTender','addresstext'))
         time.sleep(2)
         browser.execute_script("arguments[0].scrollIntoView(true);", savebutton)
         savebutton.click()
         orgInstance.OpenaddUser(browser)
         orgInstance.OpenProfilePage(browser)
         time.sleep(2)
         self.assertEqual(browser.find_element_by_xpath(orgLink.readfromXML(folder_path+'\Object\Object.xml','eTender','addresstextbox')).get_attribute('value'),orgLink.readfromXML(folder_path+'\Data\Data.xml','eTender','addresstext'))
         logs.info("Test Case No : 100098 Passed Successfully")
     except Exception:
         logs.error("Validation with Test Case No: 100098 failed")
         browser.save_screenshot(fullpath)
         traceback.print_exc(file=sys.stdout)
         self.fail("Test Case No: 100098 failed")
     finally:
         browser=logOut.logout_eTender(browser)
         LauncheTender.closebrowser(browser)
 def test_ProfileUI(self):
     try:
         browserInstance = setupValue()
         browser = browserInstance.setupfunction()
         LauncheTender = LauncheTenderclass()
         browser = LauncheTender.openURL(browser)
         browser = LauncheTender.subcontractorValidlogin(browser)
         orgInstance = Organizationclass()
         orgInstance.OpenProfilePage(browser)
         time.sleep(3)
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'nameinProfile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'phoneinProfile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'webinProfile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'emailinprofile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'addressinprofile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'countyinprofile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'countryinprofile')))
         self.assertTrue(
             browser.find_element_by_xpath(
                 orgLink.readfromXML(folder_path + '\Object\Object.xml',
                                     'eTender', 'postalinprofile')))
         logs.info("Test Case No : 100097 Passed Successfully")
     except Exception:
         logs.error("Validation with Test Case No: 100097 failed")
         browser.save_screenshot(fullpath)
         traceback.print_exc(file=sys.stdout)
         self.fail("Test Case No: 100097 failed")
         browser.implicitly_wait(5)
     finally:
         browser = LauncheTender.closebrowser(browser)