示例#1
0
    def test_delete_bankcard_MS(self):
        '''删除中国民生银行测试用例'''
        user_name='ufo83'
        user_phone='14488888083'
        user_pwd='123456q'
        cardNO=Create_Data.get_bank_card_ms()
        bankType='MS'

        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()

        myBankCardPage=myPage.logic_my_bankCard_click()
        registerAddCardPage=myBankCardPage.logic_addCard_click()
        myBankCardPage=registerAddCardPage.logic_insert_bankCard_INFO(user_name,user_phone,cardNO,bankType)
        bankName=myBankCardPage.el_bankName_listOne.text
        self.logger.info('run case:RegisterBankCard.test_delete_bankcard_MS bankName={one}  cardNo={two}'.format(one=bankName,two=cardNO))
        self.assertEqual(bankName,u'中国民生银行')

        bankCardInfoPage=myBankCardPage.logic_link_bankcardInfo_page()
        myBankCardPage=bankCardInfoPage.logic_delete_bankcard(user_pwd)
        myBankCardPage.saveScreenshot("RegisterBankCard.test_delete_bankcard_MS")
        self.assertEqual(myBankCardPage.el_bankcard_ms,None)
示例#2
0
    def test_buy_greenHand_secondtime(self):
        '''已经有理财记录的账号,再次购买新手标测试用例'''
        user_phone = self.inital.excel_info['quarkZX90']['phone']
        pwd = self.inital.excel_info['quarkZX90']['pwd']
        amount = '100000'

        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(3)
        productListPage.swipe_to_up()
        productGreenHandPage = productListPage.logic_link_greenHand()
        # productGreenHandPage.get_screenshot_by_element(productGreenHandPage,'el_buy_btn',False)
        result = productGreenHandPage.get_screenshot_by_element(
            productGreenHandPage, 'el_buy_btn').same_as(30)
        productGreenHandPage.saveScreenshot('test_buy_greenHand_secondtime')
        self.logger.info(
            "run case:test_buy_greenHand_secondtime user_phone is %s" %
            user_phone)
        self.assertEqual(result, True)
示例#3
0
 def test_non_login_state_clickFund(self):
     '''非登录状态点击基金列表'''
     startupPage = StartupPage(self.driver)
     homePage = startupPage.page_swipe()
     productListPage = homePage.logic_link_product()
     loginPage = productListPage.logic_nologin_state_fund()
     page_title = loginPage.el_title.text
     loginPage.saveScreenshot('test_non_login_state_clickFund')
     self.logger.info("run case:case_login.test_non_login_state_clickFund")
     self.assertEqual(page_title, u'登录')
示例#4
0
    def test_click_banner1(self):
        u"""验证banner[1]"""

        startUp = StartupPage(self.driver)
        homepage = startUp.page_swipe()
        b = homepage.banner_click(id=1)
        time.sleep(3)
        self.logger.info(b.el_title.text)
        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('click_banner1')
        self.logger.info(self.assertEqual(b.el_title.text, u"系统维护"))
示例#5
0
    def test_click_banner5(self):
        u"""验证banner[5]"""
        # id:输入需要验证的banner 索引ID
        # assertEqual 输入预期的banner详情的title

        startUp = StartupPage(self.driver)
        homepage = startUp.page_swipe()
        b = homepage.banner_click(id=5)
        time.sleep(3)
        self.logger.info(b.el_title.text)
        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('click_banner5')
示例#6
0
 def openpage(self):
     
     
     startupPage = StartupPage(self.driver)
     homepage = startupPage.page_swipe()
     loginPage = homepage.logic_link_login_page()
     homepage = loginPage.logic_login()
     mypage = homepage.click_el_my_btn()
     mypage.el_tv_know.click()
     myinvsetrecorepage=mypage.click_my_investmentRecord()
     myinvsetrecorepage.el_tv_know.click()
     return  myinvsetrecorepage
示例#7
0
    def test_non_login_state_clickMyPage(self):
        '''非登录状态点击“我的”按钮测试用例'''
        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()

        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('non_login_state_clickMyPage')
        self.logger.info(
            "run case:case_login.test_non_login_state_clickMyPage")
        self.assertTrue(loginPage.element_is_exsit(
            loginPage.el_pwd_text_input))
示例#8
0
    def test_non_login_state_clickBuy(self):
        '''非登录态点击“立即投资”按钮测试用例'''
        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        productListPage = homePage.logic_link_product()
        productQuarkzxPage = productListPage.logic_link_quarkZX()
        loginPage = productQuarkzxPage.logic_noLogin_state_buy()

        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('non_login_state_clickBuy')
        self.logger.info("run case:case_login.test_non_login_state_clickBuy")
        self.assertTrue(
            loginPage.element_is_exsit(loginPage.el_phone_text_input))
