From ac0d3c991a95e76b5ce111ca2a9bd1e063ccaf67 Mon Sep 17 00:00:00 2001 From: danfengliu Date: Thu, 10 Oct 2019 10:36:19 +0800 Subject: [PATCH] Add nightly test case of 'Retag should be forbidden when system configuration read-only mode was set'. Signed-off-by: danfengliu --- tests/resources/Util.robot | 45 +++++++++++-------- tests/robot-cases/Group1-Nightly/Common.robot | 26 ++++++++++- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index fc127bfa1..aeda8ca11 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -95,6 +95,11 @@ Retry Wait Element Not Visible @{param} Create List ${element_xpath} Retry Action Keyword Wait Until Element Is Not Visible @{param} +Retry Wait Element Should Be Disabled + [Arguments] ${element_xpath} + @{param} Create List ${element_xpath} + Retry Action Keyword Element Should Be Disabled @{param} + Retry Element Click [Arguments] ${element_xpath} @{param} Create List ${element_xpath} @@ -146,31 +151,33 @@ Retry Wait Until Page Not Contains Element Retry Action Keyword Wait Until Page Does Not Contain Element @{param} Retry Select Object - [Arguments] ${obj_name} - @{param} Create List ${obj_name} - Retry Action Keyword Select Object @{param} + [Arguments] ${obj_name} + @{param} Create List ${obj_name} + Retry Action Keyword Select Object @{param} Retry Textfield Value Should Be - [Arguments] ${element} ${text} - @{param} Create List ${element} ${text} - Retry Action Keyword Wait And Textfield Value Should Be @{param} + [Arguments] ${element} ${text} + @{param} Create List ${element} ${text} + Retry Action Keyword Wait And Textfield Value Should Be @{param} Retry List Selection Should Be - [Arguments] ${element} ${text} - @{param} Create List ${element} ${text} - Retry Action Keyword Wait And List Selection Should Be @{param} + [Arguments] ${element} ${text} + @{param} Create List ${element} ${text} + Retry Action Keyword Wait And List Selection Should Be @{param} + Link Click [Arguments] ${element_xpath} Click Link ${element_xpath} + Wait And List Selection Should Be - [Arguments] ${element} ${text} - Wait Until Element Is Visible And Enabled ${element} - List Selection Should Be ${element} ${text} + [Arguments] ${element} ${text} + Wait Until Element Is Visible And Enabled ${element} + List Selection Should Be ${element} ${text} Wait And Textfield Value Should Be - [Arguments] ${element} ${text} - Wait Until Element Is Visible And Enabled ${element} - Textfield Value Should Be ${element} ${text} + [Arguments] ${element} ${text} + Wait Until Element Is Visible And Enabled ${element} + Textfield Value Should Be ${element} ${text} Element Click [Arguments] ${element_xpath} @@ -189,10 +196,10 @@ Text Input Input Text ${element_xpath} ${text} Clear Field Of Characters - [Arguments] ${field} ${character count} - [Documentation] This keyword pushes the delete key (ascii: \8) a specified number of times in a specified field. - : FOR ${index} IN RANGE ${character count} - \ Press Key ${field} \\8 + [Arguments] ${field} ${character count} + [Documentation] This keyword pushes the delete key (ascii: \8) a specified number of times in a specified field. + : FOR ${index} IN RANGE ${character count} + \ Press Key ${field} \\8 Wait Unitl Vul Data Ready [Arguments] ${url} ${timeout} ${interval} diff --git a/tests/robot-cases/Group1-Nightly/Common.robot b/tests/robot-cases/Group1-Nightly/Common.robot index 655728430..47eb850d4 100644 --- a/tests/robot-cases/Group1-Nightly/Common.robot +++ b/tests/robot-cases/Group1-Nightly/Common.robot @@ -560,4 +560,28 @@ Test Case - Project Quotas Control Under GC GC Now ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} @{param} Create List project${d} Retry Keyword When Return Value Mismatch Get Project Storage Quota Text From Project Quotas List 0Byte of ${storage_quota}${storage_quota_unit} 60 @{param} - Close Browser \ No newline at end of file + Close Browser + +Test Case - Can Not Retag Image In ReadOnly Mode + Init Chrome Driver + ${random_num1}= Get Current Date result_format=%m%s + ${random_num2}= Evaluate str(random.randint(1000,9999)) modules=random + + Sign In Harbor ${HARBOR_URL} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} + Create An New Project project${random_num1} + Create An New Project project${random_num2} + + Go Into Project project${random_num1} has_image=${false} + Sleep 1 + Push Image With Tag ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${random_num1} redis ${image_tag} + Sleep 1 + Enable Read Only + Go Into Repo project${random_num1}/redis + Retag Image ${image_tag} project${random_num2} ${target_image_name} ${target_tag_value} + Retry Wait Element Not Visible ${repo_retag_confirm_dlg} + Navigate To Projects + Go Into Project project${random_num2} has_image=${false} + Sleep 10 + Go Into Project project${random_num2} has_image=${false} + Disable Read Only + Close Browser