1.新增HSM测试用例及相关关键字

This commit is contained in:
byb11
2021-02-05 16:18:43 +08:00
parent 44b8cd8741
commit 18b87767c0
9 changed files with 205 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
*** Settings ***
Force Tags tsg-ui Devices HSM
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/tsg_ui/devices/Devices.robot
Library OperatingSystem
*** Test Cases ***
CreateHSM
[Tags] Positive UI Devices HSM
CreateHSM ${TEST NAME} ${testClentIP} ${password} Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${TEST NAME}
DdeleteHSM
EditteHSM
[Tags] Positive UI Devices HSM
CreateHSM CreateHSM ${testClentIP} ${password} Almaty
Wait Until Element Is Enabled id=insertAdd
EditHSM ${TEST NAME} 192.168.52.11 123456 Nur-sultan
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${TEST NAME}
DdeleteHSM
HSMPagingDisplay
[Tags] Positive UI Devices HSM
Devices_OpenPage sidebarDevice_hsm
PagingDisplay 50
CreateHSMNameMinSize
[Tags] Boundary UI Devices HSM
CreateHSM 1 ${testClentIP} ${password} Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span 1
DdeleteHSM
CreateHSMNameMaxSize
[Tags] Boundary UI Devices HSM
${name} Set Variable CreateHSMNameMaxSizeCreateHSMNameMaxSizeCreateHSMNameMaxSizeCreateHSMNameMaxSizeCreateHSMNameMaxSizeCreateHSMNameMaxSizeCreateHS
CreateHSM ${name} ${testClentIP} ${password} Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${name}
DdeleteHSM
CreateHSMNameSpecialChar
[Tags] Boundary UI Devices HSM
${name} Set Variable 中文+absc+моряков+@#¥%……&*
CreateHSM ${name} ${testClentIP} ${password} Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${name}
DdeleteHSM
CreateHSMPasswordMaxSize
[Tags] Boundary UI Devices HSM
CreateHSM ${TEST NAME} ${testClentIP} 1111111111111111 Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${TEST NAME}
DdeleteHSM
CreateHSMPasswordMinSize
[Tags] Boundary UI Devices HSM
CreateHSM ${TEST NAME} ${testClentIP} 111111 Almaty
Wait Until Element Is Enabled id=insertAdd
Assertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span/span ${TEST NAME}
DdeleteHSM
CreateHSMIPFormatError
[Tags] Negtive UI Devices HSM
Devices_OpenPage sidebarDevice_hsm
click element id=insertAdd
sleep 2
click element id=insertAddOk1
sleep 2
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[1]/div/div[3] Please enter the content
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div/div[2] Cannot be empty
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[4]/div/div[2] Cannot be empty
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div/div[2] Cannot be empty
CreateHSMIPFormatError
[Tags] Negtive UI Devices HSM
CreateHSM ${TEST NAME} 192.168.50.256 ${password} Almaty
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div/div[2] IP can only be IPv4 or IPv6
CreateHSMPasswordFive
[Tags] Negtive UI Devices HSM
CreateHSM ${TEST NAME} ${testClentIP} 11111 Almaty
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[4]/div/div[2] IP can only be IPv4 or IPv6
CreateHSMPasswordFormatError
[Tags] Negtive UI Devices HSM
CreateHSM ${TEST NAME} ${testClentIP} !@#$%^&*()_+/*-+ Almaty
Assertion //*[@id="policy_Manipulation_create8"]/div[2]/form/div[4]/div/div[2] Only English letters, numbers, underscore _, minus sign -, English dot (.) and its minimum 6 bits, maximum 16 bits.

View File

@@ -0,0 +1,111 @@
*** Settings ***
Library Selenium2Library
Library ../../../04-CustomLibrary/Custometest/StringManipulation.py
*** Keywords ***
Devices_OpenPage
[Arguments] ${Three-levelMenu}
[Documentation]
... ${Three-levelMenu}:三级菜单
sleep 1
click element id=children5
sleep 2
click element id=${Three-levelMenu}
sleep 2
CreateHSM
[Arguments] ${name} ${ServerIP} ${password} ${DataCenter}
[Documentation]
Devices_OpenPage sidebarDevice_hsm
click element id=insertAdd
sleep 2
input text id=insert_profileName ${name}
sleep 1
input text xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div/div/input ${ServerIP}
sleep 1
input text xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[4]/div/div/input ${password}
# sleep 1
# click element xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[5]/div/div/button
sleep 2
click element xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div/div/i
sleep 1
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[2]/div/div[2]/ul/li[contains(text(), "${DataCenter}")]
sleep 1
click element id=fqdn_allcancelobject5
sleep 1
click element id=insertAddOk1
sleep 2
EditHSM
[Arguments] ${name} ${ServerIP} ${password} ${DataCenter}
[Documentation]
sleep 2
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
sleep 1
click element id=insertEdit
sleep 2
input text id=insert_profileName ${name}
sleep 1
input text xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div/div/input ${ServerIP}
sleep 1
input text xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[4]/div/div/input ${password}
# sleep 1
# click element xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[5]/div/div/button
sleep 2
click element xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div/div/i
sleep 1
click element xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div/div/i
sleep 1
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[2]/div/div[2]/ul/li[contains(text(), "${DataCenter}")]
sleep 1
click element id=fqdn_allcancelobject5
sleep 1
click element id=insertAddOk1
Wait Until Element Is Enabled id=insertAdd
DdeleteHSM
sleep 2
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
sleep 1
click element id=insertDel
sleep 1
click element xpath=/html/body/div[2]/div/div/button[2]
Wait Until Element Is Enabled xpath=/html/body/div[last()]/p
Assertion
[Arguments] ${assertxpath} ${asserttext}
sleep 1
${text} Get text xpath=${assertxpath}
Should Be Equal As Strings ${text} ${asserttext}
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
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[last()]
Should Be Equal As Strings ${text} ${Page}