示例#9
0
 def test_non_login_state_calculation(self):
     '''非登录状态点击理财计算器测试用例'''
     startupPage = StartupPage(self.driver)
     homePage = startupPage.page_swipe()
     productListPage = homePage.logic_link_product()
     productQuarkzxPage = productListPage.logic_link_quarkZX()
     productCalculationPage = productQuarkzxPage.logic_link_calculation_Page(
     )
     page_title = productCalculationPage.el_title.text
     productCalculationPage.saveScreenshot(
         'test_non_login_state_calculation')
     self.logger.info(
         "run case:case_login.test_non_login_state_calculation")
     self.assertEqual(page_title, '理财计算器')
示例#10
0
    def register_customer(self):
        user_phone = Create_Data().get_phone()
        user_name = Create_Data().get_name()
        user_id = Create_Data.get_identification()
        user_email = Create_Data.get_random_mail()
        user_card = Create_Data.get_bank_card_zg()
        user_pwd = '123456q'
        bankType = "ZG"

        # user_phone='14488888083'
        # user_name='ufo83'
        # user_id=Create_Data.get_identification()
        # user_email=Create_Data.get_random_mail()
        # user_card=Create_Data.get_bank_card_js()
        # user_pwd='123456q'

        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()
        registerChoosePage = loginPage.logic_link_register()
        registerSmsPage = registerChoosePage.logic_link_new_user()
        registerPasswordPage = registerSmsPage.logic_entry_info(user_phone)
        registerReferencePage = registerPasswordPage.logic_entry_pwd()
        registerPatternlockPage = registerReferencePage.logic_link_hulue()
        registerIdentityAuthPage = registerPatternlockPage.logic_drawGestureCode(
        )
        homePage = registerIdentityAuthPage.logic_entry_user_info(
            user_name, user_id, user_email)

        homePage.el_my_btn.click()
        myPage = homePage.click_el_my_btn()

        #点击浮层
        myPage.el_tv_know.click()
        myBankCardPage = myPage.logic_my_bankCard_click()
        registerAddCardPage = myBankCardPage.logic_addCard_click()
        myBankCardPage = registerAddCardPage.logic_insert_bankCard_INFO(
            user_name, user_phone, user_card, bankType)
        self.driver.quit()
        appium_init.inital.logger.info(
            'ConvergedPage: userName={one};phone={two};pwd={three};identification={four};bankType={five};cardNo={six}'
            .format(one=user_name,
                    two=user_phone,
                    three=user_pwd,
                    four=user_id,
                    five=bankType,
                    six=user_card))
        return (user_phone, user_pwd)
示例#11
0
    def test_procedure(self):
        '''我的按钮截图对比测试用例'''

        startuppage = StartupPage(self.driver)
        time.sleep(3)
        homepage = startuppage.page_swipe()
        homepage.el_product_btn.click()
        # homepage.get_screenshot_by_element(homepage,"el_home_btn",False)
        result = homepage.get_screenshot_by_element(homepage,
                                                    "el_my_btn").same_as(30)
        # self.driver.save_screenshot("E:\\quark_work\\result\\2017-05-31\\image\\2017-05-31\\" +"test_procedure11"+'.png')

        self.basepage = BasePage(self.driver)
        # if result != False:
        self.basepage.saveScreenshot('procedure')
        time.sleep(2)
示例#12
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')
示例#13
0
    def test_delete_card(self):
        user_name = 'ufo83'
        user_phone = '14488888083'
        user_pwd = '123456q'

        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()

        myBankCardPage = myPage.logic_my_bankCard_click()
        bankCardInfoPage = myBankCardPage.logic_link_bankcardInfo_page()
        bankCardInfoPage.el_delete_btn.click()
        time.sleep(5)
示例#14
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)
示例#15
0
    def test_buy_annualInterestRise(self):
        '''购买年年生利用例'''
        user_phone = self.inital.excel_info['annualInterestRise']['phone']
        pwd = self.inital.excel_info['annualInterestRise']['pwd']
        amount = self.inital.excel_info['annualInterestRise']['amount']

        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(1)
        productListPage.swipe_to_up()
        time.sleep(1)
        productAnnualInterestRisePage = productListPage.logic_link_annualInterestRise(
        )
        buyInsertMoneyPage = productAnnualInterestRisePage.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_annualInterestRise')
        self.assertEqual(int(amount), sql_amount)
        self.logger.info(
            "run case:ProductBuyAnnualInterestRise.test_buy_annualInterestRise user_phone is %s,product_name is %s"
            % (user_phone, sql_product_name))
        self.assertEqual("年年生利*360天", sql_product_name)
