コード例 #1
0
    def test_RFxsupplierquestionstabClick(self):
        try:
            browserInstance = setupValue()
            browser = browserInstance.setupfunction()
            LauncheTender1 = LauncheTenderclass()
            browser = LauncheTender1.openURL(browser)
            browser = LauncheTender1.subcontractorValidlogin(browser)
            browser = LauncheTender1.list_project(browser)
            tenderDetails = Tenderdetails()
            browser = tenderDetails.Subcontratorproject(browser)
            browser = tenderDetails.suppliersecondtender(browser)
            time.sleep(2)
            RFxAnswers = RFxQuestionnaire()

            browser = RFxAnswers.RFxQuestionsTabinsupplier(browser)
            time.sleep(2)

            RFxAnswerstab1 = DataDriver()
            time.sleep(1)
            RFxEstimatorQuestion_path = RFxAnswerstab1.readfromXML(folder_path+'\Object\RFx.xml','eTender','rfxanswer1')
            RFxEstimatorQuestion = browser.find_element_by_xpath(RFxEstimatorQuestion_path)
            time.sleep(1)

            self.assertEqual(RFxEstimatorQuestion.text,'1. Have you ISO Certified?')

            logs.info("Test Case No : 100291 Passed Successfully")
        except Exception:
            logs.error("Validation with Test Case No: 100291 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100291 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
コード例 #2
0
    def test_RFxsupplieransweruploadfiles(self):
        try:
            browserInstance = setupValue()
            browser = browserInstance.setupfunction()
            LauncheTender1 = LauncheTenderclass()
            browser = LauncheTender1.openURL(browser)
            browser = LauncheTender1.subcontractorValidlogin(browser)
            browser = LauncheTender1.list_project(browser)
            tenderDetails = Tenderdetails()
            browser = tenderDetails.Subcontratorproject(browser)
            browser = tenderDetails.suppliersecondtender(browser)
            time.sleep(2)
            RFxAnswers = RFxQuestionnaire()

            browser = RFxAnswers.RFxQuestionsTabinsupplier(browser)
            time.sleep(2)

            RFxAnswerstab1 = DataDriver()
            time.sleep(1)
            RFxEstimatorQuestion_path = RFxAnswerstab1.readfromXML(
                folder_path + '\Object\RFx.xml', 'eTender', 'rfxanswer1')
            RFxEstimatorQuestion = browser.find_elements_by_xpath(
                RFxEstimatorQuestion_path)
            time.sleep(1)

            self.assertEqual(RFxEstimatorQuestion[0].text,
                             '1. Have you ISO Certified?')
            self.assertEqual(RFxEstimatorQuestion[1].text,
                             '2. Do you have template format?')
            self.assertEqual(RFxEstimatorQuestion[2].text,
                             '3. Are you Big contractor or Small?')
            self.assertEqual(RFxEstimatorQuestion[3].text,
                             '4. Upload relevent files')

            RFxmultipleoptions_path = RFxAnswerstab1.readfromXML(
                folder_path + '\Object\RFx.xml', 'eTender',
                'radiobuttonoptions')
            RFxmultipleoptions = browser.find_elements_by_xpath(
                RFxmultipleoptions_path)
            time.sleep(1)

            ##            self.assertEqual(RFxmultipleoptions[0].text,'Yes')
            ##            self.assertEqual(RFxmultipleoptions[1].text,'No')
            ##
            ##            self.assertEqual(RFxmultipleoptions[2].text,'No')
            ##            self.assertEqual(RFxmultipleoptions[3].text,'Yes')

            #browser = RFxAnswers.uploadFile(browser)
            #time.sleep(2)

            logs.info("Test Case No : 100291 Passed Successfully")
        except Exception:
            logs.error("Validation with Test Case No: 100291 failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: 100291 failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
コード例 #3
0
    def test_RFxQuestionsrequired(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(1)
            tenderDetails = Tenderdetails()
            time.sleep(1)
            browser = tenderDetails.Subcontratorproject(browser)
            time.sleep(2)
            browser = tenderDetails.estimatortender1(browser)
            time.sleep(2)

            RFxQuestions = RFxQuestionnaire()

            browser = RFxQuestions.RFxQuestionsTab(browser)
            time.sleep(2)

            RFxaddquestion1 = DataDriver()
            time.sleep(1)
            RFxaddquestion_path = RFxaddquestion1.readfromXML(
                folder_path + '\Object\RFx.xml', 'eTender', 'addquestion')
            RFxaddquestion = browser.find_element_by_xpath(RFxaddquestion_path)
            time.sleep(1)
            self.assertEqual(RFxaddquestion.text, 'Add question')

            addquestionserialnum_path = RFxaddquestion1.readfromXML(
                folder_path + '\Object\RFx.xml', 'eTender',
                'addquestionserialnum')
            addquestionserialnum = browser.find_element_by_xpath(
                addquestionserialnum_path)
            time.sleep(1)
            self.assertEqual(addquestionserialnum.text, '1.')

            RFxcheckboxes_path = RFxaddquestion1.readfromXML(
                folder_path + '\Object\RFx.xml', 'eTender', 'checkboxes')
            RFxcheckboxes = browser.find_elements_by_xpath(RFxcheckboxes_path)
            time.sleep(1)
            self.assertEqual(RFxcheckboxes[0].text,
                             'Additional response required')
            self.assertEqual(RFxcheckboxes[1].text, 'Required')

            logs.info("Test Case No : RFX Passed Successfully")
            time.sleep(1)
        except Exception:
            logs.error("Validation with Test Case No: RFX failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: RFX failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
コード例 #4
0
    def test_RFxaddQuestionfileupload(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(1)
            tenderDetails = Tenderdetails()
            time.sleep(1)
            browser = tenderDetails.Subcontratorproject(browser)
            time.sleep(2)
            browser = tenderDetails.estimatortender1(browser)
            time.sleep(2)

            RFxQuestions = RFxQuestionnaire()

            browser = RFxQuestions.RFxQuestionsTab(browser)
            time.sleep(2)

            browser = RFxQuestions.RFxAddQuestions(browser)
            time.sleep(2)

            browser = RFxQuestions.RFxFileupload(browser)
            time.sleep(2)

            browser = RFxQuestions.selectdropdown(browser)
            time.sleep(2)

            browser = RFxQuestions.selectFileupload(browser)
            time.sleep(2)

            browser = RFxQuestions.SaveRFxquestions(browser)
            time.sleep(2)

            RFxupload = DataDriver()
            time.sleep(1)
            disabledpathforuploadfile = browser.find_elements_by_xpath(
                RFxupload.readfromXML(folder_path + '\Object\RFx.xml',
                                      'eTender', 'disabled'))
            time.sleep(1)

            if disabledpathforuploadfile[3].is_displayed():
                print "Textbox for upload file is disabled after saving details"
            else:
                self.fail("Upload file Question not saved")

            logs.info("Test Case No : RFX Passed Successfully")
            time.sleep(1)
        except Exception:
            logs.error("Validation with Test Case No: RFX failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: RFX failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
コード例 #5
0
    def test_RFxaddQuestionmultiplechoice(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(1)
            tenderDetails = Tenderdetails()
            time.sleep(1)
            browser = tenderDetails.Subcontratorproject(browser)
            time.sleep(2)
            browser = tenderDetails.estimatortender1(browser)
            time.sleep(2)

            RFxQuestions = RFxQuestionnaire()

            browser = RFxQuestions.RFxQuestionsTab(browser)
            time.sleep(2)

            browser = RFxQuestions.RFxAddQuestions(browser)
            time.sleep(2)

            browser = RFxQuestions.RFxMultiplechoice(browser)
            time.sleep(2)

            browser = RFxQuestions.selectdropdown(browser)
            time.sleep(2)

            browser = RFxQuestions.selectMultiplechoice(browser)
            time.sleep(2)

            browser = RFxQuestions.selectoptiontemplatedropdown(browser)
            time.sleep(2)

            browser = RFxQuestions.optiontemplatechoice(browser)
            time.sleep(2)

            browser = RFxQuestions.SaveRFxquestions(browser)
            time.sleep(2)

            templateoptions = DataDriver()
            time.sleep(1)
            templateoption = browser.find_elements_by_xpath(
                templateoptions.readfromXML(folder_path + '\Object\RFx.xml',
                                            'eTender', 'templateoptions'))
            time.sleep(1)

            self.assertEqual(templateoption[0].text, 'Yes')
            self.assertEqual(templateoption[1].text, 'No')

            logs.info("Test Case No : RFX Passed Successfully")
            time.sleep(1)
        except Exception:
            logs.error("Validation with Test Case No: RFX failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: RFX failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)
コード例 #6
0
    def test_RFxaddQuestiontextresponseMandatoty(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(1)
            tenderDetails = Tenderdetails()
            time.sleep(1)
            browser = tenderDetails.Subcontratorproject(browser)
            time.sleep(2)
            browser = tenderDetails.estimatortender1(browser)
            time.sleep(2)

            RFxQuestions = RFxQuestionnaire()

            browser = RFxQuestions.RFxQuestionsTab(browser)
            time.sleep(2)

            browser = RFxQuestions.RFxTextresponse(browser)
            time.sleep(2)

            browser = RFxQuestions.selectdropdown(browser)
            time.sleep(2)

            browser = RFxQuestions.selecttextresponse(browser)
            time.sleep(2)

            browser = RFxQuestions.textresponserequired(browser)
            time.sleep(2)

            browser = RFxQuestions.SaveRFxquestions(browser)
            time.sleep(2)

            RFxsavequestion = DataDriver()
            time.sleep(1)
            disabledpath = browser.find_element_by_xpath(RFxsavequestion.readfromXML(folder_path+'\Object\RFx.xml','eTender','disabled'))
            time.sleep(1)
            if disabledpath.is_displayed():
                print"Textbox is disabled after saveing details"
            else:
                self.fail("Questions not saved")

            successmessage = browser.find_element_by_xpath(RFxsavequestion.readfromXML(folder_path+'\Object\RFx.xml','eTender','successmessageforquestions'))
            time.sleep(1)

            self.assertEqual(successmessage.text,'Tender Questionnaire saved.')

            logs.info("Test Case No : RFX Passed Successfully")
            time.sleep(1)
        except Exception:
            logs.error("Validation with Test Case No: RFX failed")
            browser.save_screenshot(fullpath)
            traceback.print_exc(file=sys.stdout)
            self.fail("Test Case No: RFX failed")
            browser.implicitly_wait(5)
        finally:
            LauncheTender1.closebrowser(browser)