Skip to content

Commit

Permalink
Make DS Project tests independent (#978)
Browse files Browse the repository at this point in the history
* remove ODS-1812

Signed-off-by: bdattoma <bdattoma@redhat.com>

* stop workbench from starting status

Signed-off-by: bdattoma <bdattoma@redhat.com>

* add kw to delete single project from cli

Signed-off-by: bdattoma <bdattoma@redhat.com>

* first attempt for adding independence

Signed-off-by: bdattoma <bdattoma@redhat.com>

* move tests to Edit suite

Signed-off-by: bdattoma <bdattoma@redhat.com>

* refactor clean project kw and move some tests

Signed-off-by: bdattoma <bdattoma@redhat.com>

* remove common workbench and refactor

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix ODS-1970 and 1971 - mark autobug on 1819

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix misc failures

Signed-off-by: bdattoma <bdattoma@redhat.com>

* more fixes

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix 1813 and add wait for workbench deletion

Signed-off-by: bdattoma <bdattoma@redhat.com>

* add small sleep before checking secret deletion

Signed-off-by: bdattoma <bdattoma@redhat.com>

* add project creation in suite setup for Edit suite

Signed-off-by: bdattoma <bdattoma@redhat.com>

* minor changes suite setup/teardown in DSprojects suite

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix ods-1826

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix setup edit suite

Signed-off-by: bdattoma <bdattoma@redhat.com>

* start test from ds project home page

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix dc edit test + edit dc name

Signed-off-by: bdattoma <bdattoma@redhat.com>

* fix edit workbench kw

Signed-off-by: bdattoma <bdattoma@redhat.com>

* add description to multiprojects test

Signed-off-by: bdattoma <bdattoma@redhat.com>

---------

Signed-off-by: bdattoma <bdattoma@redhat.com>
  • Loading branch information
bdattoma authored Oct 23, 2023
1 parent 671e85c commit 98a4185
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 271 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Create S3 Data Connection

Edit S3 Data Connection
[Documentation] Edits a S3 Data Connection from DS Project details page
[Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access}
[Arguments] ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access} ${new_dc_name}=${dc_name}
... ${aws_s3_endpoint}=${S3.AWS_DEFAULT_ENDPOINT} ${aws_region}=${S3.AWS_DEFAULT_REGION}
... ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} ${aws_bucket_name}=${NONE}
Workbenches.Click Action From Actions Menu item_title=${dc_name} item_type=data connection action=Edit
Fill Data Connection Form ${project_title} ${dc_name} ${aws_access_key} ${aws_secret_access}
Fill Data Connection Form ${project_title} ${new_dc_name} ${aws_access_key} ${aws_secret_access}
... ${S3_DC_EDIT_BTN} aws_s3_endpoint=${aws_s3_endpoint} aws_region=${aws_region}
... connected_workbench=${connected_workbench} press_cancel=${press_cancel}
... aws_bucket_name=${aws_bucket_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Is Data Science Project Details Page Open
[Arguments] ${project_title}
${page_open}= Run Keyword And Return Status
... SeleniumLibrary.Page Should Contain Element xpath=//h1[contains(text(),"${project_title}")]
[Return] ${page_open}
[Return] ${page_open}

Wait Until Project Is Open
[Documentation] Waits until a DS Project Details page is laoded
Expand Down Expand Up @@ -178,6 +178,7 @@ Delete Data Science Project From CLI
END
END


Workbench Status Should Be From Projects Home Page
[Documentation] Checks the workbench status is the expected one, from the DS Project home page
[Arguments] ${workbench_title} ${status} ${project_title}
Expand Down Expand Up @@ -221,7 +222,11 @@ Stop Workbench From Projects Home Page
... Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title}
... status=${WORKBENCH_STATUS_RUNNING}
... project_title=${project_title}
IF ${is_started} == ${TRUE}
${is_starting}= Run Keyword And Return Status
... Workbench Status Should Be From Projects Home Page workbench_title=${workbench_title}
... status=${WORKBENCH_STATUS_STARTING}
... project_title=${project_title}
IF ${is_started} == ${TRUE} or ${is_starting} == ${TRUE}
IF "${workbench_cr_name}" == "${EMPTY}"
IF "${namespace}" == "${EMPTY}"
${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title}
Expand Down Expand Up @@ -395,4 +400,14 @@ Create Data Science Project If Not Exists
Log msg=There is no DS Projects with Diplay Name equal to ${project_title}. Creating it now.
Launch Data Science Project Main Page username=${username}
Create Data Science Project title=${PRJ_TITLE} description=${description}
END
END

Clean Project From Workbench Resources
[Documentation] Deletes resources from a test project to free up
... resources or re-use titles.
... AT THE MOMENT, ONLY WORKBENCH AND PVC DELETION ARE IMPLEMENTED
[Arguments] ${workbench_title} ${project_title}
... ${pvc_title}=${workbench_title}
Delete Workbench From CLI workbench_title=${workbench_title}
... project_title=${project_title}
Delete PVC From CLI pvc_title=${pvc_title} project_title=${project_title}
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ Delete PVC From CLI
${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title}
${_} ${cr_name}= Get Openshift PVC From Storage
... name=${pvc_title} namespace=${ns_name}
Oc Delete kind=PersistentVolumeClaim name=${pvc_title} namespace=${ns_name}
Oc Delete kind=PersistentVolumeClaim name=${cr_name} namespace=${ns_name}
Original file line number Diff line number Diff line change
Expand Up @@ -319,25 +319,30 @@ Open Workbench

Stop Workbench
[Documentation] Stops a workbench from DS Project details page
[Arguments] ${workbench_title} ${press_cancel}=${FALSE}
[Arguments] ${workbench_title} ${press_cancel}=${FALSE} ${from_running}=${TRUE}
${is_started}= Run Keyword And Return Status Workbench Status Should Be
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING}
IF ${is_started} == ${TRUE}
${is_starting}= Run Keyword And Return Status Workbench Status Should Be
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_STARTING}
IF ${is_started} == ${TRUE} or ${is_starting} == ${TRUE}
Click Element ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//span[@class="pf-c-switch__toggle"]
Wait Until Generic Modal Appears
Handle Stop Workbench Confirmation Modal press_cancel=${press_cancel}
... from_running=${from_running}
ELSE
Fail msg=Cannot stop workbench ${workbench_title} because it is not running...
Fail msg=Cannot stop workbench ${workbench_title} because it is not neither running or starting...
END

Handle Stop Workbench Confirmation Modal
[Documentation] Handles modal to stop workbench
[Arguments] ${press_cancel}=${FALSE}
[Arguments] ${press_cancel}=${FALSE} ${from_running}=${TRUE}
Run Keyword And Continue On Failure Page Should Contain Stop workbench?
Run Keyword And Continue On Failure
... Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased.
Run Keyword And Continue On Failure Page Should Contain To save changes, access your
Run Keyword And Continue On Failure Page Should Contain Element xpath=//a[.="workbench"]
IF ${from_running} == ${TRUE}
Run Keyword And Continue On Failure
... Page Should Contain Are you sure you want to stop the workbench? Any changes without saving will be erased.
Run Keyword And Continue On Failure Page Should Contain To save changes, access your
Run Keyword And Continue On Failure Page Should Contain Element xpath=//a[.="workbench"]
END
Run Keyword And Continue On Failure Page Should Contain Element xpath=//input[@id="dont-show-again"]
Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"]
Run Keyword And Continue On Failure Click Element xpath=//input[@id="dont-show-again"]
Expand All @@ -363,12 +368,13 @@ Delete Workbench
Edit Workbench
[Documentation] Edits a workbench
[Arguments] ${workbench_title}
Click Action From Actions Menu item_title=${workbench_title} item_type=workbench action=Edit
Workbenches.Click Action From Actions Menu item_title=${workbench_title} item_type=workbench action=Edit
Wait Until Page Contains Element ${WORKBENCH_NAME_INPUT_XP}

Check Launched Workbench Is The Correct One
[Documentation] Checks if the launched workbench is the expected one
[Arguments] ${workbench_title} ${image} ${namespace}
[Arguments] ${workbench_title} ${image} ${project_title}
${namespace}= Get Openshift Namespace From Data Science Project project_title=${project_title}
${_} ${cr_name}= Get Openshift Notebook CR From Workbench workbench_title=${workbench_title} namespace=${namespace}
${current_url}= Get Location
Location Should Contain ${cr_name}
Expand Down Expand Up @@ -479,7 +485,18 @@ Delete Workbench From CLI
${ns_name}= Get Openshift Namespace From Data Science Project project_title=${project_title}
${_} ${cr_name}= Get Openshift Notebook CR From Workbench
... workbench_title=${workbench_title} namespace=${ns_name}
IF "${cr_name}" == "${EMPTY}"
Log msg=There is probably no Workbench with Diplay Name equal to ${workbench_title}
... level=WARN
ELSE
Oc Delete kind=Notebook name=${cr_name} namespace=${ns_name}
WHILE ${TRUE}
${_} ${cr_name}= Get Openshift Notebook CR From Workbench
... workbench_title=${workbench_title} namespace=${ns_name}
IF "${cr_name}" == "${EMPTY}" BREAK
Sleep 5s reason=let's not overload the API
END
END

GPU Dropdown Should Be Disabled
[Documentation] Checks if the GPU dropdown is not able editable
Expand Down
Loading

0 comments on commit 98a4185

Please sign in to comment.