Commit 5c1471af authored by xiao-hesheng's avatar xiao-hesheng
Browse files

修改脚本适合融合环境

parent 85934904
...@@ -11,7 +11,7 @@ from common.tokenUtils import * ...@@ -11,7 +11,7 @@ from common.tokenUtils import *
class login_system(): class login_system():
module = "a1_herp3_login" module = "a98_herp3_login"
def __init__(self, username, password): def __init__(self, username, password):
self.username = username self.username = username
......
...@@ -11,7 +11,7 @@ from common.tokenUtils import * ...@@ -11,7 +11,7 @@ from common.tokenUtils import *
class login_system(): class login_system():
module = "a1_herp3_login" module = "a98_herp3_login"
def __init__(self, username, password): def __init__(self, username, password):
self.username = username self.username = username
......
...@@ -12,7 +12,7 @@ from air_case.a98_herp3_login.登录内网系统.登录内网系统 import login ...@@ -12,7 +12,7 @@ from air_case.a98_herp3_login.登录内网系统.登录内网系统 import login
from airtest.core.api import using from airtest.core.api import using
import sys import sys
def h_Register(): def h_Register():
module = "a2_herp3_bs" module = "a99_herp3_bs"
""" """
场景:a1_医院信息登记 场景:a1_医院信息登记
用例名称:a1_医院信息登记 用例名称:a1_医院信息登记
......
# -*- encoding=utf8 -*-
__author__ = "xiaohesheng"
"""
case_tag:mdm-web,10086登录,用例集id2226
主数据平台:统一登录接口,第一步获取验证码,第二步登录系统,第三步平台登录验证token
"""
from common.common_func import commonFuc
from common.tokenUtils import *
class login_system():
module = "mdm3_login"
def __init__(self, username, password):
self.username = username
self.password = password
# 获取验证码接口
def get_token(self):
url = commonFuc().get_api_url() + commonFuc().get_business_data(self.module, "VerifyCode_url")
# print("aaaaaaaaaaaaaaaaaa" + url)
# 发送请求
result = commonFuc().http_get(url, headers="", params="")
# print(result)
uuid = commonFuc().analysis_json('uuId', result)
# print(uuid)
# 如果不传参数就使用默认数据登录
# username = commonFuc().get_business_data(self.module, "username")
# password = commonFuc().get_business_data(self.module, "password")
# print(username,password)
username = self.username
password = self.password
EncryptPassword = TokenUtils(username, password, uuid).get_PasswordEncrypt()
# print('加密后的密码', EncryptPassword) # 加密后的密码
login_url = commonFuc().get_api_url() + commonFuc().get_business_data(self.module, "login_url")
request_body = commonFuc().get_business_data(self.module, "payload", username, EncryptPassword, uuid)
# print(request_body)
# #获取请求头信息
headers = commonFuc().get_business_data(self.module, "json_headers",
commonFuc().get_business_data(self.module, "json_contentType"))
# print(headers)
# 发送登录请求
result = commonFuc().http_post(login_url, request_body, headers)
token = commonFuc().analysis_json('token', result)
uxid = commonFuc().analysis_json('uxid', result)
projectCode = commonFuc().analysis_json('projectCode', result)
# print(token, uxid)
# 平台登录,请求头里面有token
headers = commonFuc().get_business_data(self.module, "json_headers2",
commonFuc().get_business_data(self.module, "json_contentType"), token,
projectCode)
# print('平台登录请求头', headers)
platform_login_url = commonFuc().get_api_url() + commonFuc().get_business_data(self.module,
"platform_login_url")
request_body = commonFuc().get_business_data(self.module, "payload2", token, uxid, projectCode)
# print(request_body)
# 发送平台登录请求
result = commonFuc().http_post(platform_login_url, request_body, headers)
print('平台登录接口结果', result)
# 获取预期结果
check_dict = commonFuc().get_business_data(self.module, "checkDict")
# print(check_dict)
# 断言实际结果中是否不包含预期的文本
commonFuc().check_text_exist(uxid, result)
corpId=commonFuc().analysis_json('corpId', result)
info=(token,projectCode,uxid,corpId)
return token,projectCode,uxid,corpId,info
login_system('test001', '1qaz!QAZ').get_token()
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"checkHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/checkHosRegistInfo" "checkHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/checkHosRegistInfo"
"username": "test001" "username": "test001"
"password": "a123456!" "password": "a123456!"
"username2": "jzgkadmin"
"password1": "1qaz!QAZ" "password1": "1qaz!QAZ"
...@@ -99,7 +100,7 @@ json_headers2: { ...@@ -99,7 +100,7 @@ json_headers2: {
"upCompanyId": null, "upCompanyId": null,
"compKind": 2, "compKind": 2,
"compFunction": "1", "compFunction": "1",
"area": "湖南省长沙市市辖区", "area": "湖南省长沙市下陆区",
"legal": null, "legal": null,
"address": "湖南省人民医院附属医院", "address": "湖南省人民医院附属医院",
"isAbroad": 0, "isAbroad": 0,
...@@ -126,6 +127,60 @@ json_headers2: { ...@@ -126,6 +127,60 @@ json_headers2: {
"createUserCorpId": null "createUserCorpId": null
} }
"payload4_1": {
"id": "%s",
"lastModified": "%s",
"version": 1,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"userLoginCode": "%s",
"userLoginPsw": "v/kTXSwg4s7FA7eIxX+S+w==",
"userName": "%s",
"cname": "%s",
"shortName": "%s",
"upCompanyId": null,
"compKind": 2,
"compFunction": "1",
"area": "湖南省长沙市下陆区",
"province": null,
"city": null,
"areaCode": null,
"legal": null,
"address": "湖南省长沙市下陆区",
"isAbroad": 0,
"nation": null,
"registContactUser": "%s",
"registContactWay": "%s",
"email": "%s@sina.com",
"hosProperty": "1",
"hosLevel": "三级甲等",
"erpCode": null,
"regCode": null,
"jyxkCode": null,
"jyxkbaCode": null,
"scxkzCode": null,
"scbapzCode": null,
"isLocked": 1,
"auditStatus": 30,
"auditStartTime": "%s",
"auditEndTime": "%s",
"auditor": "UID-041928",
"auditComment": "222",
"registSourceProject": "0000",
"dataEntrance": "注册",
"importTaskMfrsId": null,
"createUserCorpId": null,
"hosSpdType": null,
"companyRegistBizscopeVos": null,
"certVOList": null,
"upCompanyName": null,
"basCode": null,
"shortPyinyin": null,
"areaText": "湖南省长沙市下陆区"
}
"payload5": { "payload5": {
"id": "%s", "id": "%s",
"auditStatus": 30, "auditStatus": 30,
......
医院信息:
h_id: 湖南省人民医院@yiF7
h_name: 湖南省人民医院@yiF7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment