Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-uitest-sow
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-uitest-sow
Commits
435d5bb4
Commit
435d5bb4
authored
Aug 01, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增“全员禁言”case
parent
411fb4eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
src/pageobject/livediscusspage.py
+8
-2
src/testcase/test_LiveDiscussFiled.py
+17
-3
No files found.
src/pageobject/livediscusspage.py
View file @
435d5bb4
...
...
@@ -11,8 +11,10 @@ class LiveDiscussPage(MainPage):
discuss_box
=
(
By
.
XPATH
,
"//div[@class='textBox']/textarea"
)
# 发送按钮
discuss_submit_btn
=
(
By
.
XPATH
,
"""//div/button/span[text()="发 送"]"""
)
# 学员禁言按钮
discuss_forbid
=
(
By
.
XPATH
,
"//span[@class='ant-checkbox']/ant-checkbox-input"
)
# 学员未禁言
discuss_forbid
=
(
By
.
XPATH
,
"//div/label[@class='ant-checkbox-wrapper']"
)
# 学员已禁言
discuss_forbided
=
(
By
.
XPATH
,
"//div/label[@class='ant-checkbox-wrapper ant-checkbox-wrapper-checked']/span"
)
# 讨论文字显示区
message_box
=
(
By
.
XPATH
,
"""//div[@class='messageBox mine']//div[text()="discuss"]"""
)
...
...
@@ -39,4 +41,8 @@ class LiveDiscussPage(MainPage):
def
click_discuss_forbid
(
self
):
self
.
click
(
self
.
discuss_forbid
)
# 点击取消全员禁言
def
click_discuss_forbided
(
self
):
self
.
click
(
self
.
discuss_forbided
)
src/testcase/test_LiveDiscussFiled.py
View file @
435d5bb4
...
...
@@ -23,6 +23,7 @@ class TestLivePage(object):
def
before_test
(
self
):
self
.
logger
=
Logger
(
'live page'
)
.
getlog
()
time
.
sleep
(
15
)
live_course_name
=
create_a_live
(
start_time
=
25
,
user
=
"zhangy-b"
)
# 这里停15s是因为setUP里创建直播间获取token登录了一次,限制两次登录需间隔15s
...
...
@@ -30,13 +31,14 @@ class TestLivePage(object):
self
.
Live_Discuss_Page
.
sleep
(
2
)
# print("***********"+live_course_name[0])
self
.
Live_Discuss_Page
.
click_in_live_btn
(
live_course_name
[
0
])
self
.
Live_Discuss_Page
.
sleep
(
6
)
# self.Live_Discuss_Page.click_in_live_btn("blGT35WO"[0])
self
.
Live_Discuss_Page
.
sleep
(
5
)
self
.
Live_Discuss_Page
.
change_window
(
self
.
Live_Discuss_Page
.
discuss_tab
)
self
.
Live_Discuss_Page
.
click_discuss_tab
()
self
.
Live_Discuss_Page
.
sleep
(
2
)
yield
self
.
driver
self
.
driver
.
quit
()
#
yield self.driver
#
self.driver.quit()
@pytest.mark.run
(
order
=
1
)
@allure.title
(
"切换页面到讨论区"
)
...
...
@@ -68,6 +70,17 @@ class TestLivePage(object):
assert
self
.
Live_Discuss_Page
.
ifElementExist
(
self
.
Live_Discuss_Page
.
discuss_box
)
@pytest.mark.run
(
order
=
4
)
@allure.title
(
"全员禁言"
)
def
testDiscussField1
(
self
):
# 点击“讨论”按钮
self
.
Live_Discuss_Page
.
click_discuss_tab
()
self
.
Live_Discuss_Page
.
sleep
(
2
)
self
.
Live_Discuss_Page
.
click_discuss_forbid
()
self
.
Live_Discuss_Page
.
sleep
(
2
)
assert
self
.
Live_Discuss_Page
.
ifElementExist
(
self
.
Live_Discuss_Page
.
discuss_forbided
)
if
__name__
==
'__main__'
:
pytest
.
main
([
"-v"
])
\ 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