Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
ca91e5b5
Commit
ca91e5b5
authored
Apr 14, 2021
by
huangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回滚版本
parent
74884479
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
402 additions
and
103 deletions
+402
-103
misc.xml
.idea/misc.xml
+4
-0
shelved.patch
...te_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch
+0
-0
Uncommitted_changes_before_Update_at_2021_4_13__20_21__Default_Changelist_.xml
...efore_Update_at_2021_4_13__20_21__Default_Changelist_.xml
+5
-0
workspace.xml
.idea/workspace.xml
+63
-44
run_method.py
common/run_method.py
+5
-0
init_base_api.py
init_base_api.py
+65
-53
init_new_base_api.py
init_new_base_api.py
+221
-0
test_receipt_detail.py
.../ji_yun_ying_pc/statistical_report/test_receipt_detail.py
+3
-6
test_login.py
script/ji_yun_ying_pc/test_login.py
+2
-0
test_order.py
script/ji_yun_ying_pc/test_order.py
+1
-0
url_to_method.py
url_to_method.py
+33
-0
No files found.
.idea/misc.xml
View file @
ca91e5b5
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectPlainTextFileTypeManager"
>
<file
url=
"file://$PROJECT_DIR$/script/base_api/api_operation_web/big_screen_temp.py"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (GeekInterfaceTest)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (GeekInterfaceTest)"
project-jdk-type=
"Python SDK"
/>
</project>
</project>
\ No newline at end of file
.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch
0 → 100644
View file @
ca91e5b5
This source diff could not be displayed because it is too large. You can
view the blob
instead.
.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13__20_21__Default_Changelist_.xml
0 → 100644
View file @
ca91e5b5
<changelist
name=
"Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]"
date=
"1618316475949"
recycled=
"true"
deleted=
"true"
>
<option
name=
"PATH"
value=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch"
/>
<option
name=
"DESCRIPTION"
value=
"Uncommitted changes before Update at 2021/4/13, 20:21 [Default Changelist]"
/>
</changelist>
\ No newline at end of file
.idea/workspace.xml
View file @
ca91e5b5
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
<select
/>
<select
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"54f4d37d-1724-4813-a1e2-24e200088c5f"
name=
"Default Changelist"
comment=
"
增加allure安装包
"
>
<list
default=
"true"
id=
"54f4d37d-1724-4813-a1e2-24e200088c5f"
name=
"Default Changelist"
comment=
"
修复return_json的bug
"
>
<change
beforePath=
"$PROJECT_DIR$/
script/defalut_account.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/script/defalut_account.py
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/
.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml
"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<component
name=
"Git.Settings"
>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_BRANCH_BY_REPOSITORY"
>
<option
name=
"RECENT_BRANCH_BY_REPOSITORY"
>
<map>
<map>
<entry
key=
"$PROJECT_DIR$"
value=
"
ji_yun_order
"
/>
<entry
key=
"$PROJECT_DIR$"
value=
"
test_report
"
/>
</map>
</map>
</option>
</option>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
...
@@ -52,18 +52,18 @@
...
@@ -52,18 +52,18 @@
<property
name=
"RunOnceActivity.OpenProjectViewOnStart"
value=
"true"
/>
<property
name=
"RunOnceActivity.OpenProjectViewOnStart"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"run.code.analysis.last.selected.profile"
value=
"aDefault"
/>
<property
name=
"run.code.analysis.last.selected.profile"
value=
"aDefault"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"
com.jetbrains.python.configuration.PythonContentEntrie
sConfigurable"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"
org.jetbrains.plugins.github.ui.GithubSetting
sConfigurable"
/>
</component>
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"$PROJECT_DIR$"
/>
</key>
<key
name=
"MoveFile.RECENT_KEYS"
>
<key
name=
"MoveFile.RECENT_KEYS"
>
<recent
name=
"$PROJECT_DIR$/common"
/>
<recent
name=
"$PROJECT_DIR$/common"
/>
<recent
name=
"$PROJECT_DIR$/script/ji_yun_ying_pc/data_config"
/>
<recent
name=
"$PROJECT_DIR$/script/ji_yun_ying_pc/data_config"
/>
</key>
</key>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"$PROJECT_DIR$"
/>
</key>
</component>
</component>
<component
name=
"RunManager"
selected=
"Python.
init_base_api
"
>
<component
name=
"RunManager"
selected=
"Python.
run
"
>
<configuration
name=
"create_case"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"create_case"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
<method
v=
"2"
/>
</configuration>
</configuration>
<configuration
name=
"
data_config
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"
init_base_api
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
@@ -93,11 +93,11 @@
...
@@ -93,11 +93,11 @@
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
</envs>
</envs>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$
/script/ji_yun_ying_pc/data_config
"
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
script/ji_yun_ying_pc/data_config/data_config
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
init_base_api
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
<method
v=
"2"
/>
</configuration>
</configuration>
<configuration
name=
"init_base_api"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"init_
new_
base_api"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/init_base_api.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/init_
new_
base_api.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
<method
v=
"2"
/>
</configuration>
</configuration>
<configuration
name=
"
run
_method"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"
url_to
_method"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
@@ -156,11 +156,11 @@
...
@@ -156,11 +156,11 @@
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
</envs>
</envs>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$
/common
"
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
common/run
_method.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
url_to
_method.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
@@ -171,11 +171,11 @@
...
@@ -171,11 +171,11 @@
</configuration>
</configuration>
<recent_temporary>
<recent_temporary>
<list>
<list>
<item
itemvalue=
"Python.
init_base_api
"
/>
<item
itemvalue=
"Python.
url_to_method
"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.init_new_base_api"
/>
<item
itemvalue=
"Python.init_base_api"
/>
<item
itemvalue=
"Python.create_case"
/>
<item
itemvalue=
"Python.create_case"
/>
<item
itemvalue=
"Python.run_method"
/>
<item
itemvalue=
"Python.data_config"
/>
</list>
</list>
</recent_temporary>
</recent_temporary>
</component>
</component>
...
@@ -202,7 +202,14 @@
...
@@ -202,7 +202,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1611382504496
</updated>
<updated>
1611382504496
</updated>
</task>
</task>
<option
name=
"localTasksCounter"
value=
"3"
/>
<task
id=
"LOCAL-00003"
summary=
"修复return_json的bug"
>
<created>
1618368222321
</created>
<option
name=
"number"
value=
"00003"
/>
<option
name=
"presentableId"
value=
"LOCAL-00003"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1618368222321
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"4"
/>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<component
name=
"Vcs.Log.Tabs.Properties"
>
...
@@ -220,7 +227,8 @@
...
@@ -220,7 +227,8 @@
<component
name=
"VcsManagerConfiguration"
>
<component
name=
"VcsManagerConfiguration"
>
<MESSAGE
value=
"增加依赖文件"
/>
<MESSAGE
value=
"增加依赖文件"
/>
<MESSAGE
value=
"增加allure安装包"
/>
<MESSAGE
value=
"增加allure安装包"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"增加allure安装包"
/>
<MESSAGE
value=
"修复return_json的bug"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"修复return_json的bug"
/>
</component>
</component>
<component
name=
"WindowStateProjectService"
>
<component
name=
"WindowStateProjectService"
>
<state
x=
"360"
y=
"197"
key=
"#com.intellij.execution.impl.EditConfigurationsDialog"
timestamp=
"1611302358176"
>
<state
x=
"360"
y=
"197"
key=
"#com.intellij.execution.impl.EditConfigurationsDialog"
timestamp=
"1611302358176"
>
...
@@ -231,41 +239,45 @@
...
@@ -231,41 +239,45 @@
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1020"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1020"
/>
</state>
</state>
<state
x=
"642"
y=
"389"
key=
"ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617160990990"
/>
<state
x=
"642"
y=
"389"
key=
"ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617160990990"
/>
<state
x=
"100"
y=
"123"
width=
"1592"
height=
"809"
key=
"DiffContextDialog"
timestamp=
"1618388210434"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
<state
x=
"100"
y=
"123"
width=
"1592"
height=
"809"
key=
"DiffContextDialog/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618388210434"
/>
<state
x=
"683"
y=
"296"
key=
"FileChooserDialogImpl"
timestamp=
"1611303152470"
>
<state
x=
"683"
y=
"296"
key=
"FileChooserDialogImpl"
timestamp=
"1611303152470"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1017"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1017"
/>
</state>
</state>
<state
x=
"683"
y=
"296"
key=
"FileChooserDialogImpl/0.23.1792.1017@0.23.1792.1017"
timestamp=
"1611303152470"
/>
<state
x=
"683"
y=
"296"
key=
"FileChooserDialogImpl/0.23.1792.1017@0.23.1792.1017"
timestamp=
"1611303152470"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1618
223359103
"
>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1618
386916560
"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
223359103
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
386916560
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419626"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419626"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.bottom/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.bottom/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706598"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.bottom/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706598"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.bottom/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434843"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.bottom/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434843"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center"
timestamp=
"1618
223359103
"
>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center"
timestamp=
"1618
386916559
"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
223359103
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
386916559
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.center/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.center/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706597"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.center/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706597"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.center/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434842"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.center/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434842"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left"
timestamp=
"1618
223359102
"
>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left"
timestamp=
"1618
386916558
"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
223359102
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
386916558
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419624"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360302"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.left/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360302"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.left/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706585"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.left/0.23.1792.1024@0.23.1792.1024"
timestamp=
"1617095706585"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.left/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434842"
/>
<state
width=
"1771"
height=
"322"
key=
"GridCell.Tab.0.left/0.23.1792.1026@0.23.1792.1026"
timestamp=
"1617090434842"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right"
timestamp=
"1618
223359103
"
>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right"
timestamp=
"1618
386916559
"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
223359103
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
386916559
"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1012@0.23.1792.1012"
timestamp=
"1617964714625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1617278419625"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
<state
width=
"1771"
height=
"319"
key=
"GridCell.Tab.0.right/0.23.1792.1020@0.23.1792.1020"
timestamp=
"1617161360303"
/>
...
@@ -287,26 +299,32 @@
...
@@ -287,26 +299,32 @@
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
width=
"1771"
height=
"338"
key=
"GridCell.Tab.1.right/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618195326172"
/>
<state
width=
"1771"
height=
"338"
key=
"GridCell.Tab.1.right/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618195326172"
/>
<state
x=
"397"
y=
"173"
key=
"SettingsEditor"
timestamp=
"1611303202671"
>
<state
x=
"653"
y=
"237"
key=
"RollbackChangesDialog"
timestamp=
"1618316207656"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1015"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
<state
x=
"653"
y=
"237"
key=
"RollbackChangesDialog/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618316207656"
/>
<state
x=
"397"
y=
"172"
key=
"SettingsEditor"
timestamp=
"1618285725548"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
x=
"397"
y=
"172"
key=
"SettingsEditor/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618285725548"
/>
<state
x=
"397"
y=
"173"
key=
"SettingsEditor/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1611303202671"
/>
<state
x=
"397"
y=
"173"
key=
"SettingsEditor/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1611303202671"
/>
<state
x=
"397"
y=
"173"
key=
"SettingsEditor/0.23.1792.1017@0.23.1792.1017"
timestamp=
"1611302888504"
/>
<state
x=
"397"
y=
"173"
key=
"SettingsEditor/0.23.1792.1017@0.23.1792.1017"
timestamp=
"1611302888504"
/>
<state
x=
"496"
y=
"266"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"1618
198928993
"
>
<state
x=
"496"
y=
"266"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"1618
368239097
"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</state>
</state>
<state
x=
"496"
y=
"266"
key=
"Vcs.Push.Dialog.v2/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
198928993
"
/>
<state
x=
"496"
y=
"266"
key=
"Vcs.Push.Dialog.v2/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618
368239097
"
/>
<state
x=
"496"
y=
"267"
key=
"Vcs.Push.Dialog.v2/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1611382527150"
/>
<state
x=
"496"
y=
"267"
key=
"Vcs.Push.Dialog.v2/0.23.1792.1015@0.23.1792.1015"
timestamp=
"1611382527150"
/>
</component>
<state
x=
"687"
y=
"268"
key=
"VcsDiffUtil.ChangesDialog"
timestamp=
"1618387975129"
>
<component
name=
"XDebuggerManager"
>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<breakpoint-manager>
</state>
<breakpoints>
<state
x=
"687"
y=
"268"
key=
"VcsDiffUtil.ChangesDialog/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618387975129"
/>
<line-breakpoint
enabled=
"true"
suspend=
"THREAD"
type=
"python-line"
>
<state
x=
"100"
y=
"123"
width=
"1592"
height=
"809"
key=
"com.intellij.history.integration.ui.views.DirectoryHistoryDialog"
timestamp=
"1618388210434"
>
<url>
file://$PROJECT_DIR$/script/base_api/service_user/token.py
</url>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
<line>
1
</line>
</state>
<option
name=
"timeStamp"
value=
"1"
/>
<state
x=
"100"
y=
"123"
width=
"1592"
height=
"809"
key=
"com.intellij.history.integration.ui.views.DirectoryHistoryDialog/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618388210434"
/>
</line-breakpoint>
<state
x=
"644"
y=
"247"
key=
"git4idea.branch.GitSmartOperationDialog"
timestamp=
"1618387447021"
>
</breakpoints>
<screen
x=
"0"
y=
"23"
width=
"1792"
height=
"1009"
/>
</breakpoint-manager>
</state>
<state
x=
"644"
y=
"247"
key=
"git4idea.branch.GitSmartOperationDialog/0.23.1792.1009@0.23.1792.1009"
timestamp=
"1618387447021"
/>
</component>
</component>
</project>
</project>
\ No newline at end of file
common/run_method.py
View file @
ca91e5b5
...
@@ -44,6 +44,11 @@ class RunMethod:
...
@@ -44,6 +44,11 @@ class RunMethod:
except
Exception
as
e
:
except
Exception
as
e
:
res
=
{
"err_msg"
:
str
(
e
)}
res
=
{
"err_msg"
:
str
(
e
)}
# print(res)
# print(res)
import
allure
if
return_json
:
allure
.
attach
(
body
=
json
.
dumps
(
res
,
ensure_ascii
=
False
),
name
=
'响应信息'
,
attachment_type
=
allure
.
attachment_type
.
JSON
)
else
:
allure
.
attach
(
body
=
res
.
text
,
name
=
'响应信息'
,
attachment_type
=
allure
.
attachment_type
.
TEXT
)
return
res
return
res
...
...
init_base_api.py
View file @
ca91e5b5
from
common.connect_db
import
OperationDb
from
common.common_util
import
replace_string
from
common.common_util
import
replace_string
import
psycopg2
import
psycopg2
import
os
import
os
...
@@ -15,7 +14,7 @@ def query_sql(database_config, sql_str):
...
@@ -15,7 +14,7 @@ def query_sql(database_config, sql_str):
return
results
return
results
def
get_base_apis
(
is_filter
=
True
):
def
get_base_apis
():
config
=
{
config
=
{
'database'
:
'edu-admin'
,
'database'
:
'edu-admin'
,
"user"
:
'read_user'
,
"user"
:
'read_user'
,
...
@@ -32,10 +31,8 @@ def get_base_apis(is_filter=True):
...
@@ -32,10 +31,8 @@ def get_base_apis(is_filter=True):
"path_params"
:
get_path_params
(
x
[
2
]),
"path_params"
:
get_path_params
(
x
[
2
]),
"http_method"
:
x
[
3
],
"http_method"
:
x
[
3
],
"method_name"
:
x
[
2
]
.
replace
(
"{"
,
""
)
.
replace
(
"}"
,
""
)
.
replace
(
"-"
,
"_"
)
.
replace
(
"/"
,
"_"
)[
1
:]
+
"_"
+
x
[
3
]
.
lower
(),
"method_name"
:
x
[
2
]
.
replace
(
"{"
,
""
)
.
replace
(
"}"
,
""
)
.
replace
(
"-"
,
"_"
)
.
replace
(
"/"
,
"_"
)[
1
:]
+
"_"
+
x
[
3
]
.
lower
(),
"file_name"
:
x
[
2
]
.
replace
(
"-"
,
"_"
)[
1
:]
.
split
(
"/"
)[
0
]
+
"
temp
.py"
"file_name"
:
x
[
2
]
.
replace
(
"-"
,
"_"
)[
1
:]
.
split
(
"/"
)[
0
]
+
".py"
}
for
x
in
query_result
]
}
for
x
in
query_result
]
if
is_filter
:
base_apis
=
[
x
for
x
in
base_apis
if
x
.
get
(
"method_name"
)
not
in
get_current_method
()]
return
base_apis
return
base_apis
...
@@ -71,14 +68,6 @@ def create_all(base_apis: list):
...
@@ -71,14 +68,6 @@ def create_all(base_apis: list):
create_init_file
(
"script/base_api/__init__.py"
,
import_data_out
)
create_init_file
(
"script/base_api/__init__.py"
,
import_data_out
)
def
get_current_method
():
from
script
import
base_api
current_methods
=
dir
(
base_api
)
methods
=
[
"get"
,
"post"
,
"patch"
,
"head"
,
"delete"
,
"put"
]
current_methods
=
[
x
for
x
in
current_methods
if
x
.
split
(
"_"
)[
-
1
]
in
methods
]
return
current_methods
def
create_file
(
path
,
base_apis
):
def
create_file
(
path
,
base_apis
):
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
file
.
write
(
file_template
)
file
.
write
(
file_template
)
...
@@ -109,90 +98,113 @@ def create_init_file(path, import_datas):
...
@@ -109,90 +98,113 @@ def create_init_file(path, import_datas):
get_template
=
"""
get_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("GET", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("GET", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
post_template
=
"""
post_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("POST", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("POST", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
put_template
=
"""
put_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("PUT", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("PUT", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
delete_template
=
"""
delete_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("DELETE", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("DELETE", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
patch_template
=
"""
patch_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("PATCH", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("PATCH", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
head_template
=
"""
head_template
=
"""
@allure.step("${name}")
def ${method_name}(${path_params}params=None, header=None, return_json=True, **kwargs):
def ${method_name}(${path_params}params=None, header=None, return_json=True, default_assert=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
name = "${name}"
url = f"/${url}"
url = f"/${url}"
res = RunMethod.run_request("HEAD", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
res = RunMethod.run_request("HEAD", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res
return res
"""
"""
file_template
=
"""
file_template
=
"""
from common.run_method import RunMethod
from common.run_method import RunMethod
from script.public_asserts import public_assert
import pytest
import allure
"""
"""
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
base_apis
=
get_base_apis
()
# base_apis = get_base_apis()
print
(
"新接口"
,
base_apis
)
# create_all(base_apis)
x
=
input
(
"是否创建:"
)
pass
if
x
==
"是"
and
base_apis
:
create_all
(
base_apis
)
else
:
print
(
"取消创建"
)
init_new_base_api.py
View file @
ca91e5b5
from
common.common_util
import
replace_string
import
psycopg2
import
os
import
re
def
query_sql
(
database_config
,
sql_str
):
# 创建连接对象
with
psycopg2
.
connect
(
**
database_config
)
as
conn
:
with
conn
.
cursor
()
as
cur
:
cur
.
execute
(
sql_str
)
results
=
cur
.
fetchall
()
print
(
'查询结束'
)
return
results
def
get_base_apis
(
db_config
):
sql
=
"""SELECT name, server_name, url, http_method FROM service_user.permission WHERE type = 'URL'"""
query_result
=
query_sql
(
db_config
,
sql
)
base_apis
=
[{
"name"
:
x
[
0
],
"server_name"
:
x
[
1
]
.
replace
(
"-"
,
"_"
),
"url"
:
x
[
1
]
+
x
[
2
],
"path_params"
:
get_path_params
(
x
[
2
]),
"http_method"
:
x
[
3
],
"method_name"
:
x
[
2
]
.
replace
(
"{"
,
""
)
.
replace
(
"}"
,
""
)
.
replace
(
"-"
,
"_"
)
.
replace
(
"/"
,
"_"
)[
1
:]
+
"_"
+
x
[
3
]
.
lower
(),
"file_name"
:
x
[
2
]
.
replace
(
"-"
,
"_"
)[
1
:]
.
split
(
"/"
)[
0
]
+
".py"
}
for
x
in
query_result
]
return
base_apis
def
get_path_params
(
url
:
str
):
path_params
=
re
.
findall
(
r"{(.*?)}"
,
url
)
path_params_str
=
""
for
path_param
in
path_params
:
path_params_str
=
path_params_str
+
f
"{path_param}, "
return
path_params_str
def
create_all
(
base_apis
:
list
):
server_names
=
list
(
set
([
x
.
get
(
"server_name"
)
for
x
in
base_apis
]))
current_path
=
os
.
getcwd
()
import_data_out
=
[]
for
server_name
in
server_names
:
if
not
os
.
path
.
exists
(
"base_api_temp"
):
os
.
mkdir
(
"base_api_temp"
)
folder_path
=
os
.
path
.
join
(
current_path
,
"base_api_temp/"
+
server_name
)
folder_apis
=
[
x
for
x
in
base_apis
if
x
.
get
(
"server_name"
)
==
server_name
]
if
not
os
.
path
.
exists
(
folder_path
):
os
.
mkdir
(
folder_path
)
file_names
=
list
(
set
([
x
.
get
(
"file_name"
)
for
x
in
folder_apis
]))
init_file_path
=
os
.
path
.
join
(
folder_path
,
"__init__.py"
)
import_datas
=
[]
for
file_name
in
file_names
:
file_apis
=
[
x
for
x
in
folder_apis
if
x
.
get
(
"file_name"
)
==
file_name
]
if
file_name
==
"class.py"
:
file_name
=
"class_.py"
file_path
=
os
.
path
.
join
(
folder_path
,
file_name
)
create_file
(
file_path
,
file_apis
)
import_datas
.
append
(
f
"from script.base_api.{server_name}.{file_name.replace('.py', '')} import *"
)
create_init_file
(
init_file_path
,
import_datas
)
import_data_out
.
append
(
f
"from script.base_api.{server_name} import *"
)
create_init_file
(
"script/base_api/__init__.py"
,
import_data_out
)
def
get_current_method
():
from
script
import
base_api
current_methods
=
dir
(
base_api
)
methods
=
[
"get"
,
"post"
,
"patch"
,
"head"
,
"delete"
,
"put"
]
current_methods
=
[
x
for
x
in
current_methods
if
x
.
split
(
"_"
)[
-
1
]
in
methods
]
return
current_methods
def
create_file
(
path
,
base_apis
):
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
file
.
write
(
file_template
)
for
base_api
in
base_apis
:
http_method
=
base_api
[
"http_method"
]
if
http_method
.
upper
()
==
"GET"
:
data
=
replace_string
(
get_template
,
base_api
)
elif
http_method
.
upper
()
==
"POST"
:
data
=
replace_string
(
post_template
,
base_api
)
elif
http_method
.
upper
()
==
"HEAD"
:
data
=
replace_string
(
head_template
,
base_api
)
elif
http_method
.
upper
()
==
"PUT"
:
data
=
replace_string
(
put_template
,
base_api
)
elif
http_method
.
upper
()
==
"PATCH"
:
data
=
replace_string
(
patch_template
,
base_api
)
elif
http_method
.
upper
()
==
"DELETE"
:
data
=
replace_string
(
delete_template
,
base_api
)
else
:
data
=
replace_string
(
post_template
,
base_api
)
file
.
write
(
data
)
def
create_init_file
(
path
,
import_datas
):
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
for
import_data
in
import_datas
:
file
.
write
(
import_data
)
file
.
write
(
"
\r\n
"
)
get_template
=
"""
def ${method_name}(${path_params}params=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("GET", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
post_template
=
"""
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("POST", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
put_template
=
"""
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("PUT", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
delete_template
=
"""
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("DELETE", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
patch_template
=
"""
def ${method_name}(${path_params}params=None, body=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("PATCH", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
head_template
=
"""
def ${method_name}(${path_params}params=None, header=None, return_json=True, **kwargs):
'''
:param: url地址后面的参数
:body: 请求体
:return_json: 是否返回json格式的响应(默认是)
:header: 请求的header
:host: 请求的环境
:return: 默认json格式的响应, return_json=False返回原始响应
'''
name = "${name}"
url = f"/${url}"
res = RunMethod.run_request("HEAD", url, params=params, header=header, return_json=return_json, name=name, **kwargs)
return res
"""
file_template
=
"""
from common.run_method import RunMethod
"""
if
__name__
==
'__main__'
:
db_config
=
{
'database'
:
'edu-admin'
,
"user"
:
'read_user'
,
"password"
:
'c5JJUqmtTeaSaOTN2gs7'
,
"host"
:
'132.232.15.12'
,
"port"
:
5432
}
base_apis
=
get_base_apis
(
db_config
)
base_apis
=
[
x
for
x
in
base_apis
if
x
.
get
(
"method_name"
)
not
in
get_current_method
()]
print
(
base_apis
)
create_all
(
base_apis
)
script/ji_yun_ying_pc/statistical_report/test_receipt_detail.py
View file @
ca91e5b5
...
@@ -2,20 +2,20 @@ import allure
...
@@ -2,20 +2,20 @@ import allure
import
pytest
import
pytest
import
jsonpath
import
jsonpath
from
script.base_api.service_statistics.statistics
import
statistics_advance_charge_receipt_post
from
script.base_api.service_statistics.statistics
import
statistics_advance_charge_receipt_post
from
script.base_api.service_profile.students
import
students_queryById_get
from
script.ji_yun_ying_pc.statistical_report.data_config
import
receipt_detail_data
from
script.ji_yun_ying_pc.statistical_report.data_config
import
receipt_detail_data
from
script
import
public_asserts
from
script
import
public_asserts
from
script
import
public_asserts_api
from
script
import
public_asserts_api
from
script.default_header
import
jyy_header
from
script.default_header
import
jyy_header
@allure.epic
(
"测试收据明细报表"
)
@allure.feature
(
"测试收据明细报表"
)
@allure.feature
(
"测试收据明细报表"
)
class
TestReceiptDetail
:
class
TestReceiptDetail
:
@allure.story
(
"测试收据明细列表查询-关键字筛选"
)
@allure.story
(
"测试收据明细报表"
)
@allure.step
(
"测试收据明细列表查询-关键字筛选"
)
@pytest.mark.parametrize
(
"keyword"
,
receipt_detail_data
.
keywords
)
@pytest.mark.parametrize
(
"keyword"
,
receipt_detail_data
.
keywords
)
def
test_list_search
(
self
,
keyword
):
def
test_list_search
(
self
,
keyword
):
print
(
keyword
)
keyword_value
=
keyword
.
get
(
"keyword"
)
keyword_value
=
keyword
.
get
(
"keyword"
)
body
=
{
body
=
{
"pageNum"
:
1
,
"pageNum"
:
1
,
...
@@ -28,16 +28,13 @@ class TestReceiptDetail:
...
@@ -28,16 +28,13 @@ class TestReceiptDetail:
"schoolAreaType"
:
"收费"
"schoolAreaType"
:
"收费"
}
}
res
=
statistics_advance_charge_receipt_post
(
body
=
body
,
header
=
jyy_header
)
res
=
statistics_advance_charge_receipt_post
(
body
=
body
,
header
=
jyy_header
)
print
(
res
)
keyword_type
=
keyword
.
get
(
"keyword_type"
)
keyword_type
=
keyword
.
get
(
"keyword_type"
)
if
keyword_type
==
"student_name"
:
if
keyword_type
==
"student_name"
:
student_names
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..studentName"
)
student_names
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..studentName"
)
print
(
student_names
)
result
=
public_asserts
.
assert_res_field_contain_value
(
student_names
,
keyword_value
)
result
=
public_asserts
.
assert_res_field_contain_value
(
student_names
,
keyword_value
)
pytest
.
assume
(
result
)
pytest
.
assume
(
result
)
elif
keyword_type
==
"receipt"
:
elif
keyword_type
==
"receipt"
:
receipts
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..orderNo"
)
receipts
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..orderNo"
)
print
(
receipts
)
result
=
public_asserts
.
assert_res_field_equal_value
(
receipts
,
keyword_value
)
result
=
public_asserts
.
assert_res_field_equal_value
(
receipts
,
keyword_value
)
pytest
.
assume
(
result
)
pytest
.
assume
(
result
)
else
:
else
:
...
...
script/ji_yun_ying_pc/test_login.py
View file @
ca91e5b5
...
@@ -3,6 +3,8 @@ import jsonpath
...
@@ -3,6 +3,8 @@ import jsonpath
from
script.base_api.service_user.auth
import
auth_employee_post
from
script.base_api.service_user.auth
import
auth_employee_post
from
script.base_api.service_user.employees
import
*
from
script.base_api.service_user.employees
import
*
from
script.base_api.service_user.token
import
token_valid_get
from
script.base_api.service_user.token
import
token_valid_get
import
allure
import
pytest
@allure.feature
(
"不同账号的登录测试"
)
@allure.feature
(
"不同账号的登录测试"
)
...
...
script/ji_yun_ying_pc/test_order.py
View file @
ca91e5b5
...
@@ -6,6 +6,7 @@ from script.base_api.api_operation_web import *
...
@@ -6,6 +6,7 @@ from script.base_api.api_operation_web import *
from
script.base_api.service_user.employees
import
*
from
script.base_api.service_user.employees
import
*
from
script.default_header
import
jyy_header
from
script.default_header
import
jyy_header
import
time
import
time
import
pytest
def
get_class_info
(
class_list
):
def
get_class_info
(
class_list
):
...
...
url_to_method.py
View file @
ca91e5b5
import
re
def
get_current_method
():
from
script
import
base_api
current_methods
=
dir
(
base_api
)
methods
=
[
"get"
,
"post"
,
"patch"
,
"head"
,
"delete"
,
"put"
]
current_methods
=
[
x
for
x
in
current_methods
if
x
.
split
(
"_"
)[
-
1
]
in
methods
]
return
current_methods
def
get_method_name
(
url
:
str
):
if
re
.
match
(
r".*\d+"
,
url
):
method_re
=
re
.
sub
(
r"_\d+"
,
"_.+?"
,
url
)
method_names
=
[
x
for
x
in
get_current_method
()
if
re
.
match
(
method_re
,
x
)]
if
method_names
:
return
method_names
[
0
]
else
:
return
url
else
:
return
url
def
get_method
(
url
,
method
):
server_name
,
method_name
=
url
[
1
:]
.
replace
(
"-"
,
"_"
)
.
split
(
"/"
,
1
)
file_name
=
method_name
.
split
(
"/"
)[
0
]
server_name
=
server_name
method_name
=
get_method_name
(
method_name
.
replace
(
"/"
,
"_"
)
+
"_"
+
method
.
lower
())
print
(
f
"from script.base_api.{server_name}.{file_name} import {method_name}"
)
if
__name__
==
'__main__'
:
get_method
(
"/service-profile/app/transferred/22322/class/totalNum"
,
"GET"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment