1.Settings关键字 2.修改增加 Adminstration关键字 3.修改usersCase 用例
This commit is contained in:
@@ -5,10 +5,23 @@ Library Collections
|
||||
Library ../../../04-CustomLibrary/Custometest/StringManipulation.py
|
||||
|
||||
*** Keywords ***
|
||||
Pages
|
||||
[Arguments]
|
||||
Menu administartion Accounts
|
||||
sleep 2
|
||||
OpenPages
|
||||
[Arguments] ${SecondaryMenu} ${Three-levelMenu} ${Targeting}=null ${Amenu}=null
|
||||
[Documentation]
|
||||
... ${SecondaryMenu}:二级菜单
|
||||
... ${Three-levelMenu}:三级菜单
|
||||
... ${Targeting} :三级菜单 定位方式 默认不输入为id
|
||||
run keyword if "${Amenu}"=="null" run keywords sleep 1
|
||||
... AND click element id=children7
|
||||
... ELSE click element id=${Amenu}
|
||||
Sleep 1
|
||||
click element id=${SecondaryMenu}
|
||||
sleep 1
|
||||
run keyword if "${Targeting}"=="null" run keywords sleep 1
|
||||
... AND click element id=${Three-levelMenu}
|
||||
run keyword if "${Targeting}"=="xpath" run keywords sleep 1
|
||||
... AND click element ${Targeting}=${Three-levelMenu}
|
||||
sleep 2
|
||||
|
||||
UserCreatePage
|
||||
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable} ${role}
|
||||
@@ -34,10 +47,13 @@ UserCreatePage
|
||||
... ELSE log 不开启密码过期验证
|
||||
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[last()]/div/div/div/span/span/i
|
||||
sleep 1
|
||||
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
|
||||
sleep 1
|
||||
click element //span[.="${role}"]
|
||||
sleep 1
|
||||
click button xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1]
|
||||
sleep 1
|
||||
Wait Until Element Is Enabled id=profilesTabs_Profile_ResponsePages 20
|
||||
|
||||
UserEdit
|
||||
[Arguments] ${password} ${enable}
|
||||
Sleep 2
|
||||
@@ -53,25 +69,69 @@ UserEdit
|
||||
sleep 1
|
||||
click button xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1]
|
||||
sleep 2
|
||||
|
||||
UserSearchName
|
||||
[Arguments] ${name} ${type}
|
||||
sleep 2
|
||||
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
|
||||
sleep 2
|
||||
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}"=="UserName" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||||
... AND sleep 1
|
||||
sleep 2
|
||||
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}
|
||||
sleep 2
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/i
|
||||
sleep 2
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 2
|
||||
|
||||
CreateRoles
|
||||
[Arguments] ${name} ${description} ${list}
|
||||
[Documentation]
|
||||
... ${name}:角色权限名称
|
||||
... ${description}:备注
|
||||
... ${list}:权限定位列表
|
||||
sleep 1
|
||||
Click element id=children7
|
||||
sleep 1
|
||||
Click element id=sidebarsystem_accounts
|
||||
sleep 1
|
||||
Click element id=profilesTabs_Profile_Insert
|
||||
sleep 1
|
||||
Click element id=app_create
|
||||
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[1]/div/div[1]/input 20
|
||||
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${name}
|
||||
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[2]/div/div/input ${description}
|
||||
sleep 1
|
||||
FOR ${i} IN @{list}
|
||||
log ${i}
|
||||
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
|
||||
click element xpath=${i}
|
||||
sleep 1
|
||||
END
|
||||
click element id=rolesOk
|
||||
sleep 1
|
||||
|
||||
EditRoles
|
||||
[Arguments] ${name}=null ${description}=null ${Authority}=null ${Authorityxpath}=null
|
||||
sleep 1
|
||||
click element id=appEdit
|
||||
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[1] 20
|
||||
run keyword if "${name}" != "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[1]/div/div[1]/input ${name}
|
||||
... ELSE log name不修改
|
||||
run keyword if "${description}" != "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/div[2]/form/div[2]/div/div/input ${description}
|
||||
... ELSE log description不修改
|
||||
run keyword if "${Authority}" != "null" run keywords sleep 1
|
||||
... AND click element xpath=${Authorityxpath}
|
||||
... ELSE log 权限不修改
|
||||
sleep 1
|
||||
click element id=rolesOk
|
||||
sleep 1
|
||||
|
||||
RolesVerification
|
||||
[Arguments] ${rolexpath} ${role}
|
||||
[Documentation]
|
||||
... ${rolexpath}:权限在侧滑框的定位
|
||||
... ${role} : 权限 (Enable、ReadOnly、Disable)
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[3]/div/div/span/span
|
||||
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[5]/div 20
|
||||
${text} Get Element Attribute xpath=${rolexpath} class
|
||||
${role} Set Variable if "${role}" == "Enable" iconfont switch_i icon-Rolesenable
|
||||
... "${role}" == "ReadOnly" iconfont switch_i icon-Rolesreadonly
|
||||
... "${role}" == "Disable" iconfont switch_i icon-Rolesdisable
|
||||
sleep 1
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[5]/div/div[2]/div/button
|
||||
sleep 1
|
||||
Should Be Equal As Strings ${text} ${role}
|
||||
|
||||
|
||||
Login
|
||||
[Arguments] ${UserName} ${Password}
|
||||
Mouse Hover xpath=//*[@id="app"]/div/div[1]/div[2]/div/span/div/span
|
||||
@@ -116,6 +176,8 @@ TurnPage
|
||||
|
||||
PagingDisplay
|
||||
[Arguments] ${Number}
|
||||
[Documentation]
|
||||
... ${Number}: 设置页面显示数据条数 (20、5、30、50、100)
|
||||
Mouse Over xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[4]/span/div/i
|
||||
sleep 1
|
||||
run keyword if "${Number}"=="30" run keywords sleep 1
|
||||
@@ -135,13 +197,55 @@ PagingDisplay
|
||||
sleep 1
|
||||
${quyu} Evaluate ${Quantity}%${Number}
|
||||
${qumo} Evaluate ${Quantity}/${Number}
|
||||
${qumo} Evaluate int(${qumo})
|
||||
${quzheng} Evaluate int(${qumo})
|
||||
${b} Set Variable ${1}
|
||||
${Page1} Evaluate ${qumo}+${b}
|
||||
${Page} Set Variable if "${qumo}" != "0" ${Page1} ${qumo}
|
||||
sleep 1
|
||||
${text} Get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[4]/div/ul/li[last()]
|
||||
Should Be Equal As Strings ${text} ${Page}
|
||||
|
||||
|
||||
|
||||
UserSearchName
|
||||
[Arguments] ${name} ${type}
|
||||
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
|
||||
sleep 2
|
||||
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}"=="UserName" run keywords click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||||
... AND sleep 1
|
||||
sleep 2
|
||||
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}
|
||||
sleep 2
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/i
|
||||
sleep 2
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 2
|
||||
|
||||
Assertion
|
||||
[Arguments] ${assertxpath} ${asserttext}
|
||||
${text} Get text xpath=${assertxpath}
|
||||
Should Be Equal As Strings ${text} ${asserttext}
|
||||
|
||||
RoleSearch
|
||||
[Arguments] ${name}
|
||||
[Documentation] Roles页面搜索功能
|
||||
... ${name}:搜索条件name
|
||||
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
|
||||
sleep 1
|
||||
Click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||||
sleep 1
|
||||
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}
|
||||
sleep 1
|
||||
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[1]/span/div/i
|
||||
sleep 2
|
||||
|
||||
RolesDelete
|
||||
Click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 1
|
||||
Click element id=appDel
|
||||
sleep 1
|
||||
Click element xpath=/html/body/div/div/div[3]/button[2]
|
||||
sleep 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user