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
cc3093ad
Commit
cc3093ad
authored
Apr 14, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改前置提示
parent
327cb1d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
conftest.py
script/conftest.py
+5
-1
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+37
-2
No files found.
script/conftest.py
View file @
cc3093ad
import
allure
import
pytest
import
jsonpath
from
script
import
default_header
...
...
@@ -18,15 +19,17 @@ def pytest_addoption(parser):
parser
.
addoption
(
"--account"
,
default
=
"A"
,
dest
=
"account"
,
help
=
"set run default account group"
)
@allure.title
(
'测试环境变量前置'
)
@pytest.fixture
(
scope
=
'session'
,
autouse
=
True
)
def
get_host
(
pytestconfig
):
# 初始化测试环境变量
common_config
[
"host"
]
=
pytestconfig
.
getoption
(
'--host'
)
allure
.
attach
(
body
=
common_config
[
"host"
],
name
=
'测试环境'
,
attachment_type
=
allure
.
attachment_type
.
TEXT
)
# 初始化测试数据库配置
common_config
[
"db_config"
]
=
db_configs
.
get
(
pytestconfig
.
getoption
(
'--db'
))
@allure.title
(
'极运营登录前置'
)
@pytest.fixture
(
scope
=
"session"
,
autouse
=
True
)
def
ji_yun_ying_login
(
pytestconfig
):
account
=
accounts
.
get
(
pytestconfig
.
getoption
(
'--account'
)
.
upper
())
...
...
@@ -47,6 +50,7 @@ def ji_yun_ying_login(pytestconfig):
default_header
.
jyy_header
.
setdefault
(
"Authorization"
,
"token not found"
)
@allure.title
(
'小程序登录前置'
)
@pytest.fixture
(
scope
=
"session"
,
autouse
=
True
)
def
gos_login
(
pytestconfig
):
account
=
accounts
.
get
(
pytestconfig
.
getoption
(
'--account'
)
.
upper
())
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
cc3093ad
...
...
@@ -42,8 +42,8 @@ class TestChooseClasses:
productType
=
'副线课程'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
self
.
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
self
.
class_id
])
.
network_set
()
# 断言校区
@allure.story
(
'选课中心-校区'
)
...
...
@@ -268,3 +268,37 @@ class TestChooseClasses:
}
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
class_id
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..id'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了副线班,看不到常规班'
)
@allure.description
(
'学生购买了副线班,不能看到常规班'
)
def
test_choose_buy_subLine_not_groove
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
self
.
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
100
}
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了当期前的常规班,看不到常规班'
)
@allure.description
(
'购买了当期前的常规班,不能看到常规班和新生班'
)
def
test_choose_buy_after_groove_not_now
(
self
):
with
assume
:
assert
1
==
1
\ No newline at end of file
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