コード例 #1
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "clientWithDraw")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*accountRecharge)
class ClientWithDrawTest(unittest.TestCase):
    def setParameters(self, case_name, login, passwd, transMoney):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)
        self.transMoney = str(transMoney)

    # def setUp(self):
    #     self.baseUrl = "http://www.mi.com"
    #     self.driver = webdriver.Chrome()
    #     self.driver.implicitly_wait(10)  # 静默等待10s

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
コード例 #2
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
userinmoney = get_xls("pcChongzhiCase.xls", "userinmoney")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*userinmoney)
class userinmoneyTest(unittest.TestCase):
    def setParameters(self, case_name, login, password, input_tranAmt, card_no,
                      bank_code, payType, tranAmt):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)
        self.input_tranAmt = str(input_tranAmt)
        self.card_no = str(int(card_no))
        self.bank_code = str(int(bank_code))
        self.payType = str(payType)
        self.tranAmt = str(tranAmt)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
コード例 #3
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
capitalSafe = get_xls("pcloginCase.xls", "capitalSafe")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*capitalSafe)
class capitalSafeTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)
コード例 #4
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "guQuanIndex")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*accountRecharge)
class guQuanIndexTest(unittest.TestCase):
    def setParameters(self, case_name, login, password, utype):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)
        self.utype = str(int(utype))

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
コード例 #5
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
testsearchInfomation = get_xls("pcloginCase.xls", "searchInfomation_test")
# print(testsearchInfomation)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*testsearchInfomation)
class SearchInfomation_Test(unittest.TestCase):
    def setParameters(self, case_name, type, channel, position):
        self.case_name = str(case_name)
        self.type = str(int(type))
        self.channel = str(int(channel))
        self.position = str(int(position))

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {
            'type': self.type,
            'channel': self.channel,
            'position': self.position
コード例 #6
0
ファイル: invest.py プロジェクト: feinimoshu88/CG1
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls
from db import Db

now = time.strftime("%Y_%m_%d %H:%M:%S")
investCase = get_xls("bidInfoList.xls", "investCase")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()
db = Db()
connection = db.connection
cursor = db.cursor


@paramunittest.parametrized(*investCase)
class InvestTest(unittest.TestCase):
    def setParameters(self, case_name, login, passwd, biddname, money,
                      investRedPacketId, investRaiseInterestId):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)
        self.biddname = str(biddname)
        self.money = str(int(money))
        self.investRedPacketId = str(int(investRedPacketId))
        self.investRaiseInterestId = str(int(investRaiseInterestId))
コード例 #7
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

# proDir = getDir.proDir
now = time.strftime("%Y_%m_%d %H:%M:%S")
getAdPosition = get_xls("apploginCase.xls", "getAdPosition")
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*getAdPosition)
class AppgetAdPositionTest(unittest.TestCase):
    def setParameters(self, case_name, access_token, type, function):
        self.case_name = str(case_name)
        self.access_token = str(access_token)
        self.type = str(int(type))
        self.function = str(int(function))

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {
            'access_token': self.access_token,
            'type': self.type,
            'function': self.function
コード例 #8
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
toHouseInfoList = get_xls("pcloginCase.xls", "toHouseInfoList")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*toHouseInfoList)
class toHouseInfoListTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)
コード例 #9
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
pcloginCase = get_xls("pcloginCase.xls", "toRecharge_test")
# print(pcloginCase)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*pcloginCase)
class ToRechargeTest(unittest.TestCase):
    def setParameters(self, case_name, login, passwd):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)

    # def setUp(self):
    #     self.baseUrl = "http://www.mi.com"
    #     self.driver = webdriver.Chrome()
    #     self.driver.implicitly_wait(10)  # 静默等待10s

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
コード例 #10
0
import json
import re
import time
import unittest
import paramunittest
import requests

from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "accountRecharge")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*accountRecharge)
class AccountRechargeTest(unittest.TestCase):
    def setParameters(self, case_name, systemTypeName, platformSourceName,
                      payChannel, payStyle, bankCode, bankCard, tiedCardFlag,
                      transMoney, login, passwd):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)
        self.systemTypeName = str(systemTypeName)
        self.platformSourceName = str(platformSourceName)
        self.payStyle = str(payStyle)
        self.bankCode = str(bankCode)
        self.bankCard = str(bankCard)
        self.tiedCardFlag = str(int(tiedCardFlag))
コード例 #11
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
LoanBidlist = get_xls("pcloginCase.xls", "LoanBidlist")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*LoanBidlist)
class LoanBidlistTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)
コード例 #12
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
LoanXmllist = get_xls("pcloginCase.xls", "LoanXmllist")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*LoanXmllist)
class LoanXmllistTest(unittest.TestCase):
    def setParameters(self, case_name, login, password, totalnum, pagenum,
                      current, startnum, productType, preState, sbiddTermValue,
                      ebiddTermValue, srate, erate, repaymentway, jackerooBidd,
                      biddProperty, sortType, sort):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)
        self.totalnum = str(int(totalnum))
        self.pagenum = str(int(pagenum))
        self.current = str(int(current))
        self.startnum = str(int(startnum))
        self.productType = str(int(productType))
        self.preState = str(preState)
コード例 #13
0
from jkutrl import common
from jkutrl import configHttp
import readConfig as readConfig

localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localLogin_xls = common.get_xls("apploginCase.xls", "pclogin_test")
localAddAddress_xls = common.get_xls("apploginCase.xls", "pclogin_test")

# login
def login():
    """
    login
    :return: token
    """
    # set url
    url = common.get_url_from_xml('login')
    localConfigHttp.set_url(url)

    # set header
    token = localReadConfig.get_headers("token_v")
    header = {"token": token}
    localConfigHttp.set_headers(header)

    # set param
    data = {"email": localLogin_xls[0][3],
            "password": localLogin_xls[0][4]}
    localConfigHttp.set_data(data)

    # login
    response = localConfigHttp.post().json()
