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
98698624
Commit
98698624
authored
Jul 20, 2021
by
linguangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review
parent
9652f10d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
8 deletions
+16
-8
config/readConfig.py
+2
-2
main.py
+3
-1
src/framework/common.py
+2
-2
src/pageobject/basepage.py
+5
-0
src/pageobject/livecamerapage.py
+2
-1
src/testcase/test_LiveCameraPage.py
+2
-2
No files found.
config/readConfig.py
View file @
98698624
...
...
@@ -34,8 +34,8 @@ def test_password():
return
config
.
get
(
"account"
,
"password"
)
def
test_header
():
return_test
=
config
.
get
(
"header_require"
,
"lgw-b"
)
def
test_header
(
header_name
):
return_test
=
config
.
get
(
"header_require"
,
header_name
)
return
json
.
loads
(
return_test
)
...
...
main.py
View file @
98698624
import
pytest
import
os
import
time
from
src.framework
import
dingTalk
from
src.framework
import
common
if
__name__
==
'__main__'
:
htmlPath
=
"./report/AI-XM_Report{}.html"
.
format
(
common
.
year_to_minute
())
pytest
.
main
([
"-v"
,
'--alluredir={}'
.
format
(
htmlPath
),
'./src/testcase/
test_LiveCameraPage.py
'
,
"--durations=0"
])
pytest
.
main
([
"-v"
,
'--alluredir={}'
.
format
(
htmlPath
),
'./src/testcase/'
,
"--durations=0"
])
os
.
system
(
'allure generate {} -o ./report/output --clean'
.
format
(
htmlPath
))
# os.system('allure open report/output')
time
.
sleep
(
5
)
dingTalk
.
alert
()
os
.
system
(
"python -m http.server 63342 -d ./report/output"
)
...
...
src/framework/common.py
View file @
98698624
...
...
@@ -101,9 +101,9 @@ def get_token():
# 创建一个直播课,返回课程id和课程名称
def
create_a_live
(
start_time
,
start_time2
=
None
):
def
create_a_live
(
start_time
,
start_time2
=
None
,
header_name
=
"lgw-b"
):
xmtoken
=
get_token
()
basic_imforation
=
readConfig
.
test_header
()
basic_imforation
=
readConfig
.
test_header
(
header_name
=
header_name
)
userId
=
basic_imforation
[
'userId'
]
storeId
=
basic_imforation
[
'storeId'
]
storeUserId
=
basic_imforation
[
'storeUserId'
]
...
...
src/pageobject/basepage.py
View file @
98698624
...
...
@@ -151,6 +151,7 @@ class Page(object):
def
login
(
self
):
driver
=
self
.
driver
sleep
(
15
)
login_page
=
Page
(
driver
=
driver
)
# 手机号登录按钮
phone_login
=
(
By
.
ID
,
"rc-tabs-0-tab-2"
)
...
...
@@ -199,6 +200,10 @@ class Page(object):
def
mouse_stop_until_ele_show
(
self
,
*
ele
):
if
len
(
ele
)
==
2
:
ActionChains
(
self
.
driver
)
.
move_to_element
(
ele
[
0
])
.
perform
()
try
:
WebDriverWait
(
self
.
driver
,
10
)
.
until
(
EC
.
element_to_be_clickable
(
ele
[
1
]))
except
Exception
as
e
:
print
(
e
.
args
)
pass
else
:
ActionChains
(
self
.
driver
)
.
move_to_element
(
ele
)
.
perform
()
src/pageobject/livecamerapage.py
View file @
98698624
...
...
@@ -50,6 +50,7 @@ class LiveCameraPage(MainPage):
def
test_mouse_on_camera
(
self
):
for
self
.
i
in
self
.
list
:
self
.
sleep
(
1
)
self
.
mouse_stop_until_ele_show
(
self
.
find_element
(
self
.
i
))
self
.
ifElementExist
(
self
.
i
)
self
.
mouse_stop_until_ele_show
(
self
.
find_element
(
self
.
i
),
self
.
camera_image
)
print
(
self
.
i
)
src/testcase/test_LiveCameraPage.py
View file @
98698624
...
...
@@ -75,8 +75,8 @@ class TestLivePage(object):
before_open_camera_image
=
screenshot_path
(
sys
.
_getframe
()
.
f_code
.
co_name
)
+
"/"
+
year_to_minute
()
+
'.png'
self
.
Live_Camera_Page
.
save_screenshot
(
before_open_camera_image
)
get_allure_screenshots
(
before_open_camera_image
,
"开启摄像头镜像前截图"
)
self
.
Live_Camera_Page
.
mouse_on_camera
()
#
self.Live_Camera_Page.test_mouse_on_camera()
#
self.Live_Camera_Page.mouse_on_camera()
self
.
Live_Camera_Page
.
test_mouse_on_camera
()
self
.
Live_Camera_Page
.
sleep
(
2
)
self
.
Live_Camera_Page
.
click_camera_image
()
after_open_camera_image
=
screenshot_path
(
sys
.
_getframe
()
.
f_code
.
co_name
)
+
"/"
+
year_to_minute
()
+
'.png'
...
...
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