2020-06-02 11:51:59 +08:00
|
|
|
*** Settings ***
|
|
|
|
|
Library Selenium2Library
|
|
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
openbrower
|
|
|
|
|
Open Browser http:192.168.40.120 chrome
|
|
|
|
|
|
|
|
|
|
CreateButton
|
|
|
|
|
Wait Until Element Is Enabled id=userAdd
|
|
|
|
|
sleep 3
|
|
|
|
|
Click element id=userAdd
|
|
|
|
|
|
|
|
|
|
Create-Name
|
|
|
|
|
[Arguments] ${accName}
|
|
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${accName}
|
2020-06-02 11:51:59 +08:00
|
|
|
|
|
|
|
|
Create-Username
|
|
|
|
|
[Arguments] ${accName}
|
|
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[2]/div/div[1]/input ${accName}
|
2020-06-02 11:51:59 +08:00
|
|
|
|
|
|
|
|
Create-Password
|
|
|
|
|
[Arguments] ${accPasswd}
|
|
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[3]/div/div/input ${accPasswd}
|
2020-06-02 11:51:59 +08:00
|
|
|
|
2020-07-20 18:38:17 +08:00
|
|
|
Create-Enable
|
|
|
|
|
[Arguments] ${accEnable}
|
|
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
run keyword if "${accEnable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[6]/div/div
|
2020-07-20 18:38:17 +08:00
|
|
|
... AND sleep 1
|
|
|
|
|
... ELSE log 不操作
|
|
|
|
|
|
2020-06-02 11:51:59 +08:00
|
|
|
Create-Ok
|
|
|
|
|
sleep 1
|
2020-12-22 18:34:28 +08:00
|
|
|
click button xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1]
|
2020-06-02 11:51:59 +08:00
|
|
|
|
|
|
|
|
Create-Cancel
|
|
|
|
|
click button id=userAdd_cancel
|
|
|
|
|
|
|
|
|
|
SelectOne
|
|
|
|
|
sleep 3
|
|
|
|
|
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
|
|
|
|
|
|
|
|
|
DeleteButton
|
|
|
|
|
click button id=userDel
|
|
|
|
|
|
|
|
|
|
Delete-Delete
|
|
|
|
|
sleep 2
|
|
|
|
|
click button xpath=/html/body/div/div/div[3]/button[2]
|
|
|
|
|
|
|
|
|
|
Delete-Cancel
|
|
|
|
|
click button xpath=/html/body/div[2]/div/div[3]/button[1]
|
|
|
|
|
|
|
|
|
|
User-Delete
|
|
|
|
|
sleep 1
|
|
|
|
|
click element id=userDel #点击删除按钮
|
|
|
|
|
sleep 1
|
|
|
|
|
click element xpath=/html/body/div/div/div[3]/button[2]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User-Edit
|
2020-07-20 18:38:17 +08:00
|
|
|
[Arguments] ${name} ${password} ${enable}
|
2020-06-02 11:51:59 +08:00
|
|
|
Sleep 2
|
|
|
|
|
click element id=userEdit
|
|
|
|
|
Sleep 2
|
|
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div/div/div/div[2]/form/div[1]/div/div[1]/input ${name}
|
|
|
|
|
Sleep 1
|
2020-07-20 18:38:17 +08:00
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div/div/div[1]/div[2]/form/div[3]/div/div/input ${password}
|
|
|
|
|
Sleep 1
|
|
|
|
|
run keyword if "${enable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div/div/div[1]/div[2]/form/div[4]/div/div
|
|
|
|
|
... AND sleep 1
|
|
|
|
|
... ELSE log 不操作
|
|
|
|
|
click element xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/button[1]/span
|
|
|
|
|
sleep 2
|
2020-06-02 11:51:59 +08:00
|
|
|
|
|
|
|
|
Ui-User-Search-Name
|
2020-12-09 18:10:46 +08:00
|
|
|
[Arguments] ${name} ${type}
|
2020-07-20 18:38:17 +08:00
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
Wait Until Page Contains Element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/div/div[2]/div/div/div[1]/input 20
|
|
|
|
|
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/div/div[2]/div/div/div[1]/input
|
2020-06-02 11:51:59 +08:00
|
|
|
sleep 2
|
2020-12-09 18:10:46 +08:00
|
|
|
run keyword if "${type}"=="Name" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
|
|
|
|
|
... AND sleep 1
|
|
|
|
|
run keyword if "${type}"=="User Name" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
|
|
|
|
... AND sleep 1
|
2020-06-02 11:51:59 +08:00
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${name}
|
2020-06-02 11:51:59 +08:00
|
|
|
sleep 2
|
2020-12-22 18:34:28 +08:00
|
|
|
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/i
|
2020-06-02 11:51:59 +08:00
|
|
|
sleep 2
|
2020-12-09 18:10:46 +08:00
|
|
|
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
2020-07-20 18:38:17 +08:00
|
|
|
sleep 2
|
|
|
|
|
|
2020-06-02 11:51:59 +08:00
|
|
|
|
|
|
|
|
login
|
|
|
|
|
Input Text xpath=//*[@id="app"]/div/div[2]/div/div[2]/div/input sjy
|
|
|
|
|
sleep 1
|
|
|
|
|
Input Text xpath=//*[@id="app"]/div/div[2]/div/div[3]/div/input 111111
|
|
|
|
|
sleep 1
|
|
|
|
|
click element id=login
|
|
|
|
|
sleep 2
|
2020-07-20 18:38:17 +08:00
|
|
|
|
|
|
|
|
Ui-Pages
|
|
|
|
|
[Arguments] ${accpages}
|
|
|
|
|
click element xpath=//*[@id="app"]/div/div[3]/div/div/div[4]/div/ul/li[1]
|
|
|
|
|
sleep 2
|
|
|
|
|
click element xpath=//*[@id="app"]/div/div[3]/div/div/div[4]/div/button[2]/i
|
|
|
|
|
sleep 2
|
|
|
|
|
Clear Element Text xpath=//*[@id="app"]/div/div[3]/div/div/div[4]/div/span[2]/div/input
|
|
|
|
|
sleep 2
|
|
|
|
|
input text xpath=//*[@id="app"]/div/div[3]/div/div/div[4]/div/span[2]/div/input ${accpages}
|
|
|
|
|
sleep 2
|
|
|
|
|
press keys xpath=//*[@id="app"]/div/div[3]/div/div/div[4]/div/span[2]/div/input ENTER
|
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
|
|
Ui-Button
|
|
|
|
|
[Arguments] ${accEnable}
|
|
|
|
|
Menu administartion Accounts
|
|
|
|
|
sleep 2
|
|
|
|
|
click element id=userAdd
|
|
|
|
|
sleep 2
|
|
|
|
|
run keyword if "${accEnable}"=="close" run keywords click element xpath=//*[@id="app"]/div/div[3]/div/div/div[1]/div[2]/form/div[4]/div/div
|
|
|
|
|
... AND sleep 1
|
|
|
|
|
... ELSE log success
|