Add autotest case (#4603)

Add test case large image replicate
Add test case Download CA
Add test case repo description
Add test case project level replication
Add test case repo size
Add test case statistics info
This commit is contained in:
sigsbee 2018-04-25 16:24:11 +08:00 committed by GitHub
parent ac8e5d6e25
commit 9bf38c2486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 166 additions and 12 deletions

View File

@ -33,3 +33,5 @@ View Scan Error Log
Capture Page Screenshot viewlog.png
Wait Until Page Contains View Scanning Job Log
Wait Until Page Contains ERROR

View File

@ -212,7 +212,7 @@ Expand Repo
Edit Repo Info
Click Element //*[@id="repo-info"]
Sleep 1
Page Should Contain Element //*[@id="info"]/form/div[2]/h3
Page Should Contain Element //*[@id="info"]/form/div[2]
# Cancel input
Click Element xpath=//*[@id="info-edit-button"]/button
Input Text xpath=//*[@id="info"]/form/div[2]/textarea test_description_info
@ -220,7 +220,7 @@ Edit Repo Info
Sleep 1
Click Element xpath=//*[@id="info"]/form/confirmation-dialog/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
Sleep 1
Page Should Contain Element //*[@id="info"]/form/div[2]/h3
Page Should Contain Element //*[@id="info"]/form/div[2]
# Confirm input
Click Element xpath=//*[@id="info-edit-button"]/button
Input Text xpath=//*[@id="info"]/form/div[2]/textarea test_description_info
@ -268,3 +268,34 @@ Filter Labels In Tags
Capture Page Screenshot filter_${labelName2}.png
Page Should Contain Element xpath=//clr-dg-row[contains(.,"${labelName2}")]
Page Should Not Contain Element xpath=//clr-dg-row[contains(.,"${labelName1}")]
Get Statics Private Repo
${privaterepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[2]/statistics/div/span[1]
Convert To Integer ${privaterepo}
[Return] ${privaterepo}
Get Statics Private Project
${privateproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[2]/div[1]/statistics/div/span[1]
Convert To Integer ${privateproj}
[Return] ${privateproj}
Get Statics Public Repo
${publicrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[2]/statistics/div/span[1]
Convert To Integer ${publicrepo}
[Return] ${publicrepo}
Get Statics Public Project
${publicproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[3]/div[1]/statistics/div/span[1]
Convert To Integer ${publicproj}
[Return] ${publicproj}
Get Statics Total Repo
${totalrepo}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[2]/statistics/div/span[1]
Convert To Integer ${totalrepo}
[Return] ${totalrepo}
Get Statics Total Project
${totalproj}= Get Text //project/div/div/div[1]/div/statistics-panel/div/div[2]/div[1]/div[4]/div[1]/statistics/div/span[1]
Convert To Integer ${totalproj}
[Return] ${totalproj}

View File

@ -67,6 +67,32 @@ Create A Rule With Existing Endpoint
#click save
Click Element ${rule_save_button}
Project Create A Rule With Existing Endpoint
# day 1=Monday..7=Sunday timeformat 12hour+am/pm
[Arguments] ${name} ${project_name} ${endpoint} ${mode} ${plan}=Daily ${weekday}=1 ${time}=0800a
#click new
Click Element ${new_name_xpath}
#input name
Input Text ${rule_name} ${name}
#input descripiton,here skip, leave it blank
#in this keyword, source project is not need to input
#set filter
Click Element ${source_image_filter_add}
Input Text ${source_iamge_repo_filter} *
Click Element ${source_image_filter_add}
Input Text ${source_image_tag_filter} *
#select endpoint
Click Element ${rule_target_select}
Wait Until Element Is Visible //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
Click Element //select[@id='ruleTarget']//option[contains(.,'${endpoint}')]
#set trigger
Click Element ${rule_trigger_select}
Wait Until Element Is Visible //select[@id="ruleTrigger"]//option[contains(.,'${mode}')]
Click Element //select[@id="ruleTrigger"]//option[contains(.,'${mode}')]
Run Keyword If '${mode}' == 'Scheduled' Setting Replicaiton Schedule ${plan} ${weekday} ${time}
#click save
Click Element ${rule_save_button}
Setting Replication Schedule
[Arguments] ${plan} ${weekday}=1 ${time}=0800a
Click Element ${schedule_type_select}

View File

@ -47,6 +47,50 @@ Test Case - Read Only Mode
Push image ${ip} tester${d} Test1@34 project${d} busybox:latest
Close Browser
Test Case - Repo Size
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} library alpine 2.6 2.6
Go Into Project library
Go Into Repo alpine
Page Should Contain 1.92MB
Close Browser
Test Case - Staticsinfo
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
${privaterepocount1}= Get Statics Private Repo
${privateprojcount1}= Get Statics Private Project
${publicrepocount1}= Get Statics Public Repo
${publicprojcount1}= Get Statics Public Project
${totalrepocount1}= Get Statics Total Repo
${totalprojcount1}= Get Statics Total Project
Create An New Project private${d}
Create An New Project public${d} true
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} private${d} hello-world
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} public${d} hello-world
Reload Page
${privaterepocount2}= Get Statics Private Repo
${privateprojcount2}= get statics private project
${publicrepocount2}= get statics public repo
${publicprojcount2}= get statics public project
${totalrepocount2}= get statics total repo
${totalprojcount2}= get statics total project
${privateprojcount}= evaluate ${privateprojcount1}+1
${privaterepocount}= evaluate ${privaterepocount1}+1
${publicprojcount}= evaluate ${publicprojcount1}+1
${publicrepocount}= evaluate ${publicrepocount1}+1
${totalrepocount}= evaluate ${totalrepocount1}+2
${totalprojcount}= evaluate ${totalprojcount1}+2
Should Be Equal As Integers ${privateprojcount2} ${privateprojcount}
Should be equal as integers ${privaterepocount2} ${privaterepocount}
Should be equal as integers ${publicprojcount2} ${publicprojcount}
Should be equal as integers ${publicrepocount2} ${publicrepocount}
Should be equal as integers ${totalprojcount2} ${totalprojcount}
Should be equal as integers ${totalrepocount2} ${totalrepocount}
Test Case - Create An New User
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
@ -440,6 +484,23 @@ Test Case - Scan Image On Push
Summary Chart Should Display latest
Close Browser
Test Case - Verify Download Ca Link
Init Chrome Driver
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To System Settings
Page Should Contain Registry Root Certificate
Close Browser
Test Case - Edit Repo Info
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Create An New Project With New User url=${HARBOR_URL} username=tester${d} email=tester${d}@vmware.com realname=tester${d} newPassword=Test1@34 comment=harbor projectname=project${d} public=false
Push Image ${ip} tester${d} Test1@34 project${d} hello-world
Go Into Project project${d}
Go Into Repo project${d}/hello-world
Edit Repo Info
Close Browser
Test Case - Manage Project Member
Init Chrome Driver
${d}= Get current Date result_format=%m%s

View File

@ -62,14 +62,14 @@ Test Case - Endpoint Edit
Wait Until Page Contains deletea
Close Browser
#Test Case - Endpoint Delete #Temp disable for ui is unstable
# Init Chrome Driver
# ${d}= Get Current Date result_format=%m%s
# Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
# Switch To Registries
# Delete Endpoint deletea
# Wait Until Page Does Not Contain deletea
# Close Browser
Test Case - Endpoint Delete
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Switch To Registries
Delete Endpoint deletea
Wait Until Page Does Not Contain deletea
Close Browser
Test Case - Rule Edit
Init Chrome Driver
@ -111,7 +111,7 @@ Test Case - Trigger Immediate
Page Should Contain hello-world
Go Into Repo hello-world
Page Should Contain latest
Close browser
Close Browser
Test Case - Trigger Manual
Init Chrome Driver
@ -130,8 +130,24 @@ Test Case - Trigger Manual
Page Should Contain hello-world
Go Into Repo hello-world
Page Should Contain latest
Close browser
Close Browser
Test Case - Large Image Replicate
Init Chrome Driver
${d}= Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project project${d}
Push Image with tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ubuntu 16.04 16.04
Switch To Replication Manage
Create A Rule With Existing Endpoint rule${d} project${d} edp Immediate
Logout Harbor
#logout and login target
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Go Into Project project${d}
Page Should Contain ubuntu
Go Into Repo ubuntu
Page Should Contain 16.04
Close Browser
Test Case - Proj Replication Jobs Log View
Init Chrome Driver
@ -150,3 +166,21 @@ Test Case - Proj Replication Jobs Log View
Wait Until Page Contains error
View Job Log busybox
Close Browser
Test Case - Project LeveL Replication Operation
Init Chrome Driver
${d} = Get Current Date result_format=%m%s
Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Create An New Project proj${d}
Go Into Project proj${d}
Switch To Replication
Project Create A Rule With Existing Endpoint rule${d} proj${d} edp Manual
Push Image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} proj${d} hello-world
Trigger Replication Manual rule${d}
Logout Harbor
Sign In Harbor https://${ip1} ${HARBOR_ADMIN} ${HARBOR_PASSWORD}
Go Into Project proj${d}
Page Should Contain hello-world
Go Into Repo hello-world
Page Should Contain latest
Close Browser