예제 #1
0
    def test_pendingtradefilter(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.subcontractorloginPendingtrades(browser)
            time.sleep(2)
            browser = LauncheTender1.switchOrganisation(browser)
            time.sleep(1)
            browser = LauncheTender1.selectfirstOrganisationPtrades(browser)
            time.sleep(3)

            tenderDetails = Tenderdetails()
            browser = tenderDetails.SubcontratorprojectPtrade(browser)
            time.sleep(1)

            browser = tenderDetails.Selectpendingtrades(browser)
            time.sleep(7)

            pending_trades = DataDriver()
            pendingtrades = []

            pendingtrades_path = pending_trades.readfromXML(
                folder_path + '\Object\Project.xml', 'eTender',
                'pendingtradeslist')
            pendingtrades = browser.find_elements_by_xpath(pendingtrades_path)
            time.sleep(1)
            for pendingtrades1 in pendingtrades:
                print(pendingtrades1.text)
            time.sleep(5)
            if pendingtrades[1].text == '':
                print("fail")
                self.fail("Test Case No: 100308 failed")
            else:
                self.assertEqual(pendingtrades1.text, 'Pending trades: 1')
                logs.info("Test Case No : 100308 Passed Successfully")
            time.sleep(2)

        except Exception:
            logs.error("Validation with Test Case No: 100308 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100308 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
예제 #2
0
 def test_OrganisationprofileupdateName(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(7)
         ##            browser = LauncheTender1.switchOrganisation(browser)
         ##            time.sleep(1)
         ##            browser = LauncheTender1.selectfirstOrganisation(browser)
         ##            time.sleep(7)
         Organizationprofile = OrganisationProfile()
         browser = Organizationprofile.OpenOrganisationProfilePage(browser)
         time.sleep(1)
         browser = Organizationprofile.OrganisationProfilePageUpdate(
             browser)
         time.sleep(1)
         organisationprofileupdateName = DataDriver()
         organisationprofileName = organisationprofileupdateName.readfromXML(
             folder_path + '\Object\OrgProfileObject.xml', 'eTender',
             'organisationname')  #Project
         time.sleep(3)
         organisationprofileName1 = browser.find_element_by_xpath(
             organisationprofileName)
         time.sleep(3)
         organisationprofileName2 = organisationprofileName1.text
         self.assertEqual(organisationprofileName2, 'DownerMouchelTest')
         time.sleep(2)
         logs.info("Test Case No : 100066 Passed Successfully")
         browser = Organizationprofile.OrganisationProfilePageUpdatetoOriginal(
             browser)
         time.sleep(2)
         browser = LauncheTender1.switchOrganisation(browser)
         time.sleep(2)
         browser = LauncheTender1.selectsecondOrganisation(browser)
         time.sleep(5)
     except Exception:
         logs.error("Validation with Test Case No: 100066 failed")
         browser.save_screenshot(fullpath)
         traceback.print_exc(file=sys.stdout)
         self.fail("Test Case No: 100066 failed")
         browser.implicitly_wait(5)
     finally:
         LauncheTender1.closebrowser(browser)
    def test_OrganisationprofileValidatedetailsinSuperadmin(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(7)
            ##            browser = LauncheTender1.switchOrganisation(browser)
            ##            time.sleep(1)
            ##            browser = LauncheTender1.selectfirstOrganisation(browser)
            ##            time.sleep(7)
            Organizationprofile = OrganisationProfile()
            browser = Organizationprofile.OpenOrganisationProfilePage(browser)
            time.sleep(1)
            browser = Organizationprofile.OrganisationProfilePageUpdate(
                browser)
            time.sleep(2)

            logoutEstimator = Userprofilemenu()
            browser = logoutEstimator.logout_eTender(browser)
            time.sleep(1)

            browser = LauncheTender1.superAdminValidlogin(browser)
            registration = RegistrationineT()
            browser = registration.organisationmenu(browser)
            time.sleep(1)
            browser = registration.organisationsearch(browser)

            organisationprofilevalidateNPWE = DataDriver()
            organisationName_path = organisationprofilevalidateNPWE.readfromXML(
                folder_path + '\Object\OrgProfileObject.xml', 'eTender',
                'organisationName')  #organisationName
            time.sleep(3)
            organisationName = browser.find_element_by_xpath(
                organisationName_path)
            time.sleep(3)
            organisationName1 = organisationName.text
            self.assertEqual(organisationName1, 'DownerMouchelTest')

            organisationPhone_path = organisationprofilevalidateNPWE.readfromXML(
                folder_path + '\Object\OrgProfileObject.xml', 'eTender',
                'organisationphone')  #organisationphone
            time.sleep(1)
            organisationPhone = browser.find_element_by_xpath(
                organisationPhone_path)
            time.sleep(1)
            organisationPhone1 = organisationPhone.text
            self.assertEqual(organisationPhone1, '08025226964')

            organisationWebsite_path = organisationprofilevalidateNPWE.readfromXML(
                folder_path + '\Object\OrgProfileObject.xml', 'eTender',
                'organisationwebsite')  #organisationwebsite
            time.sleep(1)
            organisationWebsite = browser.find_element_by_xpath(
                organisationWebsite_path)
            time.sleep(1)
            organisationWebsite1 = organisationWebsite.text
            self.assertEqual(organisationWebsite1, 'www.downermouchelTest.com')
            time.sleep(2)

            organisationEmail_path = organisationprofilevalidateNPWE.readfromXML(
                folder_path + '\Object\OrgProfileObject.xml', 'eTender',
                'organizationEmail')  #organisationEmail
            time.sleep(1)
            organisationEmail = browser.find_element_by_xpath(
                organisationEmail_path)
            time.sleep(1)
            organisationEmail1 = organisationEmail.text
            self.assertEqual(organisationEmail1, '*****@*****.**')
            time.sleep(2)
            logs.info("Test Case No : 100187 Passed Successfully")
            time.sleep(2)
            browser = registration.organisationdetailsclose(browser)
            time.sleep(1)
            browser = logoutEstimator.logout_eTender(browser)
            time.sleep(1)
            browser = LauncheTender1.estimatorValidlogin(browser)
            time.sleep(1)
        except Exception:
            logs.error("Validation with Test Case No: 100187 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100187 failed")
            browser.implicitly_wait(5)
        finally:
            browser = Organizationprofile.OrganisationProfilePageUpdatetoOriginal(
                browser)
            time.sleep(3)
            browser = LauncheTender1.switchOrganisation(browser)
            time.sleep(1)
            browser = LauncheTender1.selectsecondOrganisation(browser)
            time.sleep(7)
            LauncheTender1.closebrowser(browser)