2020-06-02 11:51:59 +08:00
*** Settings ***
Library Selenium2Library
Resource Accounts.robot
Resource ../Menu.robot
Library Collections
*** Keywords ***
CreatePage
2020-12-22 18:34:28 +08:00
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable} ${role}
Menu administration Accounts
2020-06-02 11:51:59 +08:00
Accounts.CreateButton
Accounts.Create-Name ${name}
Accounts.Create-Username ${username}
Accounts.Create-Password ${accPasswd}
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[4]/div/div/input ${accPasswd}
run keyword if "${Required_Password_Change}"=="open" Run Keywords click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[5]/div/div
2020-12-09 18:10:46 +08:00
... AND sleep 1
2020-12-22 18:34:28 +08:00
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[6]/div/div/input ${day}
... ELSE log 不开启密码过期验证
2020-07-20 18:38:17 +08:00
Accounts.Create-Enable ${accEnable}
2020-12-22 18:34:28 +08:00
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[8]/div/div/div/span/span/i
sleep 1
click element //span[.="${role}"]
2020-06-02 11:51:59 +08:00
Accounts.Create-Ok
DeletePage
[Arguments] ${name}
sleep 1
Accounts.DeleteButton 1
Accounts.Delete-Delete
CreatePage-null
[Arguments] ${name} ${username} ${accPasswd}
Menu administartion Accounts
sleep 3
Accounts.CreateButton
Accounts.Create-Name ${name}
Accounts.Create-Username ${username}
Accounts.Create-Password ${accPasswd}
Accounts.Create-Ok
sleep 2
${text} get text xpath=//*[@id="app"]/div/div[3]/div/div/div/div[2]/form/div[1]/div/div[3]
2020-07-20 18:38:17 +08:00
run keyword if "${text}"=="Name field is required." click element xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/button[2]
2020-06-02 11:51:59 +08:00
... ELSE IF log "name值为空, 不可以新建成功"
2020-07-20 18:38:17 +08:00
2020-06-02 11:51:59 +08:00
CreatePage-User-Name-null
[Arguments] ${name} ${username} ${accPasswd}
Menu administartion Accounts
sleep 3
Accounts.CreateButton
Accounts.Create-Name ${name}
Accounts.Create-Username ${username}
Accounts.Create-Password ${accPasswd}
Accounts.Create-Ok
sleep 2
${text} get text xpath=//*[@id="app"]/div/div[3]/div/div/div/div[2]/form/div[2]/div/div[3]
run keyword if "${text}"=="Account field is required." click element xpath=//*[@id="app"]/div/div[3]/div/div/div/div[2]/form/div[6]/div/div/button[2]
... ELSE IF log "name值为空, 不可以新建成功"
2020-07-20 18:38:17 +08:00
Pages
[Arguments]
Menu administartion Accounts
sleep 3