Exemplo n.º 1
0
            self.click_button(papaandroid.b_forgetpwd)
            self.send_keys(papaandroid.tx_assertforgetpwd, '11')
            self.click_button(papaandroid.b_finish)
            self.assertTrue(self.isElement(papaandroid.tx_assertforgetpwd))
            print("无法点击完成按钮正确")
            self.back()

    def test_old5(self):
        """“在找回密码页面输入密码,验证码,图形验证码,点击完成""" ''
        td_login = dataprovide.fetchTestData(4, 'login', 0, '6', '')
        for i in range(len(td_login)):
            print('------------------------------')
            self.send_keys(papaandroid.edit_iphone,
                           dataprovide.dict_gen(td_login)[i + 1]['iphone'])
            self.click_button(papaandroid.b_next)
            self.click_button(papaandroid.b_forgetpwd)
            self.send_keys(papaandroid.edit_register_cet_pwd, '123456')
            self.send_keys(papaandroid.edit_register_cet_img_code, '1')
            self.send_keys(papaandroid.edit_register_cet__code2, '1')
            self.click_button(papaandroid.b_finish)
            self.assertTrue(self.isElement(papaandroid.tx_papa))
            print("无法点击完成按钮正确")


if __name__ == '__main__':
    main_package.main_package(Case("test_old1"), "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_old2"), "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_old3"), "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_old4"), "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_old5"), "/Users/xygjzgs/selenium/")
Exemplo n.º 2
0
from element_locator import papaandroid

sys.path.append("..")
import unittest
from time import sleep


class Case(TK_papaandroid.Task, TK_TerminalHandle.TerminalHandle,
           unittest.TestCase):
    #首次注册用户,已填写资料认证,进行转卖流程
    def test_saling(self):
        """“首次注册用户,已填写资料认证,进行转卖流程""" ''
        self.pop_close()
        self.login('new')
        self.click_button(papaandroid.b_good)
        self.click_button(papaandroid.b_hotProduct)
        self.click_button(papaandroid.b_resell)
        if self.isElement(papaandroid.b_know) == True:
            print("弹出转卖换钱规则解释浮层")
            self.click_button(papaandroid.b_know)
            self.click_button(papaandroid.b_resell)
            self.assertTrue(self.isElement(papaandroid.tx_orderDetails))
            print("无转卖换钱规则解释,进入确认转卖(订单详情)页面")
        else:
            self.assertTrue(self.isElement(papaandroid.tx_orderDetails))
            print("无转卖换钱规则解释,进入确认转卖(订单详情)页面")


if __name__ == '__main__':
    main_package.main_package(Case("test_saling"), "/Users/xygjzgs/selenium/")
Exemplo n.º 3
0
import sys

from Task import TK_papaandroid, TK_TerminalHandle
from common import dataprovide, main_package, stringHelper
from element_locator import papaandroid

sys.path.append("..")
import unittest
from time import sleep


class Case(TK_papaandroid.Task, TK_TerminalHandle.TerminalHandle,
           unittest.TestCase):
    #首页-有好货页面页面要素验证
    def test_nologin_firstpage(self):
        """“首页-有好货页面页面元素验证""" ''
        self.pop_close()
        self.assertTrue(self.isElement(papaandroid.tx_papa))
        self.assertTrue(self.isElement(papaandroid.b_Havegood))
        self.assertTrue(self.isElement(papaandroid.b_good))
        self.assertTrue(self.isElement(papaandroid.b_My))
        print("进入有好货页面,顶部显示啪啪钱包,页面下方显示三个有好货、商品、“我的”三个页签正确")
        # self.click_button(papaandroid.tab_firstpage)
        # self.assertTrue(self.isElement(papaandroid.tx_assertFirstpage))
        # print("进入banner对应的页面正确")


if __name__ == '__main__':
    main_package.main_package(Case("test_nologin_firstpage"),
                              "/Users/xygjzgs/selenium/")
Exemplo n.º 4
0
        self.assertTrue(self.isElement(papaandroid.b_submit))
        print("无法点击保存按钮")
        self.back()

    # 新用户额度低于商品价格,进行购买商品流程
    def test_buy_below3(self):
        """“点击添加收货地址完成后,返回点击添加等操作""" ''
        # 在编辑地址页面不输入任何数据,点击保存按钮
        self.click_button(papaandroid.b_create_address)
        self.send_keys(papaandroid.edit_consigneename, '吴越欣')
        self.send_keys(papaandroid.edit_consigneiphone, '13735865796')
        self.click_button(papaandroid.edit_location)
        self.click_button(papaandroid.b_provice)
        self.click_button(papaandroid.b_city)
        self.click_button(papaandroid.b_district)
        self.click_button(papaandroid.b_sure)
        self.send_keys(papaandroid.edit_detail, '13735865796')
        self.click_button(papaandroid.b_submit)
        sleep(6)
        self.assertEqual(
            self.driver.find_element_by_id(papaandroid.tx_assertName[1]).text,
            '吴越欣')
        print("收货地址为已添加的地址")


