Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CMS2.0_UI_AUTOMATION_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
王超
CMS2.0_UI_AUTOMATION_TEST
Commits
4fc7c882
Commit
4fc7c882
authored
Sep 06, 2024
by
王超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conftest.py文件
parent
9a2ccf70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
27 deletions
+24
-27
mode_LoginButton.py
TestCases/mode_LoginButton.py
+0
-0
conftest.py
conftest.py
+24
-27
No files found.
TestCases/
Test
_LoginButton.py
→
TestCases/
mode
_LoginButton.py
View file @
4fc7c882
File moved
conftest.py
View file @
4fc7c882
...
...
@@ -151,6 +151,30 @@ def project_init():
except
Exception
as
e
:
error_log
(
f
"获取工程信息失败:{e}"
)
"""导入内部变量,并启动变量服务"""
url
=
Config
.
url
+
r"/api/v1/variable/import"
x_project
=
DubugTalk
()
.
read_extract_file
(
"x_project"
)
header
=
{
'X-Project'
:
f
"{x_project}"
}
file_path
=
Config
.
root_dir
+
r"\ProjectData\内部变量.xlsx"
try
:
with
open
(
file_path
,
'rb'
)
as
file
:
files
=
{
'file'
:
(
'filename'
,
file
,
'text/plain'
)}
re
=
requests
.
post
(
url
=
url
,
headers
=
header
,
files
=
files
)
print
()
if
re
.
status_code
!=
200
:
print
(
"变量导入失败:"
,
re
.
status_code
)
except
Exception
as
e
:
error_log
(
f
"变量导入失败:{e}"
)
# 启动变量服务
try
:
url
=
Config
.
url
+
r"/api/v1/project/service/var/start"
re
=
requests
.
post
(
url
=
url
,
headers
=
header
)
if
re
.
status_code
!=
200
:
print
(
"启动变量服务失败:"
,
re
.
status_code
)
except
Exception
as
e
:
error_log
(
f
"启动变量服务失败:{e}"
)
@pytest.fixture
(
scope
=
"session"
,
autouse
=
True
)
def
upload_image
():
"""
...
...
@@ -211,34 +235,7 @@ def create_page():
error_log
(
f
"画面删除失败,状态码为{re.status_code}"
)
except
Exception
as
e
:
error_log
(
f
"页面删除失败:{e}"
)
@pytest.fixture
(
scope
=
"function"
,
autouse
=
True
)
def
import_var
():
"""
导入内部变量,并启动变量服务
:return:
"""
url
=
Config
.
url
+
r"/api/v1/variable/import"
x_project
=
DubugTalk
()
.
read_extract_file
(
"x_project"
)
header
=
{
'X-Project'
:
f
"{x_project}"
}
file_path
=
Config
.
root_dir
+
r"\ProjectData\内部变量.xlsx"
try
:
with
open
(
file_path
,
'rb'
)
as
file
:
files
=
{
'file'
:
(
'filename'
,
file
,
'text/plain'
)}
re
=
requests
.
post
(
url
=
url
,
headers
=
header
,
files
=
files
)
print
()
if
re
.
status_code
!=
200
:
print
(
"变量导入失败:"
,
re
.
status_code
)
except
Exception
as
e
:
error_log
(
f
"变量导入失败:{e}"
)
# 启动变量服务
try
:
url
=
Config
.
url
+
r"/api/v1/project/service/var/start"
re
=
requests
.
post
(
url
=
url
,
headers
=
header
)
if
re
.
status_code
!=
200
:
print
(
"启动变量服务失败:"
,
re
.
status_code
)
except
Exception
as
e
:
error_log
(
f
"启动变量服务失败:{e}"
)
@pytest.fixture
(
scope
=
"function"
,
autouse
=
False
)
def
write_var
():
"""
...
...
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