예제 #1
0
 def test_register_MS(self):
     '''绑定中国民生银行卡测试用例'''
     convergedPage=ConvergedPage(self.driver)
     myBankCardPage,user_card=convergedPage.register_bankcard('MS')
     self.logger.info('run case:RegisterBankCard.test_register_MS user_card is %s'%user_card)
     self.assertEqual(myBankCardPage.el_bankName_listOne.text,"中国民生银行")
     self.assertEqual(myBankCardPage.el_bankWeihao_listOne.text[-5:-1],user_card[-4:])
     myBankCardPage.saveScreenshot('test_register_MS')
예제 #2
0
    def test_converged(self):
        convergedPage = ConvergedPage(self.driver)
        (user_phone, user_pwd) = convergedPage.register_customer()

        self.driver = appium_init.inital.get_driver()
        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()
        homePage = loginPage.logic_login(user_phone, user_pwd)

        myPage = homePage.click_el_my_btn()
        # 点击浮层
        time.sleep(1)
        myPage.el_tv_know.click()
        # 断言代码
        myPersonalCenterPage = myPage.logic_link_myCenter()
        myPersonalCenterPage.saveScreenshot('myPersonalCenterPage')
예제 #3
0
    def test_buy_Beauti(self):
        '''购买美丽田园测试用例'''
        convergedPage=ConvergedPage(self.drvier)
        (user_phone,pwd)=convergedPage.register_customer()

        amount='100000'

        self.drvier=appium_init.inital.get_driver()
        startupPage = StartupPage(self.drvier)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()
        homePage = loginPage.logic_login(user_phone, pwd)
        # 点击一次理财产品元素,过滤蒙层
        homePage.el_product_btn.click()
        time.sleep(0.5)
        productListPage = homePage.logic_link_product()
        time.sleep(2)
        productListPage.swipe_to_up()
        time.sleep(2)
        productBeautiPage = productListPage.logic_link_beauti()
        buyInsertMoneyPage=productBeautiPage.logic_link_buy()


        buyConfirmPage = buyInsertMoneyPage.logic_buy_product(amount)
        buyTradeResultPage = buyConfirmPage.logic_confirm_info(pwd)
        time.sleep(20)
        homePage = buyTradeResultPage.logic_link_buy()
        myPage = homePage.logic_buy_my_btn()

        # 数据库断言,查询投资记录最新的记录根据金额判断
        SQL = "select top(1) m.new_managemoney,m.new_product_name from dbo.Account t,dbo.new_investdetail m where t.name=m.new_accountnameName and t.new_telephone1=%s ORDER BY m.CreatedOn DESC" % (
            user_phone)
        sql_conn = Exce_SQLserver()

        sql_result=sql_conn.execSql_getOne(SQL)
        sql_amount = int(sql_result[0])
        sql_product_name=str(sql_result[1])

        buyTradeResultPage.saveScreenshot('test_buy_Beauti')
        self.assertEqual(int(amount), sql_amount)

        self.logger.info("run case:test_buy_Beauti user_phone is %s,product_name is %s" %(user_phone,sql_product_name))
        self.assertEqual("夸客美丽*360天", sql_product_name)
예제 #4
0
    def test_private_fund_details(self):
        """私募预约-私密预约验证"""

        convergedPage = ConvergedPage(self.driver)
        (user_phone, pwd) = convergedPage.register_customer()

        self.driver = appium_init.inital.get_driver()
        entry_page = Entry_page(self.driver,phone=user_phone,pwd=pwd)

        private_Offering_Fund_Page = entry_page.open_Private_Offering_Fund_Page()
        private_Offering_Fund_Page.el_Popup_btn.click()
        private_Fund_Details_Page=private_Offering_Fund_Page.logic_private_fund_lis_click()
        private_Fund_Details_Page.el_input_consultation.click()
        private_Fund_Details_Page.el_input_password.send_keys(pwd)
        private_Fund_Details_Page.el_input_btn.click()
        message=private_Fund_Details_Page.el_text_message_text.text
        private_Fund_Details_Page.el_confirm_btn.click()

        entry_page.saveScreenshot("private_fund_details")

        self.assertEquals("您已预约咨询本产品,理财经理会尽快与您联系,谢谢!",message)