示例#16
0
    def test_new_customer(self):
        '''注册新客户,并在我的个人中心,根据手机号断言'''
        user_phone = Create_Data().get_phone()
        user_name = Create_Data().get_name()
        user_id = Create_Data.get_identification()
        user_email = Create_Data.get_random_mail()

        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()
        registerChoosePage = loginPage.logic_link_register()
        registerSmsPage = registerChoosePage.logic_link_new_user()
        registerPasswordPage = registerSmsPage.logic_entry_info(user_phone)
        registerReferencePage = registerPasswordPage.logic_entry_pwd()
        registerPatternlockPage = registerReferencePage.logic_link_hulue()
        registerIdentityAuthPage = registerPatternlockPage.logic_drawGestureCode(
        )
        homePage = registerIdentityAuthPage.logic_entry_user_info(
            user_name, user_id, user_email)

        homePage.el_my_btn.click()
        myPage = homePage.click_el_my_btn()

        #点击浮层
        myPage.el_tv_know.click()

        #断言代码
        myPersonalCenterPage = myPage.logic_link_myCenter()
        phone_text = myPersonalCenterPage.el_phone_text.text
        phone_secret = user_phone[:3] + '****' + user_phone[7:]

        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('new_customer')
        self.assertEqual(phone_text, phone_secret)
        self.logger.info(
            "userinfo:phone-{phone} name-{name} id-{id} email-{email}".format(
                phone=user_phone, name=user_name, id=user_id,
                email=user_email))
示例#17
0
    def test_login_success(self):
        '''登录成功测试用例'''
        user_phone = '14488888098'
        pwd = 'qwe123'

        startupPage = StartupPage(self.driver)
        homePage = startupPage.page_swipe()
        loginPage = homePage.logic_link_login_page()
        homePage = loginPage.logic_login(user_phone, pwd)

        myPage = homePage.click_el_my_btn()
        # 点击浮层
        time.sleep(1)
        myPage.el_tv_know.click()
        # 断言代码
        myPersonalCenterPage = myPage.logic_link_myCenter()
        phone_text = myPersonalCenterPage.el_phone_text.text
        phone_secret = user_phone[:3] + '****' + user_phone[7:]

        self.basepage = BasePage(self.driver)
        self.basepage.saveScreenshot('login_success')
        self.logger.info("run case:case_login.test_login_success")
        self.assertEqual(phone_text, phone_secret)
示例#18
0
    def test_buy_quarkZX90(self):
        '''购买夸客尊享90天测试用例'''
        user_phone=self.inital.excel_info['quarkZX90']['phone']
        pwd=self.inital.excel_info['quarkZX90']['pwd']
        amount=self.inital.excel_info['quarkZX90']['amount']

        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()
        productQuarkzxPage=productListPage.logic_link_quarkZX()
        productQuarkzxPage.logic_choose_product_type(3)
        buyInsertMoneyPage=productQuarkzxPage.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])

        self.basepage = BasePage(self.drvier)
        self.basepage.saveScreenshot('buy_quarkZX90')
        self.assertEqual(int(amount),sql_amount)
        self.assertEqual("夸客尊享*90天",sql_product_name)
        self.logger.info("run case:test_buy_quarkZX90")
示例#19
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()
示例#20
0
        return NewsContractDetailsPage(self.driver)

    def get_el_Contracts_title(self):
        """
        :return: 合同列表页面 title
        """
        try:
            return self.el_Contracts_title.text
        except AttributeError, e:
            self.logger.debug('LoginTest | exception is %s' % e)
            # self.driver.quit()


if __name__ == '__main__':
    Init()
    driver = appium_init.inital.get_driver()
    from pages.startup_page import StartupPage
    startupPage = StartupPage(driver)
    homepage = startupPage.page_swipe()

    loginPage = homepage.logic_link_login_page()
    homepage = loginPage.logic_login()
    time.sleep(1)
    newspage = homepage.click_el_news_img()

    NewsContractsPage = newspage.click_el_contract_message_btn()

    print NewsContractsPage.test(1)

    #NewsContractsPage.click_el_check_pact_btn()
示例#21
0
 def open_start_home_page(self):
     startupPage = StartupPage(self.driver)
     homepage = startupPage.page_swipe()
     return homepage