Exemplo n.º 1
0
    def test_NUMB(self):
        zc_resp = request.post_request(
            url='http://192.168.60.132:1811/user/signup',
            json={
                "phone": Tools.phone_num(),
                "pwd": 'ab12345',
                "rePwd": 'ab12345',
                "userName": Tools.random_str_abc(3) + Tools.random_123(3)
            })
        assertions.assert_code(zc_resp.status_code, 200)
        zc_resp_json = zc_resp.json()

        assertions.assert_in_text(zc_resp_json["respCode"], '0')
Exemplo n.º 2
0
 def test_signup1(self):
     signup_resp = request.post_request(url=url + 'user/signup',
                                        json={
                                            "phone":
                                            Tools.phone_num(),
                                            "pwd":
                                            'aaa123456',
                                            "rePwd":
                                            'aaa123456',
                                            "userName":
                                            Tools.random_str_abc(3) +
                                            Tools.random_123(3)
                                        })
     assertions.assert_code(signup_resp.status_code, 200)
     resp_json = signup_resp.json()
     assertions.assert_in_text(resp_json['respCode'], '0')
Exemplo n.º 3
0
from Common import Request, Assert, read_excel, Tools
import pytest, allure

tool_pwd = Tools.random_str_abc(3) + str(Tools.random_123(3))
tool_username = Tools.random_str_abc(3) + str(Tools.random_123(1))
tool_phone = Tools.phone_num()
request = Request.Request()
assertions = Assert.Assertions()


@allure.feature('注册模块')
class Test_zhuce:
    @allure.story('注册新用户')
    def test_zhuce(self):
        zhuce_resp = request.post_request(
            url='http://192.168.60.132:1811/user/signup',
            json={
                "phone": tool_phone,
                "pwd": tool_pwd,
                "rePwd": tool_pwd,
                "userName": tool_username
            })
        assertions.assert_code(zhuce_resp.status_code, 200)
        resp_json = zhuce_resp.json()
        assertions.assert_in_text(resp_json['respDesc'], '成功')
Exemplo n.º 4
0
from Common import Request, Assert, Tools
import allure
import pytest
phone = Tools.phone_num()
pwd = Tools.random_str_abc(2) + Tools.random_123(4)
rePwd = pwd
userName = Tools.random_str_abc(3) + Tools.random_123(2)
newPwd = Tools.random_str_abc(3) + Tools.random_123(4)
oldPwd = pwd
reNewPwd = newPwd

request = Request.Request()
assertion = Assert.Assertions()

url = 'http://192.168.1.137:1811/'
head = {}


@allure.feature('注册登录测试')
class Test_logon:
    @allure.story('注册测试')
    def test_signup(self):
        json = {
            "phone": phone,
            "pwd": pwd,
            "rePwd": rePwd,
            "userName": userName
        }
        signup_resp = request.post_request(url=url + '/user/signup', json=json)
        resp_json = signup_resp.json()
        assertion.assert_code(signup_resp.status_code, 200)
Exemplo n.º 5
0
 def test_yhzc(self,phone,pwd,rePwd,userName,code):
     yhzc_resp = request.post_request(url='http://192.168.60.132:1811/user/signup',
                                         json={"phone": Tools.phone_num(), "pwd":'a123456', "rePwd":'a123456', "userName": Tools.random_str_abc(3)+Tools.random_123(3)})
     assertions.assert_code(yhzc_resp.status_code, 200)
     yhzc_resp_json = yhzc_resp.json()
     assertions.assert_in_text(yhzc_resp_json['respCode'],code)