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
b2120487
Commit
b2120487
authored
Jul 06, 2021
by
linguangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加本地文件路径区分mac/windows
parent
46dd17ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
config/config.ini
+2
-1
config/readConfig.py
+10
-2
No files found.
config/config.ini
View file @
b2120487
...
@@ -6,7 +6,8 @@ browserName = Chrome
...
@@ -6,7 +6,8 @@ browserName = Chrome
[testServer]
[testServer]
#调试客户端本地文件路径
#调试客户端本地文件路径
app_location
=
C:
\U
sers
\A
dministrator
\A
ppData
\L
ocal
\P
rograms
\x
mqxy
\小
麦企学院.exe
win_app_location
=
C:
\U
sers
\A
dministrator
\A
ppData
\L
ocal
\P
rograms
\x
mqxy
\小
麦企学院.exe
mac_app_location
=
C:
\U
sers
\A
dministrator
\A
ppData
\L
ocal
\P
rograms
\x
mqxy
\小
麦企学院
[account]
[account]
# 白名单账号
# 白名单账号
...
...
config/readConfig.py
View file @
b2120487
import
configparser
import
configparser
import
os
import
os
import
platform
config
=
configparser
.
ConfigParser
()
config
=
configparser
.
ConfigParser
()
...
@@ -9,12 +10,18 @@ config.read(dir + "/config/config.ini", encoding='utf-8')
...
@@ -9,12 +10,18 @@ config.read(dir + "/config/config.ini", encoding='utf-8')
# 根据配置文件获取测试url
# 根据配置文件获取测试url
def
test_location
():
def
test_location
():
location
=
config
.
get
(
"testServer"
,
"app_location"
)
current_platform
=
platform
.
system
()
.
lower
()
return
location
if
current_platform
==
"windows"
:
location
=
config
.
get
(
"testServer"
,
"win_app_location"
)
return
location
elif
current_platform
==
"darwin"
:
location
=
config
.
get
(
"testServer"
,
"mac_app_location"
)
return
location
def
test_account
():
def
test_account
():
return
config
.
get
(
"account"
,
"username"
)
return
config
.
get
(
"account"
,
"username"
)
def
test_password
():
def
test_password
():
return
config
.
get
(
"account"
,
"password"
)
return
config
.
get
(
"account"
,
"password"
)
\ 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