This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/02-Keyword/tsg_ui/accounts/Accountspages.robot

65 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

*** Settings ***
Library Selenium2Library
Resource Accounts.robot
Resource ../Menu.robot
Library Collections
*** Keywords ***
CreatePage
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable}
Menu administartion Accounts
Accounts.CreateButton
Accounts.Create-Name ${name}
Accounts.Create-Username ${username}
Accounts.Create-Password ${accPasswd}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[4]/div/div[1]/input ${accPasswd}
run keyword if "${Required_Password_Change}"=="open" Run Keywords click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[5]/div/div
... AND sleep 1
... ELSE log 不开启密码过期验证
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[2]/form/div[6]/div/div/input ${day}
Accounts.Create-Enable ${accEnable}
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]
run keyword if "${text}"=="Name field is required." click element xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/button[2]
... ELSE IF log "name值为空不可以新建成功"
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值为空不可以新建成功"
Pages
[Arguments]
Menu administartion Accounts
sleep 3