def setUp(self):

        logger.info("测试前准备.")
        self.__driver = browser(glo.GLO_BROWSER_TYPE)
        PMCloudIndexActions(self.__driver).login()
        PMCloudLoginActions(self.__driver).pmcloudLogin()
        ApptenantActions(self.__driver).apptenantLogin()
        WorkbenchActions(self.__driver).clickContactType()
        self.contacttype_page = ContactTypeActions(self.__driver)
Exemple #2
0
    def setUp(self):

        logger.info("测试前准备.")
        self.__driver = browser(glo.GLO_BROWSER_TYPE)

        PMCloudIndexActions(self.__driver).openPMCloudIndex()
        PMCloudIndexActions(self.__driver).clickLoginButton()
        PMCloudLoginActions(self.__driver).pmcloudLogin()
        ApptenantActions(self.__driver).apptenantLogin()
        WorkbenchActions(self.__driver).clickProject()
        WorkbenchActions(self.__driver).switchToIframe()
Exemple #3
0
    def setUpClass(cls):
        logger.info("测试前准备.")
        cls.__driver = browser(glo.GLO_BROWSER_TYPE)
        PMCloudIndexActions(cls.__driver).login()
        PMCloudLoginActions(cls.__driver).pmcloudLogin()
        ApptenantActions(cls.__driver).apptenantLogin()
        WorkbenchActions(cls.__driver).clickContactType()

        # 提前新建好联系类型
        cls.contacttype_page = ContactTypeActions(cls.__driver)
        cls.contacttype_page.clickAddContactTypeCancelButton()
        cls.contacttype_page.saveAddContactType()
        cls.contacttype_page.clickAddContactTypeCancelButton()
Exemple #4
0
    def setUp(self):

        logger.info("测试前准备.")
        self.__driver = browser(glo.GLO_BROWSER_TYPE)

        PMCloudIndexActions(self.__driver).openPMCloudIndex()
        PMCloudIndexActions(self.__driver).clickLoginButton()
        PMCloudLoginActions(self.__driver).pmcloudLogin()
        ApptenantActions(self.__driver).apptenantLogin()
        WorkbenchActions(self.__driver).clickProject()
        WorkbenchActions(self.__driver).switchToIframe()
        ProjectActions(self.__driver).saveCreateProject()
        ProjectActions(self.__driver).closeListToast()
        ProjectActions(self.__driver).selectFirstProject()
        ProjectActions(self.__driver).clickEnterpriseButton()
Exemple #5
0
    def test_apptenant_login_error(self):
        """企业帐号验证不通过"""

        apptenant_page = ApptenantActions(self.driver)

        if apptenant_page.getApptenantTitle() == "企业帐号":

            expected_select_text = "友工程正式环境测试租户001error"

            apptenant_page.clickSelect()
            result_select_text = apptenant_page.getSelectApptenantText()
            apptenant_page.clickApptenant()
            apptenant_page.clickOKButton()

            self.assertEqual(
                expected_select_text,
                result_select_text,
                msg="测试不通过, 期望结果为: {expect}, 实际结果为: {result}.".format(
                    expect=expected_select_text, result=result_select_text))
    def test_login_success(self):
        """登录成功"""

        logger.info("执行TestLogin_test_login_success测试用例.")
        expected_result = "孙旭冉"

        index_page = PMCloudIndexActions(self.__driver)
        index_page.openPMCloudIndex()
        index_page.clickLoginButton()

        login_page = PMCloudLoginActions(self.__driver)
        login_page.pmcloudLogin()

        apptenant_page = ApptenantActions(self.__driver)
        apptenant_page.apptenantLogin()

        self.workbench_page = WorkbenchActions(self.__driver)
        result = self.workbench_page.getCurrentUser()

        self.assertEqual(expected_result,
                         result,
                         msg="测试不通过,期望结果为:{expect}, 实际结果为:{result}.".format(
                             expect=expected_result, result=result))