1、提交登录限制关键字和用例,2、修改其他公共关键字
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui accounts
|
||||
Resource ../../../02-Keyword/tsg_ui/LoginRestrictions/LoginRestrictions.robot
|
||||
Library OperatingSystem
|
||||
|
||||
*** Test Cases ***
|
||||
User-Edit-001
|
||||
#用户修改Login Restrictions 不动原本内容
|
||||
Login_Restrictions
|
||||
User-Edit-002
|
||||
#用户修改Login Restrictions Login Restrictions开启
|
||||
Login_Restrictions Login-Restrictions=open
|
||||
User-Edit-003
|
||||
#用户修改Login Restrictions Login Restrictions关闭
|
||||
Login_Restrictions Login-Restrictions=close
|
||||
|
||||
User-Edit-004
|
||||
#用户修改Login Restrictions 其他保持不动,新建ip白名单 ipv4最小值和Cidr最小值,ipv4最大值和Cidr最大值,中间值
|
||||
${list-ip} Create list 0.0.0.0/0 255.255.255.255/32 199.199.199.199/22
|
||||
Login_Restrictions Login-Restrictions=open ip-type=create ip-value=${list-ip}
|
||||
|
||||
User-Edit-005
|
||||
#用户修改Login Restrictions 其他保持不动,修改ip白名单 ipv4最小值和Cidr最小值,ipv4最大值和Cidr最大值,中间值
|
||||
${list-ip} Create list 192.168.99.1/24
|
||||
${list-ip1} Create list 0.0.0.0/15
|
||||
Login_Restrictions ip-type=edit ip-value=${list-ip} ip-value1=${list-ip1}
|
||||
83
02-Keyword/tsg_ui/LoginRestrictions/LoginRestrictions.robot
Normal file
83
02-Keyword/tsg_ui/LoginRestrictions/LoginRestrictions.robot
Normal file
@@ -0,0 +1,83 @@
|
||||
*** Settings ***
|
||||
Library Selenium2Library
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library Selenium2Library
|
||||
Resource ../objects/Objects.robot
|
||||
Resource ../objects/ObjectPages.robot
|
||||
|
||||
*** Keywords ***
|
||||
Login_Restrictions
|
||||
[Arguments] ${Login-Restrictions}=1 ${ip-type}=1 ${ip-value}=[192.2.2.2/24] ${ip-value1}=[192.2.2.2/24] ${Maximum-Login-Attemepts}=1 ${Maximum-Login-Attemepts-valuie}=5 ${Lock-Time}=1 ${Lock-Time-valuie}=60
|
||||
sleep 1
|
||||
Menu administration Login Restrictions #点击菜单Login Restrictions
|
||||
sleep 1
|
||||
${class}= Get Element Attribute xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div class #获取Login-Restrictions按钮的class元素的值
|
||||
#通过元素的值判断按钮是开启状态还是关闭状态
|
||||
run keyword if "${Login-Restrictions}"=="open" and "${class}"=="el-switch is-checked" log 按钮为开启状态,不进行操作
|
||||
run keyword if "${Login-Restrictions}"=="open" and "${class}"=="el-switch" Run Keywords log 按钮为关闭状态,需要点击开启
|
||||
... AND sleep 1
|
||||
... AND click element link=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
run keyword if "${Login-Restrictions}"=="close" and "${class}"=="el-switch is-checked" Run Keywords log 按钮为开启状态,需要点击关闭
|
||||
... AND sleep 1
|
||||
... AND click element xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[1]/div/div
|
||||
run keyword if "${Login-Restrictions}"=="close" and "${class}"=="el-switch" log 按钮为关闭状态,不进行操作
|
||||
sleep 1
|
||||
#判断操作类型
|
||||
run keyword if "${ip-type}"=="create" Ip-Create ${ip-value}
|
||||
run keyword if "${ip-type}"=="edit" IP-Edit ${ip-value} ${ip-value1}
|
||||
run keyword if "${ip-type}"=="delete" IP-Delete ${ip-value}
|
||||
run keyword if "${Maximum-Login-Attemepts}"=="input" input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[3]/div/div/input ${Maximum-Login-Attemepts-valuie}
|
||||
run keyword if "${Lock-Time}"=="input" input text xpath=//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[3]/div/div/input ${Lock-Time-valuie}
|
||||
sleep 1
|
||||
click element id=wanAdd_ok
|
||||
sleep 1
|
||||
${Text} get text xpath=/div/p
|
||||
sleep 2
|
||||
Should Be Equal As Strings ${Text} Success #断言
|
||||
|
||||
Ip-Create
|
||||
[Arguments] ${ip}
|
||||
${j} get length ${ip}
|
||||
sleep 1
|
||||
: FOR ${i} IN RANGE ${j}
|
||||
\ sleep 1
|
||||
\ click element id=temporary_form
|
||||
\ sleep 1
|
||||
\ input text id=statusInputedit ${ip}[${i}]
|
||||
\ sleep 1
|
||||
sleep 1
|
||||
|
||||
IP-search
|
||||
[Arguments] ${ip}
|
||||
sleep 1
|
||||
input text id=object_ip_search ${ip}
|
||||
sleep 1
|
||||
press keys id=object_ip_search ENTER
|
||||
|
||||
IP-Edit
|
||||
[Arguments] ${ip} ${new_ip}
|
||||
${j} get length ${ip}
|
||||
sleep 1
|
||||
: FOR ${i} IN RANGE ${j}
|
||||
\ sleep 1
|
||||
\ IP-search ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ Double Click Element xpath =//*[@id="policy_Manipulation2"]/div/div[2]/div/div/form/div[2]/div/div[1]/div[2]/div[1][@placeholder='${ip}[${i}]'] #点击修改按钮
|
||||
\ sleep 1
|
||||
\ input text id=statusInputedit ${new_ip} #输入修改后的ip
|
||||
sleep 1
|
||||
|
||||
|
||||
IP-Delete
|
||||
[Arguments] ${ip}
|
||||
${j} get length ${ip}
|
||||
sleep 1
|
||||
: FOR ${i} IN RANGE ${j}
|
||||
\ sleep 1
|
||||
\ IP-search ${ip}[${i}]
|
||||
\ sleep 1
|
||||
\ click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/div/div[2]/div/div/form/div[2]/div/div[1]/div[2]/div[1]/div/div/div/div/div[2]/i[2] #点击删除按钮
|
||||
\ sleep 1
|
||||
sleep 1
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ Menu
|
||||
[Arguments] ${menuOne} ${menuTwo}
|
||||
Wait Until Element Is Enabled id=children0 10
|
||||
# 一级菜单
|
||||
${dict} create dictionary dashboard=children0 policys=children1 objects=children2 log=children3 report=children4 device=children5 settings=children6 administartion=children7
|
||||
${dict} create dictionary dashboard=children0 policys=children1 objects=children2 log=children3 report=children4 device=children5 settings=children6 administration=children7
|
||||
# 二级菜单
|
||||
${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
|
||||
${log} create dictionary Security Event Logs=sidebarLog_SecurityEventLogs Proxy Event Logs=sidebarLog_ProxyEventLogs Session Records=sidebarLog_SesssionRecords Radius Logs=sidebarLog_RadiusLogs
|
||||
${administartion} create dictionary Accounts=sidebarsystem_UserManagement Audit Log=sidebarsystem_PolicyConfigurationLog Login Log =sidebarsystem_LoginLog Mail Server=sidebarsystem_MailServer LDAP Server=sidebarsystem_LadpServer
|
||||
${administration} create dictionary Accounts=sidebarsystem_UserManagement Audit Log=sidebarsystem_PolicyConfigurationLog Login Log =sidebarsystem_LoginLog Mail Server=sidebarsystem_MailServer LDAP Server=sidebarsystem_LadpServer Login Restrictions=sidebarLogin_Restrictions
|
||||
|
||||
# 遍历一级菜单
|
||||
FOR ${list} ${num} IN ENUMERATE @{dict}
|
||||
|
||||
@@ -42,7 +42,7 @@ Password-prompt-true
|
||||
... AND click element xpath=/html/body/div[2]/div/div[3]/button[1]
|
||||
... AND sleep 1
|
||||
AddLocalIp
|
||||
${obj1} create dictionary type=Ip name=LocahIPName ipads=${ipType} ipclient=masks ipclienttext1=${testClentIP} ipclienttext2=${ipMask}
|
||||
${obj1} create dictionary type=IP name=LocahIPName ipads=${ipType} ipclient=masks ipclienttext1=${testClentIP} ipclienttext2=${ipMask}
|
||||
CreatePage ${obj1}[type] ${obj1}[name] ipads=${obj1}[ipads] ipclient=${obj1}[ipclient] ipclienttext1=${obj1}[ipclienttext1] ipclienttext2=${obj1}[ipclienttext2]
|
||||
set global variable ${LocahIPName} ${obj1}[name]
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Library Collections
|
||||
CreatePage
|
||||
[Arguments] ${objtype} ${name} ${ip_type}=null ${ipads}=null ${ipclient}=null ${ipclienttext1}=null ${ipclienttext2}=null
|
||||
... ${keywordtext}=null ${hex}=close ${reqrestype}=null ${reqresheader}=null ${post}=null ${Country}=null ${City}=null ${group}=null ${object_name}=null
|
||||
Menu policy&objects Objects
|
||||
Menu objects ${objtype}
|
||||
sleep 3
|
||||
Objects.CreateButton ${objtype}
|
||||
Objects.Create-name ${name}
|
||||
|
||||
@@ -231,7 +231,10 @@ VPN-Accounts-Delete
|
||||
sleep 2
|
||||
|
||||
Create-Proxy-TCP-Options
|
||||
[Arguments] ${name} ${passwd} ${search}
|
||||
[Arguments] ${name} ${ip-type} ${ip-value} ${ip-type1} ${ip-value1} ${Client-ttl-value} ${Client-User-Timeout} ${Server-ttl-value} ${Server-User-Timeout} ${search}
|
||||
... ${Filter}=1 ${sni-type}=FQDN ${sni-value}=test-.com ${Enable-TCP-Passthrough}=1 ${Bypass-Duplicated-Packet}=1 ${Client-Override-MSS}=1
|
||||
... ${Client-MSS-value}=1000 ${Client-No-Delay}=1 ${Client-Keepalive}=1 ${Client-Probe-Number}=1 ${Client-Idle-Time}=30 ${Client-Interval}=15
|
||||
... ${Server-Override-MSS}=1 ${Server-MSS-value}=100 ${Server-No-Delay}=1 ${Server-Keepalive}=1 ${Server-Probe-Number}=1 ${Server-Idle-Time}=30 ${Server-Interval}=15
|
||||
Sleep 1
|
||||
click id=children6 #点击一级目录Settings
|
||||
Sleep 1
|
||||
@@ -360,6 +363,8 @@ Create-Proxy-TCP-Options
|
||||
click id=proxyManipulationSuccess #点击OK
|
||||
sleep 1
|
||||
Proxy-TCP-Options-Search ${name} ${search} #搜索刚新建的name
|
||||
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/p #获取点击后页面文本信息
|
||||
Should Be Equal As Strings ${text1} ${name} #断言
|
||||
|
||||
Source-or-Destination-Search
|
||||
[Arguments] ${value}
|
||||
@@ -401,7 +406,8 @@ Proxy-TCP-Options-Search
|
||||
click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/i #点击搜索按钮
|
||||
sleep 1
|
||||
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜索到的列表
|
||||
sleep te-Hijack Files
|
||||
sleep 1
|
||||
Create-Hijack Files
|
||||
[Arguments] ${name} ${file} ${type} ${search} ${shift}=1 ${input1}=1
|
||||
Sleep 1
|
||||
click id=children6 #点击一级目录Settings
|
||||
|
||||
Reference in New Issue
Block a user