mirror of
https://github.com/goharbor/harbor
synced 2025-04-21 01:18:02 +00:00
Add GUI test script for new feature of master-role, without adding a new case for master-role, I add new test steps in old test case named Manage-Project-Members, because master-role is a sub function in project members. (#6945)
In this PR, I also modify a public action keyword to make it suitble for indefinite numbers of parameters. Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
f19ad5c522
commit
a1063edae6
|
@ -47,4 +47,4 @@ Go Back To Versions And Delete
|
||||||
Retry Element Click xpath=${version_checkbox}
|
Retry Element Click xpath=${version_checkbox}
|
||||||
Retry Element Click xpath=${version_delete}
|
Retry Element Click xpath=${version_delete}
|
||||||
Retry Element Click xpath=${version_confirm_delete}
|
Retry Element Click xpath=${version_confirm_delete}
|
||||||
Retry Keyword When Error Wait Until Page Contains Element element=xpath=${helmchart_content}
|
Retry Wait Until Page Contains Element xpath=${helmchart_content}
|
|
@ -22,11 +22,10 @@ ${HARBOR_VERSION} v1.1.1
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
Go Into Project
|
Go Into Project
|
||||||
[Arguments] ${project} ${has_image}=${true}
|
[Arguments] ${project} ${has_image}=${true}
|
||||||
Wait Until Element Is Visible And Enabled ${search_input}
|
Retry Wait Element ${search_input}
|
||||||
Input Text ${search_input} ${project}
|
Input Text ${search_input} ${project}
|
||||||
Wait Until Page Contains ${project}
|
Retry Wait Until Page Contains ${project}
|
||||||
Wait Until Element Is Visible And Enabled xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
Retry Element Click xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
||||||
Click Element xpath=//*[@id='project-results']//clr-dg-cell[contains(.,'${project}')]/a
|
|
||||||
#To prevent waiting for a fixed-period of time for page loading and failure caused by exception, we add loop to re-run <Wait Until Element Is Visible And Enabled> when
|
#To prevent waiting for a fixed-period of time for page loading and failure caused by exception, we add loop to re-run <Wait Until Element Is Visible And Enabled> when
|
||||||
# exception was caught.
|
# exception was caught.
|
||||||
:For ${n} IN RANGE 1 5
|
:For ${n} IN RANGE 1 5
|
||||||
|
@ -100,13 +99,12 @@ User Can Not Add Member
|
||||||
|
|
||||||
Add Guest Member To Project
|
Add Guest Member To Project
|
||||||
[arguments] ${member}
|
[arguments] ${member}
|
||||||
Click Element xpath=${project_member_add_button_xpath}
|
Retry Element Click xpath=${project_member_add_button_xpath}
|
||||||
Sleep 1
|
Retry Text Input xpath=${project_member_add_username_xpath} ${member}
|
||||||
Input Text xpath=${project_member_add_username_xpath} ${member}
|
|
||||||
#select guest
|
#select guest
|
||||||
Mouse Down xpath=${project_member_guest_radio_checkbox}
|
Mouse Down xpath=${project_member_guest_radio_checkbox}
|
||||||
Mouse Up xpath=${project_member_guest_radio_checkbox}
|
Mouse Up xpath=${project_member_guest_radio_checkbox}
|
||||||
Click Button xpath=${project_member_add_confirmation_ok_xpath}
|
Retry Button Click xpath=${project_member_add_confirmation_ok_xpath}
|
||||||
Sleep 1
|
Sleep 1
|
||||||
|
|
||||||
Delete Project Member
|
Delete Project Member
|
||||||
|
@ -188,6 +186,17 @@ User Should Be Admin
|
||||||
Logout Harbor
|
Logout Harbor
|
||||||
Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world v2
|
Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world v2
|
||||||
|
|
||||||
|
User Should Be Master
|
||||||
|
[Arguments] ${user} ${pwd} ${project}
|
||||||
|
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
|
||||||
|
Project Should Display ${project}
|
||||||
|
Go Into Project ${project}
|
||||||
|
Delete Repo ${project}
|
||||||
|
Switch To Member
|
||||||
|
Page Should Contain Element xpath=//clr-dg-row[contains(.,'${user}')]//clr-dg-cell[contains(.,'Master')]
|
||||||
|
Logout Harbor
|
||||||
|
Push Image With Tag ${ip} ${user} ${pwd} ${project} hello-world v3
|
||||||
|
|
||||||
Project Should Have Member
|
Project Should Have Member
|
||||||
[Arguments] ${project} ${user}
|
[Arguments] ${project} ${user}
|
||||||
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
Sign In Harbor ${HARBOR_URL} %{HARBOR_ADMIN} %{HARBOR_PASSWORD}
|
||||||
|
|
|
@ -102,12 +102,10 @@ Make Project Private
|
||||||
Make Project Public
|
Make Project Public
|
||||||
[Arguments] ${projectname}
|
[Arguments] ${projectname}
|
||||||
Go Into Project ${project name}
|
Go Into Project ${project name}
|
||||||
Sleep 2
|
Retry Element Click xpath=//project-detail//a[contains(.,'Configuration')]
|
||||||
Click Element xpath=//project-detail//a[contains(.,'Configuration')]
|
|
||||||
Checkbox Should Not Be Selected xpath=//input[@name='public']
|
Checkbox Should Not Be Selected xpath=//input[@name='public']
|
||||||
Click Element //div[@id="clr-wrapper-public"]//label[1]
|
Retry Element Click //div[@id="clr-wrapper-public"]//label[1]
|
||||||
Wait Until Element Is Enabled //button[contains(.,'SAVE')]
|
Retry Element Click //button[contains(.,'SAVE')]
|
||||||
Click Element //button[contains(.,'SAVE')]
|
|
||||||
Wait Until Page Contains Configuration has been successfully saved
|
Wait Until Page Contains Configuration has been successfully saved
|
||||||
|
|
||||||
Delete Repo
|
Delete Repo
|
||||||
|
|
|
@ -68,24 +68,43 @@ Wait Until Element Is Visible And Enabled
|
||||||
Wait Until Element Is Enabled ${element}
|
Wait Until Element Is Enabled ${element}
|
||||||
|
|
||||||
Retry Action Keyword
|
Retry Action Keyword
|
||||||
[Arguments] ${keyword} ${element_xpath}
|
[Arguments] ${keyword} @{param}
|
||||||
Retry Keyword When Error ${keyword} element=${element_xpath}
|
Retry Keyword When Error ${keyword} @{param}
|
||||||
|
|
||||||
Retry Element Click
|
|
||||||
[Arguments] ${element_xpath}
|
|
||||||
Retry Action Keyword Element Click ${element_xpath}
|
|
||||||
|
|
||||||
Retry Wait Element
|
Retry Wait Element
|
||||||
[Arguments] ${element_xpath}
|
[Arguments] ${element_xpath}
|
||||||
Retry Action Keyword Wait Until Element Is Visible And Enabled ${element_xpath}
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Wait Until Element Is Visible And Enabled @{param}
|
||||||
|
|
||||||
Retry Wait Element Not Visible
|
Retry Wait Element Not Visible
|
||||||
[Arguments] ${element_xpath}
|
[Arguments] ${element_xpath}
|
||||||
Retry Action Keyword Wait Until Element Is Not Visible ${element_xpath}
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Wait Until Element Is Not Visible @{param}
|
||||||
|
|
||||||
|
Retry Element Click
|
||||||
|
[Arguments] ${element_xpath}
|
||||||
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Element Click @{param}
|
||||||
|
|
||||||
Retry Button Click
|
Retry Button Click
|
||||||
[Arguments] ${element_xpath}
|
[Arguments] ${element_xpath}
|
||||||
Retry Action Keyword Button Click ${element_xpath}
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Button Click @{param}
|
||||||
|
|
||||||
|
Retry Text Input
|
||||||
|
[Arguments] ${element_xpath} ${text}
|
||||||
|
@{param} Create List ${element_xpath} ${text}
|
||||||
|
Retry Action Keyword Text Input @{param}
|
||||||
|
|
||||||
|
Retry Wait Until Page Contains
|
||||||
|
[Arguments] ${element_xpath}
|
||||||
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Wait Until Page Contains @{param}
|
||||||
|
|
||||||
|
Retry Wait Until Page Contains Element
|
||||||
|
[Arguments] ${element_xpath}
|
||||||
|
@{param} Create List ${element_xpath}
|
||||||
|
Retry Action Keyword Wait Until Page Contains Element @{param}
|
||||||
|
|
||||||
Element Click
|
Element Click
|
||||||
[Arguments] ${element_xpath}
|
[Arguments] ${element_xpath}
|
||||||
|
@ -97,6 +116,11 @@ Button Click
|
||||||
Wait Until Element Is Visible And Enabled ${element_xpath}
|
Wait Until Element Is Visible And Enabled ${element_xpath}
|
||||||
Click button ${element_xpath}
|
Click button ${element_xpath}
|
||||||
|
|
||||||
|
Text Input
|
||||||
|
[Arguments] ${element_xpath} ${text}
|
||||||
|
Wait Until Element Is Visible And Enabled ${element_xpath}
|
||||||
|
Input Text ${element_xpath} ${text}
|
||||||
|
|
||||||
Wait Unitl Vul Data Ready
|
Wait Unitl Vul Data Ready
|
||||||
[Arguments] ${url} ${timeout} ${interval}
|
[Arguments] ${url} ${timeout} ${interval}
|
||||||
${n}= Evaluate ${timeout}/${interval}
|
${n}= Evaluate ${timeout}/${interval}
|
||||||
|
@ -123,11 +147,10 @@ Wait Unitl Command Success
|
||||||
[Return] ${output}
|
[Return] ${output}
|
||||||
|
|
||||||
Retry Keyword When Error
|
Retry Keyword When Error
|
||||||
[Arguments] ${keyword} ${element}=${None} ${times}=6
|
[Arguments] ${keyword} @{elements}
|
||||||
:For ${n} IN RANGE 1 ${times}
|
:For ${n} IN RANGE 1 6
|
||||||
\ Log To Console Trying ${keyword} ${n} times ...
|
\ Log To Console Trying ${keyword} ${n} times ...
|
||||||
\ ${out} Run Keyword If "${element}"=="${None}" Run Keyword And Ignore Error ${keyword}
|
\ ${out} Run Keyword And Ignore Error ${keyword} @{elements}
|
||||||
\ ... ELSE Run Keyword And Ignore Error ${keyword} ${element}
|
|
||||||
\ Log To Console Return value is ${out[0]}
|
\ Log To Console Return value is ${out[0]}
|
||||||
\ Exit For Loop If '${out[0]}'=='PASS'
|
\ Exit For Loop If '${out[0]}'=='PASS'
|
||||||
\ Sleep 2
|
\ Sleep 2
|
||||||
|
|
|
@ -326,8 +326,11 @@ Test Case - Manage Project Member
|
||||||
User Should Be Developer user005 Test1@34 project${d}
|
User Should Be Developer user005 Test1@34 project${d}
|
||||||
Change User Role In Project user004 Test1@34 project${d} user005 Admin
|
Change User Role In Project user004 Test1@34 project${d} user005 Admin
|
||||||
User Should Be Admin user005 Test1@34 project${d} user006
|
User Should Be Admin user005 Test1@34 project${d} user006
|
||||||
|
Change User Role In Project user004 Test1@34 project${d} user005 Master
|
||||||
|
User Should Be Master user005 Test1@34 project${d}
|
||||||
Manage Project Member user004 Test1@34 project${d} user005 Remove
|
Manage Project Member user004 Test1@34 project${d} user005 Remove
|
||||||
User Should Not Be A Member Of Project user005 Test1@34 project${d}
|
User Should Not Be A Member Of Project user005 Test1@34 project${d}
|
||||||
|
Push image ip=${ip} user=user004 pwd=Test1@34 project=project${d} image=hello-world
|
||||||
User Should Be Guest user006 Test1@34 project${d}
|
User Should Be Guest user006 Test1@34 project${d}
|
||||||
|
|
||||||
Close Browser
|
Close Browser
|
||||||
|
|
Loading…
Reference in New Issue
Block a user