2020-05-29 17:01:46 +08:00
|
|
|
*** Settings ***
|
|
|
|
|
Library Selenium2Library
|
|
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
Menu
|
2021-01-27 18:44:48 +08:00
|
|
|
[Arguments] ${menuOne} ${menuTwo} ${OkorCancel}=OK
|
2020-07-23 18:55:17 +08:00
|
|
|
Wait Until Element Is Enabled id=children0 10
|
2020-05-29 17:01:46 +08:00
|
|
|
# 一级菜单
|
2020-12-15 18:33:01 +08:00
|
|
|
${dict} create dictionary dashboard=children0 policys=children1 objects=children2 log=children3 report=children4 device=children5 settings=children6 administration=children7
|
2020-05-29 17:01:46 +08:00
|
|
|
# 二级菜单
|
2020-12-11 18:17:15 +08:00
|
|
|
${policys} create dictionary Security Policy=sidebarObjects_ProxyInterception Proxy Policy=sidebarObjects_ProxyManipulation WAN NAT=sidebarWan_nat Schedules=sidebarObjects_Schedule Tags=sidebarObjects_Tags
|
|
|
|
|
${objects} create dictionary IP=sidebarObjects_ip FQDN=sidebarObjects_fqdn SubscriberID=sidebarObjects_subscriberid HTTPSignature=sidebarObjects_http_signature Key=sidebarObjects_keywords URL=sidebarObjects_url Category=sidebarObjects_fqdn_category Account=sidebarObjects_account Applications=sidebarApplication
|
2020-05-29 17:01:46 +08:00
|
|
|
${log} create dictionary Security Event Logs=sidebarLog_SecurityEventLogs Proxy Event Logs=sidebarLog_ProxyEventLogs Session Records=sidebarLog_SesssionRecords Radius Logs=sidebarLog_RadiusLogs
|
2020-12-22 18:34:28 +08:00
|
|
|
${administration} create dictionary Accounts=sidebarsystem_accounts Audit Log=sidebarsystem_PolicyConfigurationLog Login Log =sidebarsystem_LoginLog Mail Server=sidebarsystem_MailServer LDAP Server=sidebarsystem_LadpServer Login Restrictions=sidebarLogin_Restrictions
|
2020-06-02 11:51:59 +08:00
|
|
|
|
2020-05-29 17:01:46 +08:00
|
|
|
# 遍历一级菜单
|
|
|
|
|
FOR ${list} ${num} IN ENUMERATE @{dict}
|
|
|
|
|
run keyword if "${num}"=="${menuOne}" run keywords sleep 5
|
|
|
|
|
... AND click element id=${dict}[${num}]
|
2021-01-27 18:44:48 +08:00
|
|
|
... AND LeavePrompt ${OkorCancel}
|
2020-05-29 17:01:46 +08:00
|
|
|
END
|
|
|
|
|
# 遍历二级菜单
|
|
|
|
|
FOR ${list} ${num} IN ENUMERATE @{${menuOne}}
|
|
|
|
|
run keyword if "${num}"=="dashboard" Exit For Loop
|
|
|
|
|
... ELSE IF "${num}"=="${menuTwo}" run keywords sleep 3
|
|
|
|
|
... AND click element id=${${menuOne}}[${num}]
|
2021-01-27 18:44:48 +08:00
|
|
|
... AND LeavePrompt ${OkorCancel}
|
2020-05-29 17:01:46 +08:00
|
|
|
END
|
2021-01-27 18:44:48 +08:00
|
|
|
|
|
|
|
|
LeavePrompt
|
|
|
|
|
[Arguments] ${OkorCancel}
|
|
|
|
|
[Documentation] 调用次关键字前需要添加必填参数:
|
|
|
|
|
... ${OkorCancel}:填入OK或Cancel
|
|
|
|
|
sleep 1
|
|
|
|
|
${status} Run Keyword And Return Status Page Should Contain Changes you made are not saved. #判断页面是否包含该文本
|
|
|
|
|
sleep 1
|
|
|
|
|
run keyword if "${status}"=="True" Existence ${OkorCancel}
|
|
|
|
|
run keyword if "${status}"=="False" log go on
|
|
|
|
|
Existence
|
|
|
|
|
[Arguments] ${OkorCancel}
|
|
|
|
|
[Documentation] 调用次关键字前需要添加必填参数:
|
|
|
|
|
... ${OkorCancel}:填入OK或Cancel
|
|
|
|
|
${style}= Get Element Attribute xpath=//div[@class="el-message-box__wrapper"] style
|
|
|
|
|
${c} Evaluate "display: none" in """${style}"""
|
|
|
|
|
run keyword if "${c}"=="False" ClickOkorCancel ${OkorCancel}
|
|
|
|
|
run keyword if "${c}"=="True" log go on
|
|
|
|
|
ClickOkorCancel
|
|
|
|
|
[Arguments] ${OkorCancel}
|
|
|
|
|
[Documentation] 调用次关键字前需要添加必填参数:
|
|
|
|
|
... ${OkorCancel}:填入OK或Cancel
|
|
|
|
|
sleep 1
|
|
|
|
|
run keyword if "${OkorCancel}"=="OK" click element xpath=//button[@class='el-button el-button--default el-button--small el-button--primary ']
|
|
|
|
|
run keyword if "${OkorCancel}"=="Cancel" click element xpath=/html/body/div/div/div[3]/button[1]
|