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
ecf5e4dc
Commit
ecf5e4dc
authored
Jul 21, 2021
by
linguangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review
parent
ad5537b7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
22 deletions
+9
-22
config/config.ini
+1
-6
config/readConfig.py
+0
-8
src/framework/common.py
+4
-4
src/pageobject/basepage.py
+3
-3
src/testcase/test_LiveCameraPage.py
+1
-1
No files found.
config/config.ini
View file @
ecf5e4dc
...
@@ -12,13 +12,8 @@ mac_app_location = /Applications/小麦企学院.app/Contents/MacOS/小麦企学
...
@@ -12,13 +12,8 @@ mac_app_location = /Applications/小麦企学院.app/Contents/MacOS/小麦企学
[testEnv]
[testEnv]
env
=
prod
env
=
prod
[account]
# 白名单账号
username
=
13777867342
password
=
0000
[header_require]
[header_require]
lgw-b
=
{"userId":"1394908740376522754","storeId":"1211601438838495999","storeUserId":"1394257952460828673","enterpriseId":"1398199018246803458"}
lgw-b
=
{"user
name" = "13777867342", "password" = "0000", "user
Id":"1394908740376522754","storeId":"1211601438838495999","storeUserId":"1394257952460828673","enterpriseId":"1398199018246803458"}
[MySql]
[MySql]
...
...
config/readConfig.py
View file @
ecf5e4dc
...
@@ -26,14 +26,6 @@ def get_env():
...
@@ -26,14 +26,6 @@ def get_env():
return
env
return
env
def
test_account
():
return
config
.
get
(
"account"
,
"username"
)
def
test_password
():
return
config
.
get
(
"account"
,
"password"
)
def
test_header
(
header_name
):
def
test_header
(
header_name
):
return_test
=
config
.
get
(
"header_require"
,
header_name
)
return_test
=
config
.
get
(
"header_require"
,
header_name
)
return
json
.
loads
(
return_test
)
return
json
.
loads
(
return_test
)
...
...
src/framework/common.py
View file @
ecf5e4dc
...
@@ -83,9 +83,9 @@ def get_allure_screenshots(screenshot_path, describe):
...
@@ -83,9 +83,9 @@ def get_allure_screenshots(screenshot_path, describe):
# 小麦接口相关
# 小麦接口相关
# 获取登录token
# 获取登录token
def
get_token
():
def
get_token
(
user
):
account
=
readConfig
.
test_
account
()
account
=
readConfig
.
test_
header
(
user
)[
'username'
]
password
=
readConfig
.
test_
password
()
password
=
readConfig
.
test_
header
(
user
)[
'password'
]
headers
=
{
"Content-Type"
:
"application/json; charset=UTF-8"
,
headers
=
{
"Content-Type"
:
"application/json; charset=UTF-8"
,
"User-Agent"
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"User-Agent"
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.77 Safari/537.36"
}
"Chrome/91.0.4472.77 Safari/537.36"
}
...
@@ -102,7 +102,7 @@ def get_token():
...
@@ -102,7 +102,7 @@ def get_token():
# 创建一个直播课,返回课程id和课程名称
# 创建一个直播课,返回课程id和课程名称
def
create_a_live
(
start_time
,
start_time2
=
None
,
header_name
=
"lgw-b"
):
def
create_a_live
(
start_time
,
start_time2
=
None
,
header_name
=
"lgw-b"
):
xmtoken
=
get_token
()
xmtoken
=
get_token
(
header_name
)
basic_imforation
=
readConfig
.
test_header
(
header_name
=
header_name
)
basic_imforation
=
readConfig
.
test_header
(
header_name
=
header_name
)
userId
=
basic_imforation
[
'userId'
]
userId
=
basic_imforation
[
'userId'
]
storeId
=
basic_imforation
[
'storeId'
]
storeId
=
basic_imforation
[
'storeId'
]
...
...
src/pageobject/basepage.py
View file @
ecf5e4dc
...
@@ -174,7 +174,7 @@ class Page(object):
...
@@ -174,7 +174,7 @@ class Page(object):
if
have_ele
:
if
have_ele
:
break
break
def
login
(
self
):
def
login
(
self
,
user
=
'lgw-b'
):
driver
=
self
.
driver
driver
=
self
.
driver
sleep
(
15
)
sleep
(
15
)
login_page
=
Page
(
driver
=
driver
)
login_page
=
Page
(
driver
=
driver
)
...
@@ -200,8 +200,8 @@ class Page(object):
...
@@ -200,8 +200,8 @@ class Page(object):
# login_page.excute_script_dominance("form xm_phone_login")
# login_page.excute_script_dominance("form xm_phone_login")
# login_page.sleep(2)
# login_page.sleep(2)
login_page
.
input_text
(
account_input
,
readConfig
.
test_
account
()
)
login_page
.
input_text
(
account_input
,
readConfig
.
test_
header
(
user
)[
'username'
]
)
login_page
.
input_text
(
password_input
,
readConfig
.
test_
password
()
)
login_page
.
input_text
(
password_input
,
readConfig
.
test_
header
(
user
)[
'username'
]
)
login_page
.
click
(
login_button
)
login_page
.
click
(
login_button
)
login_page
.
sleep
(
2
)
login_page
.
sleep
(
2
)
login_page
.
click_text
(
"取 消"
)
login_page
.
click_text
(
"取 消"
)
...
...
src/testcase/test_LiveCameraPage.py
View file @
ecf5e4dc
...
@@ -88,7 +88,7 @@ class TestLivePage(object):
...
@@ -88,7 +88,7 @@ class TestLivePage(object):
assert
30
<
result
assert
30
<
result
@pytest.mark.run
(
order
=
4
)
@pytest.mark.run
(
order
=
4
)
@pytest.mark.skip
()
#
@pytest.mark.skip()
@allure.title
(
"测试摄像头功能-关闭摄像头-方法2"
)
@allure.title
(
"测试摄像头功能-关闭摄像头-方法2"
)
def
testCloseCameraByFunction2
(
self
):
def
testCloseCameraByFunction2
(
self
):
self
.
Live_Camera_Page
.
excute_script_display
(
"topBox"
)
self
.
Live_Camera_Page
.
excute_script_display
(
"topBox"
)
...
...
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