提交Responsepages 新的关键字及用例

This commit is contained in:
byb11
2021-03-15 09:26:21 +08:00
parent eeb24c5737
commit 8cfb43efa8
2 changed files with 100 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
*** Settings ***
Library Selenium2Library
Library Collections
Library ../../../04-CustomLibrary/Custometest/Common.py
Library DatabaseLibrary
Library ../../../04-CustomLibrary/Custometest/StringManipulation.py
@@ -2529,7 +2530,7 @@ UploadFilesSize
... AND sleep ${sleep}
... AND click id=authoritiesAdd_sub #点击OK缇交
... AND sleep ${sleep}
${text} get text xpath=/html/body/div/p
${text} get text xpath=/html/body/div[last()]/p
Should Be Equal As Strings ${text} ${Promptinfor}
DownLoadFile
@@ -2627,4 +2628,84 @@ RandomNumber
[RETURN] ${a}
ResponsrPageCreateAndEdit
[Arguments] ${ResponsrPageInfo}
[Documentation] 创建和修改ResponsePage
... ${CreateOrEdit} : 创建 或者修改
... ${Name} :名称
... ${EditName} :修改之后得名称
... ${file} :上传文件得路径
... ${search} : 查询的类型 name或者id
${return} ${CreateOrEdit} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} CreateOrEdit
${return} ${search} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} search
${return} ${Name} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} Name
${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} file
${return} ${EditName} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} EditName
${EditName} Run Keyword If "${return}"=="FAIL" or "${EditName}"=="${EMPTY}" set variable null
... ELSE set variable ${EditName}
${return} ${Delete} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} Delete
${Delete} Run Keyword If "${return}"=="FAIL" or "${Delete}"=="${EMPTY}" set variable No
... ELSE set variable ${Delete}
${return} ${Negtive} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} Negtive
${Negtive} Run Keyword If "${return}"=="FAIL" or "${Negtive}"=="${EMPTY}" set variable No
... ELSE set variable ${Negtive}
${return} ${Assertposition} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} Assertposition
${Assertposition} Run Keyword If "${return}"=="FAIL" or "${Negtive}"=="${EMPTY}" set variable null
... ELSE set variable ${Assertposition}
${return} ${asserttext} Run Keyword And Ignore Error Get From Dictionary ${ResponsrPageInfo} asserttext
${asserttext} Run Keyword If "${return}"=="FAIL" or "${asserttext}"=="${EMPTY}" set variable null
... ELSE set variable ${asserttext}
sleep ${sleep}
OpenPages sidebarProxy_Profiles profilesTabs_Profile_ResponsePages
${id} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span
run keyword if "${CreateOrEdit}" == "Create" run keywords sleep ${sleep_min}
... AND click id=respinseAdd
... AND sleep ${sleep}
... AND input id=responsepages_profileName1 ${Name}
run keyword if "${CreateOrEdit}" == "Edit" run keywords sleep ${sleep_min}
... AND Settings-Search ${Name} name
... AND click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span
... AND sleep ${sleep}
... AND click id=resinseEdit
... AND sleep ${sleep}
... AND input id=responsepages_profileName1 ${EditName}
sleep ${sleep}
${uploadfile}= Set Variable if "${CreateOrEdit}" == "Create" xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input
... xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[5]/div/div/div/input
Choose File ${uploadfile} ${file}
sleep ${sleep}
click id=responseAddOk1 #点击OK缇交
sleep ${sleep}
run keyword if "${Negtive}" == "No" and "${CreateOrEdit}" == "Creaet" ResponsrPageCreateAssert ${search} ${Name} ${id}
... ELSE IF "${Negtive}" == "No" and "${CreateOrEdit}" == "Edit" ResponsrPageCreateAssert ${search} ${EditName} ${id}
... ELSE IF "${Negtive}" != "No" SettingsAssertion ${Assertposition} ${asserttext}
sleep ${sleep}
run keyword if "${Delete}" != "No" DeleteresinseDel1
... ELSE log 不删除数据
ResponsrPageCreateAssert
[Arguments] ${search} ${Name} ${id}
Wait Until Element Is Enabled id=respinseAdd ${sleep_Wait}
run keyword if "${search}"=="id" run keywords sleep ${sleep_min}
... AND Settings-Search ${id} ${search} #搜索框的关键字
... ELSE IF "${search}"=="name" run keywords sleep ${sleep_min}
... AND Settings-Search ${Name} ${search} #搜索框的关键字
sleep ${sleep_min}
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
SettingsAssertion //*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span ${Name}
DeleteresinseDel1
sleep ${sleep}
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span
sleep ${sleep}
click id=resinseDel
sleep ${sleep}
click xpath=/html/body/div/div/div[3]/button[2]
sleep ${sleep}