if __name__ == '__main__':
    # main_package.main_package(Case("test_buy_below1"),"/Users/xygjzgs/selenium/")
    main_package.main_package(Case("test_buy_below2"),
                              "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_buy_below3"), "/Users/xygjzgs/selenium/")
Exemplo n.º 5
0
        self.click_button(papaandroid.b_resell)
        self.assertTrue(self.isElement(papaandroid.b_tologin))
        print("点击转卖换钱按钮,进入登陆页面")
        self.back()
        self.click_button(papaandroid.b_buy)
        self.assertTrue(self.isElement(papaandroid.b_tologin))
        print("点击立即购买按钮,进入登陆页面")
        self.back()
        self.back()
        # 验证排序
        first_price = stringHelper.goods_num_split(
            self.driver.find_element_by_xpath(papaandroid.tx_firstprice[1]).text)
        sec_price = stringHelper.goods_num_split(
            self.driver.find_element_by_xpath(papaandroid.tx_secondprice[1]).text)
        self.assertTrue(float(first_price)<float(sec_price))
        print("默认按价格降序排序正确")
        self.click_button(papaandroid.b_price)
        sleep(6)
        first_price = stringHelper.goods_num_split(
            self.driver.find_element_by_xpath(papaandroid.tx_firstprice[1]).text)
        sec_price = stringHelper.goods_num_split(
            self.driver.find_element_by_xpath(papaandroid.tx_secondprice[1]).text)
        self.assertTrue(float(first_price) > float(sec_price))
        print("点击后,商品正序排序正确")




if __name__ == '__main__':
    main_package.main_package(Case("test_nologin_product"),"/Users/xygjzgs/selenium/")
Exemplo n.º 6
0
            "update csm_order set status='4' where user_id='2018072411392004050001343390' and id='660' ")
        sleep(5)
        order_state = self.driver.find_element_by_xpath(papaandroid.thirdorder_state[1]).text
        self.assertEqual(order_state, '交易完成')
        print("商品为交易完成状态正确")
        myms_csorder = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info)
        myms_csorder.sql_assign_exec(
            " update cso_repayment_plan set repayment_status=3 where contract_id='CO20180803003959191'")
        myms_csorder.sql_assign_exec(
            "update cso_contract_msg set contract_Status=221 where id='CO20180803003959191' ")
        myms.sql_assign_exec(
            "update csm_order set status=4,contract_status=221 where contract_no ='CO20180803003959191'")
        self.back()
        self.click_button(papaandroid.b_order_center)
        order_state = self.driver.find_element_by_xpath(papaandroid.thirdorder_state[1]).text
        self.assertEqual(order_state, '交易完成')
        self.click_button(papaandroid.thirdorder_state)
        self.assertTrue(self.isElement(papaandroid.tx_assertSettlement))
        print("已结清,还款成功状态正确")





if __name__ == '__main__':
    # main_package.main_package(Case("test_buy_above1"),"/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_buy_above2"), "/Users/xygjzgs/selenium/")
    # main_package.main_package(Case("test_buy_above3"), "/Users/xygjzgs/selenium/")
    main_package.main_package(Case("test_buy_above4"), "/Users/xygjzgs/selenium/")

Exemplo n.º 7
0
# _*_ coding:utf-8 _*_
import sys

from Task import TK_papaandroid, TK_TerminalHandle
from common import dataprovide, main_package, stringHelper
from element_locator import papaandroid
import imp
from common import script_ultils
sys.path.append("..")
import unittest
from time import sleep
from Task import TK_TerminalHandle


class Case(TK_papaandroid.Task, TK_TerminalHandle.TerminalHandle,
           unittest.TestCase):
    #进行退出登录
    def test_loginout(self):
        """进行退出登录""" ''
        self.pop_close()
        self.click_button(papaandroid.b_My)
        self.my_swipe_to_up()
        self.click_button(papaandroid.b_login_out)
        self.click_button(papaandroid.b_login_out_sure)


if __name__ == '__main__':
    main_package.main_package(Case("test_loginout"),
                              "/Users/xygjzgs/selenium/")