1.新增AuditLogs页面Case 2.新增Audit Logs页面相关关键字 3.将原有 Auditcase及关键字Audit删除
This commit is contained in:
@@ -3,9 +3,10 @@ Library Selenium2Library
|
||||
Resource ../Menu.robot
|
||||
Library Collections
|
||||
Library ../../../04-CustomLibrary/Custometest/StringManipulation.py
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Keywords ***
|
||||
OpenPages
|
||||
AdminOpenPages
|
||||
[Arguments] ${SecondaryMenu} ${Three-levelMenu} ${Targeting}=null ${Amenu}=null
|
||||
[Documentation]
|
||||
... ${SecondaryMenu}:二级菜单
|
||||
@@ -21,7 +22,7 @@ OpenPages
|
||||
... AND click element id=${Three-levelMenu}
|
||||
run keyword if "${Targeting}"=="xpath" run keywords sleep 1
|
||||
... AND click element ${Targeting}=${Three-levelMenu}
|
||||
sleep 2
|
||||
sleep 1
|
||||
|
||||
UserCreatePage
|
||||
[Arguments] ${name} ${username} ${accPasswd} ${Required_Password_Change} ${day} ${accEnable} ${role}
|
||||
@@ -70,6 +71,23 @@ UserEdit
|
||||
click button xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1]
|
||||
sleep 2
|
||||
|
||||
UserSearchName
|
||||
[Arguments] ${name} ${type}
|
||||
sleep 1
|
||||
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]
|
||||
@@ -130,7 +148,85 @@ RolesVerification
|
||||
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}
|
||||
|
||||
|
||||
RoleSearch
|
||||
[Arguments] ${name}
|
||||
[Documentation] Roles页面搜索功能
|
||||
... ${name}:搜索条件name
|
||||
sleep 1
|
||||
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
|
||||
|
||||
AuditLogsSearch
|
||||
[Arguments] ${id} ${TargetType} ${ip}=null
|
||||
[Documentation]
|
||||
... ${id} :操作对象的id
|
||||
... ${TargetType}:类型
|
||||
... ${ip}:ip不输入默认为测试机IP
|
||||
sleep 1
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
|
||||
sleep 2
|
||||
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/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${id}
|
||||
sleep 1
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 1
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||||
sleep 2
|
||||
run keyword if "${ip}" == "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[2]/div[3]/div/input ${testClentIP}
|
||||
... ELSE IF "${ip}" != "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div[2]/div[3]/div/input ${ip}
|
||||
sleep 1
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 1
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||||
sleep 2
|
||||
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li/span[contains(text(), "${TargetType}")]
|
||||
sleep 1
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
|
||||
sleep 2
|
||||
|
||||
AuditLogsSearch-NotID
|
||||
[Arguments] ${TargetType} ${ip}=null
|
||||
[Documentation]
|
||||
... ${TargetType}:类型
|
||||
... ${ip}:ip不输入默认为测试机IP
|
||||
sleep 1
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div/input
|
||||
sleep 2
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
|
||||
sleep 1
|
||||
run keyword if "${ip}" == "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${testClentIP}
|
||||
... ELSE IF "${ip}" != "null" run keywords sleep 1
|
||||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/div/div[2]/div/div/div[3]/div/input ${ip}
|
||||
sleep 1
|
||||
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
|
||||
sleep 1
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
|
||||
sleep 1
|
||||
Execute Javascript window.scrollTo(0, document.body.scrollHeight)
|
||||
click element xpath=/html/body/div/div[1]/div[1]/ul/li/span[contains(text(), "${TargetType}")]
|
||||
sleep 1
|
||||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[1]/span/div/i
|
||||
sleep 2
|
||||
|
||||
Login
|
||||
[Arguments] ${UserName} ${Password}
|
||||
@@ -145,13 +241,15 @@ Login
|
||||
click element xpath=/html/body/div/div/div[2]/div/div[4]/button
|
||||
sleep 2
|
||||
|
||||
TurnPage
|
||||
[Arguments] ${NextPage} ${PreviousPage} ${JumpInput} ${pages} ${AssertXpath}
|
||||
AdminTurnPage
|
||||
[Arguments] ${NextPage} ${PreviousPage} ${JumpInput} ${pages} ${AssertXpath} ${last}=null ${lastxpath}=null
|
||||
[Documentation]
|
||||
... ${NextPage} 下一页按钮定位
|
||||
... ${PreviousPage} 上一页按钮定位
|
||||
... ${JumpInput} 跳转页面输入框
|
||||
... ${pages} 跳转得页码
|
||||
... ${last} 次关键字 当最后一页定位和其他页面不同时,传入非null的值
|
||||
... ${lastxpath} 当最后一页定位和其他页面不同时,传入最后一页的xpath 定位
|
||||
${text1} get text xpath=${AssertXpath}
|
||||
Click element xpath=${NextPage}
|
||||
sleep 2
|
||||
@@ -166,8 +264,10 @@ TurnPage
|
||||
press keys xpath=${JumpInput} ENTER
|
||||
sleep 2
|
||||
${text4} get text xpath=${AssertXpath}
|
||||
Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[last()]/div/ul/li[last()]
|
||||
sleep 2
|
||||
run keyword if "${last}"=="null" run keywords sleep 1
|
||||
... AND Click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[last()]/div/ul/li[last()]
|
||||
... ELSE Click element xpath=${lastxpath}
|
||||
sleep 2
|
||||
${text5} get text xpath=${AssertXpath}
|
||||
Should Not Be Equal ${text1} ${text2}
|
||||
Should Not Be Equal ${text3} ${text2}
|
||||
@@ -178,6 +278,8 @@ PagingDisplay
|
||||
[Arguments] ${Number}
|
||||
[Documentation]
|
||||
... ${Number}: 设置页面显示数据条数 (20、5、30、50、100)
|
||||
... ${last} 次关键字 当最后一页定位和其他页面不同时,传入非null的值
|
||||
... ${lastxpath} 当最后一页定位和其他页面不同时,传入最后一页的xpath 定位
|
||||
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
|
||||
@@ -202,50 +304,46 @@ PagingDisplay
|
||||
${Page1} Evaluate ${quzheng}+${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()]
|
||||
${text} Get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div/div/ul/li[last()]
|
||||
Should Be Equal As Strings ${text} ${Page}
|
||||
|
||||
UserSearchName
|
||||
[Arguments] ${name} ${type}
|
||||
AuditLogs-PagingDisplay
|
||||
[Arguments] ${Number}
|
||||
[Documentation]
|
||||
... ${Number}: 设置页面显示数据条数 (20、5、30、50、100)
|
||||
Mouse Over xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[4]/span/div/i
|
||||
sleep 1
|
||||
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
|
||||
run keyword if "${Number}"=="30" run keywords sleep 1
|
||||
... AND Click element xpath=//*[@id="page-size"]/div/label[2]
|
||||
... ELSE IF "${Number}"=="50" run keywords sleep 1
|
||||
... AND Click element xpath=//*[@id="page-size"]/div/label[3]
|
||||
... ELSE IF "${Number}"=="100" run keywords sleep 1
|
||||
... AND Click element xpath=//*[@id="page-size"]/div/label[4]
|
||||
... ELSE Clear Element Text xpath=/html/body/div[last()]/div[1]/div[2]/input
|
||||
... AND Input Text xpath=/html/body/div[last()]/div[1]/div[2]/input ${Number}
|
||||
sleep 1
|
||||
Click element xpath=/html/body/div[last()]/div[1]/div[2]/button
|
||||
sleep 2
|
||||
${text} Get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[4]/div/span[1]
|
||||
sleep 1
|
||||
${Quantity} StringSegmentation ${text}
|
||||
sleep 1
|
||||
${quyu} Evaluate ${Quantity}%${Number}
|
||||
${qumo} Evaluate ${Quantity}/${Number}
|
||||
${quzheng} Evaluate int(${qumo})
|
||||
${b} Set Variable ${1}
|
||||
${Page1} Evaluate ${quzheng}+${b}
|
||||
${Page} Set Variable if "${qumo}" != "0" ${Page1} ${qumo}
|
||||
sleep 1
|
||||
${text} Get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[4]/div/ul/li[8]
|
||||
Should Be Equal As Strings ${text} ${Page}
|
||||
|
||||
|
||||
|
||||
Assertion
|
||||
[Arguments] ${assertxpath} ${asserttext}
|
||||
${text} Get text xpath=${assertxpath}
|
||||
Should Be Equal As Strings ${text} ${asserttext}
|
||||
|
||||
RoleSearch
|
||||
[Arguments] ${name}
|
||||
[Documentation] Roles页面搜索功能
|
||||
... ${name}:搜索条件name
|
||||
sleep 1
|
||||
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