import unittest
import paramunittest
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common.Log import MyLog
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import configHttp as configHttp

productInfo_xls = common.get_xls("productCase.xlsx", "getProductInfo")
localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()


@paramunittest.parametrized(*productInfo_xls)
class ProductInfo(unittest.TestCase):
    def setParameters(self, case_name, method, token, goods_id, result, code,
                      msg):
        """
        set params
        :param case_name:
        :param method:
        :param token:
        :param goods_id:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
        self.token = str(token)
        self.goodsId = str(goods_id)
import pycharm.interfaceTest.readConfig as readConfig
import unittest
import paramunittest
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configDB

localRegisterQuick_xls = common.get_xls("userCase.xlsx", "registerquick")
localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localConfigDB = configDB.MyDB()


@paramunittest.parametrized(*localRegisterQuick_xls)
class RegisterQuick(unittest.TestCase):
    def setParameters(self, case_name, method, token, email, result, code,
                      msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param token:
        :param email:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
Exemple #3
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp

localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localLoginFB_xls = common.get_xls("userCase.xlsx", "loginFB")


@paramunittest.parametrized(*localLoginFB_xls)
class LoginFB(unittest.TestCase):
    def setParameters(self, case_name, method, token, email, facebook_id,
                      fbtoken, invite_agency, code, msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param token:
        :param email:
        :param facebook_id:
        :param fbtoken:
        :param invite_agency:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
Exemple #4
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import Log as Log
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp as ConfigHttp

login_xls = common.get_xls("userCase.xlsx", "login")
localReadConfig = readConfig.ReadConfig()
configHttp = ConfigHttp.ConfigHttp()
info = {}


@paramunittest.parametrized(*login_xls)
class Login(unittest.TestCase):
    def setParameters(self, case_name, method, token, email, password, result,
                      code, msg):
        """
        set params
        :param case_name:
        :param method:
        :param token:
        :param email:
        :param password:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
Exemple #5
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common import businessCommon
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common.Log import MyLog

localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localUpdatePassword_xls = common.get_xls("userCase.xlsx", "updatePassword")


