def test_Tenderitemselectcount(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.selectitem(browser)  #select first item
            time.sleep(1)

            select_item = DataDriver()
            time.sleep(1)
            selectitemcount_path = select_item.readfromXML(
                folder_path + '\Object\Itemsobject.xml', 'eTender',
                'selectitemcount')
            selectitemcount = browser.find_element_by_xpath(
                selectitemcount_path)
            time.sleep(1)
            self.assertEqual(selectitemcount.text,
                             'Total Items: 2 (Selected Items: 1)')

            logs.info("Test Case No : 100315 Passed Successfully")
            time.sleep(1)

        except Exception:
            logs.error("Validation with Test Case No: 100315 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100315 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
    def test_invitecolleaguesearch(self):
        try:
            browserInstance = setupValue()
            browser = browserInstance.setupfunction()
            browser.implicitly_wait(5)
            time.sleep(1)
            LauncheTender1 = LauncheTenderclass()
            browser = LauncheTender1.openURL(browser)
            browser = LauncheTender1.subcontractorValidlogin(browser)
            time.sleep(1)
            browser = LauncheTender1.list_project(browser)
            tenderDetails = Tenderdetails()
            time.sleep(1)
            browser = tenderDetails.Subcontratorproject(browser)
            browser = tenderDetails.suppliertender(browser)
            itemDetails_actions = ItemDetails()
            time.sleep(1)
            browser = itemDetails_actions.moreactions(browser)
            time.sleep(1)
            browser = itemDetails_actions.invitecolleague(browser)
            time.sleep(1)

            browser = itemDetails_actions.invitecolleagueSearch(browser)
            time.sleep(2)
            emailSearch1 = DataDriver()
            emailSearch = []
            emailSearch_path = emailSearch1.readfromXML(
                folder_path + '\Object\Itemsobject.xml', 'eTender',
                'searchemail')
            time.sleep(1)
            emailSearch = browser.find_elements_by_xpath(
                emailSearch_path)  #Verifying search results
            self.assertEqual(emailSearch[0].text, '*****@*****.**')
            #if len(emailSearch) == 1 and (self.assertEqual(emailSearch[0].text,'*****@*****.**')):
            if len(emailSearch) == 1:
                print("pass")
            else:
                self.fail("Validation with Test Case No: TC1033 failed")
            logs.info("Test Case No : TC1033 Passed Successfully")
        except Exception:
            logs.error("Validation with Test Case No: TC1033 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: TC1033 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
    def test_Tenderdefaultitem(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()

            NewTender = tenderclass.TenderCreation(browser)
            time.sleep(3)
            browser = itemdetails.localtender(browser)  #Go to new tender
            time.sleep(1)
            #browser = itemdetails.estimatoritemdefault(browser) #Select Details from dropdown list
            #time.sleep(1)

            default_item = DataDriver()
            time.sleep(1)
            defaultitem_path = default_item.readfromXML(
                folder_path + '\Object\Itemsobject.xml', 'eTender',
                'defaultitem')
            defaultitem = browser.find_element_by_xpath(defaultitem_path)
            time.sleep(1)
            self.assertEqual(defaultitem.text, 'General works')

            logs.info("Test Case No : 100309 Passed Successfully")
            time.sleep(1)

        except Exception:
            logs.error("Validation with Test Case No: 100309 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100309 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
Esempio n. 4
0
 def test_verifycolleaguelist(self):
     try:
         browserInstance = setupValue()
         browser = browserInstance.setupfunction()
         browser.implicitly_wait(5)
         time.sleep(1)
         LauncheTender1 = LauncheTenderclass()
         browser = LauncheTender1.openURL(browser)
         browser = LauncheTender1.subcontractorValidlogin(browser)
         time.sleep(1)
         orgInstance=Organizationclass()
         orgInstance.OpenaddUser(browser)
         time.sleep(1)
         firstuser,seconduser = orgInstance.Userslist(browser)
         time.sleep(1)
         browser = LauncheTender1.list_Organisation(browser)
         time.sleep(1)
         browser = LauncheTender1.list_project(browser)
         tenderDetails = Tenderdetails()
         time.sleep(1)
         browser = tenderDetails.Subcontratorproject(browser)
         browser = tenderDetails.suppliertender(browser)
         itemDetails_actions = ItemDetails()
         time.sleep(1)
         browser = itemDetails_actions.moreactions(browser)
         time.sleep(1)
         browser = itemDetails_actions.invitecolleague(browser)
         time.sleep(1)
         currentorgemails1 = DataDriver()
         currentorgemails = []
         currentorgemails_path = currentorgemails1.readfromXML(folder_path+'\Object\Itemsobject.xml','eTender','currentorgemails')
         time.sleep(1)
         currentorgemails = browser.find_elements_by_xpath(currentorgemails_path) #Verifying current organisaion emails
         self.assertEqual(firstuser, currentorgemails[0].text)
         self.assertEqual(seconduser,currentorgemails[1].text)
         logs.info("Test Case No : TC1031 Passed Successfully")
     except Exception:
         logs.error("Validation with Test Case No: TC1031 failed")
         browser.save_screenshot(fullpath)
         traceback.print_exc(file=sys.stdout)
         self.fail("Test Case No: TC1031 failed")
         browser.implicitly_wait(5)
     finally:
         LauncheTender1.closebrowser(browser)
Esempio n. 5
0
 def test_invitecolleaguelink(self):
     try:
         browserInstance = setupValue()
         browser = browserInstance.setupfunction()
         browser.implicitly_wait(5)
         time.sleep(1)
         LauncheTender1 = LauncheTenderclass()
         browser = LauncheTender1.openURL(browser)
         browser = LauncheTender1.subcontractorValidlogin(browser)
         time.sleep(1)
         browser = LauncheTender1.list_project(browser)
         tenderDetails = Tenderdetails()
         time.sleep(1)
         browser = tenderDetails.Subcontratorproject(browser)
         browser = tenderDetails.suppliertender(browser)
         itemDetails_actions = ItemDetails()
         time.sleep(1)
         browser = itemDetails_actions.moreactions(browser)
         time.sleep(1)
         browser = itemDetails_actions.invitecolleague(browser)
         time.sleep(1)
         emailinvite1 = DataDriver()
         emailinvite_path = emailinvite1.readfromXML(
             folder_path + '\Object\Itemsobject.xml', 'eTender',
             'emailinvite')
         time.sleep(1)
         emailinvite = browser.find_element_by_xpath(
             emailinvite_path)  #Verifying option for email invite
         self.assertEqual(emailinvite.text,
                          'Email not in the list? Send invite directly')
         logs.info("Test Case No : TC1054 Passed Successfully")
     except Exception:
         logs.error("Validation with Test Case No: TC1054 failed")
         browser.save_screenshot(fullpath)
         traceback.print_exc(file=sys.stdout)
         self.fail("Test Case No: TC1054 failed")
         browser.implicitly_wait(5)
     finally:
         LauncheTender1.closebrowser(browser)
Esempio n. 6
0
    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_Tenderitemsimport(self):
        try:

            browserInstance = setupValue()
            browser = browserInstance.setupfunction()
            browser.implicitly_wait(5)
            time.sleep(1)

            setup = DataDriver()

            env = setup.readfromXML(folder_path + '\Env\Setup.xml', 'eTender',
                                    'browser')

            if env == 'firefox':
                LauncheTender1 = LauncheTenderclass()
                browser = LauncheTender1.openURL(browser)
                time.sleep(1)
                browser = LauncheTender1.estimatorValidlogin1(browser)
                time.sleep(5)
                tendertemplate = Tenderplans()
                tenderDetails = Tenderdetails()
                itemdetails = ItemDetails()

                browser = tenderDetails.Subcontratorproject(browser)
                time.sleep(2)
                tenderclass = TenderClass()

                browser = tendertemplate.estimatortenderpalntender(
                    browser
                )  #Go to new tenderE:\etender\TestScript\tenderitemsimport.py
                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.importlink(
                    browser)  #Click on Import link
                time.sleep(1)

                browser = itemdetails.importitems(
                    browser)  #Import Items from excel
                time.sleep(1)

                browser = itemdetails.additemsave(browser)  #Save item details
                time.sleep(1)

                importitems_excel = DataDriver()
                time.sleep(1)
                importitemsexcel_path = importitems_excel.readfromXML(
                    folder_path + '\Object\Itemsobject.xml', 'eTender',
                    'itemsintender')
                importitemsexcel = browser.find_elements_by_xpath(
                    importitemsexcel_path)
                time.sleep(1)
                self.assertEqual(importitemsexcel[1].text, 'GROUNDWORK')
                time.sleep(2)

                validateitemsexcel_path = importitems_excel.readfromXML(
                    folder_path + '\Object\Itemsobject.xml', 'eTender',
                    'itemdescription')
                validateitemsexcel = browser.find_element_by_xpath(
                    validateitemsexcel_path)
                time.sleep(1)
                self.assertEqual(validateitemsexcel.text, 'machine loading')
                time.sleep(2)

                logs.info("Test Case No : 100317 Passed Successfully")
                time.sleep(1)
            elif env == 'chrome':
                print(
                    "chrome does not support uploading documents using AUTOIT")

        except Exception:
            logs.error("Validation with Test Case No: 100317 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100317 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1 = LauncheTenderclass()
            LauncheTender1.closebrowser(browser)