コード例 #14
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "logout")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*accountRecharge)
class logoutTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)
コード例 #15
0
ファイル: toWithDrawPage.py プロジェクト: 3058035655/tjf_test
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "toWithDrawPage")
# print(accountRecharge)
b=BasePage()
url1=b.get_url()

@paramunittest.parametrized(*accountRecharge)
class ToWithDrawPageTest(unittest.TestCase):
    def setParameters(self, case_name,login,passwd):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)
    # def setUp(self):
    #     self.baseUrl = "http://www.mi.com"
    #     self.driver = webdriver.Chrome()
    #     self.driver.implicitly_wait(10)  # 静默等待10s

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login,
                'passwd': self.passwd}
コード例 #16
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

# proDir = getDir.proDir
now = time.strftime("%Y_%m_%d %H:%M:%S")
pcloginCase = get_xls("pcloginCase.xls", "pclogin_test")
b = BasePage()
url1 = b.get_url()


class PcgetIndexPageTest(unittest.TestCase):
    def test_login(self):
        self.case_name = 'pcgetIndexPageTest'
        self._testMethodDoc = self.case_name  # 设置用例名称
        # https://www.hongkunjinfu.com/index.do?method=getIndexPage
        url = url1 + '/index.do?method=getIndexPage'
        #请求首页
        r = requests.get(url, verify=False)  # 发送请求
        print('status:', r.status_code)
        self.assertEqual(r.status_code, 200)
        # a=json.loads(t) #字符串转换为字典
        # print(a['state'])
        # self.assertEqual(t,self.expected)
        # resStatus = re.findall (r'<resStatus>(.+?)</resStatus>', t)
        # print(resStatus[0])
コード例 #17
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
queryCardbinBf = get_xls("pcChongzhiCase.xls", "queryCardbinBf")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*queryCardbinBf)
class queryCardbinBfTest(unittest.TestCase):
    def setParameters(self, case_name, login, password, card_no):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)
        self.card_no = str(int(card_no))

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
コード例 #18
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
indexAbout = get_xls("pcloginCase.xls", "indexAbout")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*indexAbout)
class indexAboutTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)
コード例 #19
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

# proDir = getDir.proDir
now = time.strftime("%Y_%m_%d %H:%M:%S")
applogin_test = get_xls("apploginCase.xls", "applogin_test")
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*applogin_test)
class AppLoginTest(unittest.TestCase):
    def setParameters(self, case_name, access_token, mobileUDID, login,
                      password, appVersion, mobileModel, mobileVersion,
                      mobileIp, mobileMAC, passLength, expected):
        self.case_name = str(case_name)
        self.access_token = str(access_token)
        self.mobileUDID = str(mobileUDID)
        self.login = str(int(login))
        self.password = str(password)
        self.appVersion = str(appVersion)
        self.mobileModel = str(mobileModel)
        self.mobileVersion = str(int(mobileVersion))
        self.mobileIp = str(mobileIp)
        self.mobileMAC = str(mobileMAC)
コード例 #20
0
import json
import re
import time
import unittest
import paramunittest
import requests

from db import Db
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
biddinfolist = get_xls("bidInfoList.xls", "toInvest")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()
db = Db()
connection = db.connection
cursor = db.cursor


@paramunittest.parametrized(*biddinfolist)
class toInvestTest(unittest.TestCase):
    def setParameters(self, case_name, login, passwd, biddname):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)
        self.biddname = str(biddname)

    # def setUp(self):
    #     self.baseUrl = "http://www.mi.com"
コード例 #21
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accountRecharge = get_xls("pcloginCase.xls", "loadMyAccount")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*accountRecharge)
class loadMyAccountTest(unittest.TestCase):
    def setParameters(self, case_name, login, passwd):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.passwd = str(passwd)

    # def setUp(self):
    #     self.baseUrl = "http://www.mi.com"
    #     self.driver = webdriver.Chrome()
    #     self.driver.implicitly_wait(10)  # 静默等待10s

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
コード例 #22
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
accPandectlist = get_xls("pcloginCase.xls", "accPandectlist")
# print(accountRecharge)
b=BasePage()
url1=b.get_url()
@paramunittest.parametrized(*accPandectlist)
class accPandectlistTest(unittest.TestCase):
    def setParameters(self, case_name,login,password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login,'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url=url1+'/login.do?method=indexlogin'
        r = requests.post (url,verify=False,data=content)  # 发送请求
        print ('status:', r.status_code)
        t=r.text
        c=r.cookies
コード例 #23
0
import json
import re
import time
import unittest
import paramunittest
import requests
from jkutrl.basepage import BasePage
from jkutrl.common import get_xls

now = time.strftime("%Y_%m_%d %H:%M:%S")
touseroutmoney = get_xls("pcChongzhiCase.xls", "touseroutmoney")
# print(accountRecharge)
b = BasePage()
url1 = b.get_url()


@paramunittest.parametrized(*touseroutmoney)
class touseroutmoneyTest(unittest.TestCase):
    def setParameters(self, case_name, login, password):
        self.case_name = str(case_name)
        self.login = str(int(login))
        self.password = str(password)

    def test_login(self):
        self._testMethodDoc = self.case_name  # 设置用例名称
        # 用户登录
        content = {'login': self.login, 'password': self.password}
        #https://www.hongkunjinfu.com/login.do?method=indexlogin
        url = url1 + '/login.do?method=indexlogin'
        r = requests.post(url, verify=False, data=content)  # 发送请求
        print('status:', r.status_code)