Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-sc
Commits
20b9b7f2
Commit
20b9b7f2
authored
Nov 09, 2023
by
章 登恒
Browse files
commit
parent
2df0b31a
Changes
2
Hide whitespace changes
Inline
Side-by-side
testcase/test_scene1/scene1_mainflow.py
View file @
20b9b7f2
...
@@ -168,15 +168,15 @@ class PurchaseOrder():###普通采购单界面操作
...
@@ -168,15 +168,15 @@ class PurchaseOrder():###普通采购单界面操作
###填写数量价格###
###填写数量价格###
for
i
in
range
(
1
):
for
i
in
range
(
1
):
wait
.
until
(
ec
.
visibility_of_element_located
((
By
.
XPATH
,
'(//td[@colid="col_16
4
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)))
wait
.
until
(
ec
.
visibility_of_element_located
((
By
.
XPATH
,
'(//td[@colid="col_16
5
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)))
#定位数量框并输入数量
#定位数量框并输入数量
element
=
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_16
4
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)
element
=
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_16
5
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)
chrome
.
execute_script
(
"arguments[0].click();"
,
element
)
chrome
.
execute_script
(
"arguments[0].click();"
,
element
)
sleep
(
0.5
)
sleep
(
0.5
)
chrome
.
find_element_by_class_name
(
'awsui-input-number-right'
).
send_keys
(
'1'
)
chrome
.
find_element_by_class_name
(
'awsui-input-number-right'
).
send_keys
(
'1'
)
sleep
(
1
)
sleep
(
1
)
#点击其它地方让数量框失焦,让数量真正填入数量框(平台设计如此,不用纠结为啥要此步)
#点击其它地方让数量框失焦,让数量真正填入数量框(平台设计如此,不用纠结为啥要此步)
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_17
1
" and @f="F_PURUNIT_TXT" and @i=%s])'
%
i
).
click
()
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_17
2
" and @f="F_PURUNIT_TXT" and @i=%s])'
%
i
).
click
()
sleep
(
1
)
sleep
(
1
)
def
return_pchno
(
self
):
#返回采购单号
def
return_pchno
(
self
):
#返回采购单号
return
orderno1
return
orderno1
...
...
testcase/test_scene3/scene3_mainflow.py
View file @
20b9b7f2
...
@@ -157,15 +157,15 @@ class QuickPurchase():#快速采购单界面操作
...
@@ -157,15 +157,15 @@ class QuickPurchase():#快速采购单界面操作
###填写数量价格###
###填写数量价格###
for
i
in
range
(
1
):
for
i
in
range
(
1
):
wait
.
until
(
ec
.
visibility_of_element_located
((
By
.
XPATH
,
'(//td[@colid="col_16
5
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)))
wait
.
until
(
ec
.
visibility_of_element_located
((
By
.
XPATH
,
'(//td[@colid="col_16
6
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)))
#定位数量框并输入数量
#定位数量框并输入数量
element
=
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_16
5
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)
element
=
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_16
6
" and @f="F_QUANTITY_ORD" and @i=%s])'
%
i
)
chrome
.
execute_script
(
"arguments[0].click();"
,
element
)
chrome
.
execute_script
(
"arguments[0].click();"
,
element
)
sleep
(
0.5
)
sleep
(
0.5
)
chrome
.
find_element_by_class_name
(
'awsui-input-number-right'
).
send_keys
(
'1'
)
chrome
.
find_element_by_class_name
(
'awsui-input-number-right'
).
send_keys
(
'1'
)
sleep
(
1
)
sleep
(
1
)
#点击其它地方让数量框失焦,让数量真正填入数量框(平台设计如此,不用纠结为啥要此步)
#点击其它地方让数量框失焦,让数量真正填入数量框(平台设计如此,不用纠结为啥要此步)
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_17
2
" and @f="F_PURUNIT_TXT" and @i=%s])'
%
i
).
click
()
chrome
.
find_element_by_xpath
(
'(//td[@colid="col_17
3
" and @f="F_PURUNIT_TXT" and @i=%s])'
%
i
).
click
()
sleep
(
1
)
sleep
(
1
)
def
return_owtorder
(
self
):
#返回采购单号
def
return_owtorder
(
self
):
#返回采购单号
...
@@ -229,6 +229,6 @@ if __name__ == '__main__':
...
@@ -229,6 +229,6 @@ if __name__ == '__main__':
traceback
.
print_exc
()
traceback
.
print_exc
()
step6
.
handle
(
errmsg3
,
e
)
step6
.
handle
(
errmsg3
,
e
)
finally
:
#
finally:
chrome
.
quit
()
#
chrome.quit()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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