@paramunittest.parametrized(*localUpdatePassword_xls)
class UpdatePassword(unittest.TestCase):
    def setParameters(self, case_name, method, token, old_password, password,
                      password_confirm, result, code, msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param token:
        :param old_password:
        :param password:
        :param password_confirm:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import Log as Log
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp as ConfigHttp

deleteAddress_xls = common.get_xls("userCase.xlsx", "deleteAddress")
localReadConfig = readConfig.ReadConfig()
configHttp = ConfigHttp.ConfigHttp()


@paramunittest.parametrized(*deleteAddress_xls)
class DeleteAddress(unittest.TestCase):
    def setParameters(self, case_name, method, address_id, result, code, msg):
        """
        set params
        :param case_name:
        :param method:
        :param address_id:
        :param code:
        :param result:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
        self.address_id = str(address_id)
        self.code = str(code)
        self.result = str(result)
        self.msg = str(msg)
Exemple #7
0
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common import common
import unittest
import paramunittest
from pycharm.interfaceTest.common import configDB

register_xls = common.get_xls("userCase.xlsx", "register")
localConfigHttp = configHttp.ConfigHttp()
localReadConfig = readConfig.ReadConfig()
localConfigDB = configDB.MyDB()


@paramunittest.parametrized(*register_xls)
class Register(unittest.TestCase):
    def setParameters(self, case_name, method, token, email, password,
                      confirmpwd, result, code, msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param token:
        :param email:
        :param password:
        :param confirmpwd:
        :param result:
        :param code:
        :param msg:
        :return:
        """
Exemple #8
0
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp
import pycharm.interfaceTest.readConfig as readConfig

localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localLogin_xls = common.get_xls("userCase.xlsx", "login")
localAddAddress_xls = common.get_xls("userCase.xlsx", "addAddress")


# 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()
Exemple #9
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import Log as Log
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp as ConfigHttp
from pycharm.interfaceTest.common import businessCommon

addAddress_xls = common.get_xls("userCase.xlsx", "addAddress")
localReadConfig = readConfig.ReadConfig()
configHttp = ConfigHttp.ConfigHttp()


@paramunittest.parametrized(*addAddress_xls)
class AddAddress(unittest.TestCase):
    def setParameters(self, case_name, method, token, sex, fname, lname, tel,
                      standby_tel, address1, address2, city, state, postcode,
                      country_id, tax_number, company, fax, is_default, result,
                      code, msg):
        """
        set params
        :param case_name:
        :param method:
        :param token:
        :param sex:
        :param fname:
        :param lname:
        :param tel:
        :param standby_tel:
        :param address1:
        :param address2:
Exemple #10
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import Log as Log
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp as ConfigHttp
from pycharm.interfaceTest.common import businessCommon

addressList_xls = common.get_xls("userCase.xlsx", "getAddressList")
localReadConfig = readConfig.ReadConfig()
configHttp = ConfigHttp.ConfigHttp()
info = {}


@paramunittest.parametrized(*addressList_xls)
class GetAddressList(unittest.TestCase):
    def setParameters(self, case_name, method, token, result, code, msg):
        """
        set params
        :param case_name:
        :param method:
        :param token:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
        self.token = str(token)
        self.result = str(result)
Exemple #11
0
import os
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common import businessCommon
from pycharm.interfaceTest.common.Log import MyLog

localUploadImg_xls = common.get_xls("userCase.xlsx", "uploadImg")
localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()


@paramunittest.parametrized(*localUploadImg_xls)
class UploadImg(unittest.TestCase):

    def setParameters(self, case_name, method, token, whole, file, result, code, msg):
        """
        set param
        :param case_name:
        :param method:
        :param token:
        :param whole:
        :param file:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import businessCommon

localReadConfig = readConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localLogin_xls = common.get_xls("userCase.xlsx", "login")
localAccountSetting_xls = common.get_xls("userCase.xlsx", "accountSetting")


@paramunittest.parametrized(*localAccountSetting_xls)
class AccountSetting(unittest.TestCase):

    def setParameters(self, case_name, method, token, sex, telephone, nickname, birthday, country_id, result, code, msg):
        """
        set params
        :param case_name:
        :param method:
        :param token:
        :param sex:
        :param telephone:
        :param nickname:
        :param birthday:
        :param country_id:
        :param result:
        :param code:
        :param msg:
Exemple #13
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as ReadConfig
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp
from pycharm.interfaceTest.common import businessCommon

localReadConfig = ReadConfig.ReadConfig()
localConfigHttp = configHttp.ConfigHttp()
localLogout_xls = common.get_xls("userCase.xlsx", "logout")


@paramunittest.parametrized(*localLogout_xls)
class Logout(unittest.TestCase):
    def setParameters(self, case_name, method, token, result, code, msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param token:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
        self.token = str(token)
        self.result = str(result)
        self.code = str(code)
Exemple #14
0
import unittest
import paramunittest
import pycharm.interfaceTest.readConfig as readConfig
from pycharm.interfaceTest.common.Log import MyLog
from pycharm.interfaceTest.common import common
from pycharm.interfaceTest.common import configHttp

localGenerate_xls = common.get_xls("userCase.xlsx", "generate")
localConfigHttp = configHttp.ConfigHttp()
localReadConfig = readConfig.ReadConfig()


@paramunittest.parametrized(*localGenerate_xls)
class Generate(unittest.TestCase):
    def setParameters(self, case_name, method, result, code, msg):
        """
        set parameters
        :param case_name:
        :param method:
        :param result:
        :param code:
        :param msg:
        :return:
        """
        self.case_name = str(case_name)
        self.method = str(method)
        self.result = str(result)
        self.code = str(code)
        self.msg = str(msg)
        self.response = None
        self.info = None