예제 #5
0
    def test_buy_van_Gogh180(self):
        '''购买梵高计划180天脚本,和buy_prodouct_info.xlsx数据源对应'''

        user_phone = self.inital.buyProduct_info['van_Gogh180']['phone']
        pwd = self.inital.buyProduct_info['van_Gogh180']['pwd']
        amount = self.inital.buyProduct_info['van_Gogh180']['amount']
        times = self.inital.buyProduct_info['van_Gogh180']['times']
        exec_flag = self.inital.buyProduct_info['van_Gogh180']['exec']
        load_create = self.inital.buyProduct_info['van_Gogh180']['load_create']

        if amount == "" or times == "" or exec_flag == "" or load_create == "":
            self.logger.info(
                "BuyProductScriptVanGogh.test_buy_van_Gogh180: buy_info excel parms is wrong!"
            )
            return "buy_info excel parms is wrong!"

        elif exec_flag == 'N' or times == '0':
            self.logger.info(
                'BuyProductScriptVanGogh.test_buy_van_Gogh180: do not buy product van_Gogh180!'
            )
            return "do not buy product van_Gogh180!"

        if load_create == 'N':
            self.driver = self.inital.get_driver()
            convergedPage = ConvergedPage(self.driver)
            user_phone, pwd = convergedPage.register_customer()

        elif load_create == "Y" and (user_phone == "" or pwd == ""):
            self.logger.info(
                "BuyProductScriptVanGogh.test_buy_van_Gogh180: user_phone pwd value can not be null!"
            )
            return "BuyProductScriptVanGogh.test_buy_van_Gogh180: user_phone pwd value can not be null!"

        for i in xrange(int(times)):
            try:
                self.driver = self.inital.get_driver()
                startupPage = StartupPage(self.driver)
                homePage = startupPage.page_swipe()
                loginPage = homePage.logic_link_login_page()
                homePage = loginPage.logic_login(user_phone, pwd)
                # 点击一次理财产品元素,过滤蒙层
                homePage.el_product_btn.click()
                time.sleep(0.5)
                productListPage = homePage.logic_link_product()
                productVanGoghPage = productListPage.logic_link_van_Gogh()
                productVanGoghPage.logic_choose_product_type(1)

                buyInsertMoneyPage = productVanGoghPage.logic_link_buy()

                buyConfirmPage = buyInsertMoneyPage.logic_buy_product(amount)
                buyTradeResultPage = buyConfirmPage.logic_confirm_info(pwd)
                time.sleep(20)
                homePage = buyTradeResultPage.logic_link_buy()
                myPage = homePage.logic_buy_my_btn()
                SQL = "select top(1) m.new_managemoney,m.new_name from dbo.Account t,dbo.new_investdetail m where t.name=m.new_accountnameName and t.new_telephone1=%s ORDER BY m.CreatedOn DESC" % (
                    user_phone)
                sql_conn = Exce_SQLserver()

                sql_result = sql_conn.execSql_getOne(SQL)
                sql_amount = int(sql_result[0])
                sql_productNo = str(sql_result[1])

                self.logger.info(
                    "BuyProductScriptVanGogh.test_buy_van_Gogh180:run {one} time;"
                    "phone is {two};"
                    "pwd is {three};"
                    "product is {four};"
                    "amount is {five}".format(one=(i + 1),
                                              two=user_phone,
                                              three=pwd,
                                              four=sql_productNo,
                                              five=sql_amount))
            except Exception as e:
                self.logger.info("buy_van_Gogh180 failed!" + str(e))
            finally:
                self.driver.quit()