def is_login(self):
     """
     判断是否登录
     :param driver:
     :return:
     """
     hp = HomePage(self.driver)
     try:
         hp.get_logout_btn()
         return True
     except Exception as e:
         return False
Exemple #2
0
 def test_invest_success(self,login_driver,data):
     self.log.info("====={}开始测试=====".format(data['title']));
     allure.dynamic.title(data['title']);
     self.driver = login_driver;
     #保证执行前是在Home页面
     self.driver.get(self.setting.PROJECT_HOST_VUE);
     #选择一个标
     hp = HomePage(self.driver).invest_first_bid();
     user_blance_before_invest = self.get_user_amonut();
     # 标的投资前余额
     bid_blance_before_invest = self.get_bid_amount();
     #进行投资
     bp = BidPage(self.driver).invest(**data['request_data']);
     #断言
     self.beidouxing_assert(check_data=data['check_data'],msg=data['title']);
     #sql校验
     #获取投资后金额
     self.driver.refresh();#刷新页面
     user_blance_after_amount = self.get_user_amonut();
     bid_blance_after_amount = self.get_bid_amount();
     #断言
     # 用户投资前余额-用户投资后余额 = 投资金额
     self.assert_equal((user_blance_before_invest-user_blance_after_amount),Decimal(data['request_data']['amount']))
     #获取标的投资钱
     #标的投资前余额-标的投资后余额 = 投资金额
     self.assert_equal((bid_blance_before_invest-bid_blance_after_amount),Decimal(data['request_data']['amount']));
Exemple #3
0
    def test_invest_fail(self,login_driver,data):
        allure.dynamic.title(data['title']);
        login_driver.get(self.setting.PROJECT_HOST_VUE);
        self.driver = login_driver;
        #选择一个标,进入表的详情页面
        hp = HomePage(self.driver).invest_first_bid();
        #进行投资
        bp = BidPage(self.driver).invest(**data['request_data']);

        #断言
        self.beidouxing_assert(data['check_data'],msg=data['title']);
Exemple #4
0
    def test_invest_fail_notIsten(self,data,login_driver):
        pass;
        self.log.info("====={}:开始测试=====".format(data['title']));
        allure.dynamic.title(data['title']);
        #保持项目在首页
        self.driver = login_driver;
        self.driver.get(self.setting.PROJECT_HOST_VUE);

        hp = HomePage(self.driver).invest_first_bid();
        bp = BidPage(self.driver).invest_notIsten(**data['request_data']);
        # 断言
        self.beidouxing_assert(check_data=data['check_data'],msg=data['title'])
        self.log.info("====={}:结束测试=====".format(data['title']));
Exemple #5
0
 def test_login_04(self,driver):
     lp = LoginPage(driver=driver);
     lp.login(username=self.setting.TEST_NORAML_USERNAME,password=self.setting.TEST_NORAML_PASSWORD);
     hp = HomePage(driver=driver);
     assert True == hp.get_logout_btn()
Exemple #6
0
 def test_03(self, driver):
     LoginPage(driver).login(username=setting.TEST_NORAML_USERNAME,
                             password=setting.TEST_NORAML_PASSWORD)
     sleep(3)
     assert True == HomePage(driver).get_logout_btn()