Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Registry e2e UI test + breaking ui changes #1879

Merged
merged 11 commits into from
Oct 2, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: maistra.io/v1
kind: ServiceMeshMember
metadata:
name: default
namespace: odh-model-registries
namespace: <MODEL_REGISTRY_NS>
spec:
controlPlaneRef:
name: data-science-smcp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ${DC_ADD_BTN_1_XP}= xpath=//*[@data-testid="add-data-connection-butt
${S3_BUCKET_DC_INPUT_XP}= xpath=//*[@data-testid="field AWS_S3_BUCKET"]
${S3_DC_ADD_BTN}= xpath=//*[@data-testid="data-connection-submit-button"]
${S3_DC_EDIT_BTN}= xpath=//footer/button[.="Update data connection"]
${DC_WORKBENCH_SELECTOR_XP}= xpath=//ul[@aria-label="Notebook select"]/li
${DC_WORKBENCH_SELECTOR_XP}= xpath=//div[@data-testid="connect-existing-workbench-group"]//ul/li


*** Keywords ***
Expand Down Expand Up @@ -47,33 +47,33 @@ Edit S3 Data Connection
Set Connection Between Data Connection And Workbench
[Documentation] Connects a DataConnection to an existent workbench
[Arguments] ${workbench_title}
Wait Until Element Is Enabled xpath=//button[@aria-label="Options menu"]
Click Element xpath=//button[@aria-label="Options menu"]
Wait Until Page Contains Element ${DC_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"]
Click Element ${DC_WORKBENCH_SELECTOR_XP}/button[text()="${workbench_title}"]
Wait Until Element Is Enabled xpath=//button[@aria-label="Notebook select"]
Click Element xpath=//button[@aria-label="Notebook select"]
Wait Until Page Contains Element ${DC_WORKBENCH_SELECTOR_XP}/button[.="${workbench_title}"]
Click Element ${DC_WORKBENCH_SELECTOR_XP}/button[.="${workbench_title}"]

Data Connection Should Be Listed
[Documentation] Checks a Data Connection is listed in DS Project details page
[Arguments] ${name} ${type} ${connected_workbench}
${connection_xp}= Set Variable ${DC_SECTION_XP}//tr[td[@data-label="Name"]//div[text()="${name}"]]
${connection_xp}= Set Variable ${DC_SECTION_XP}//tr[td[@data-label="Name"]//div[.="${name}"]]
Dismissed Show dismissed Hide dismissed
Run Keyword And Continue On Failure Page Should Contain Element ${connection_xp}
Run Keyword And Continue On Failure Page Should Contain Element ${connection_xp}/td[text()=" ${type}"]
Run Keyword And Continue On Failure Page Should Contain Element ${connection_xp}/td[.=" ${type}"]
IF "${connected_workbench}" == "${NONE}"
Run Keyword And Continue On Failure Page Should Contain Element
... ${connection_xp}/td[text()="No connections"]
... ${connection_xp}/td[.="No connections"]
ELSE
FOR ${index} ${workbench_title} IN ENUMERATE @{connected_workbench}
Log ${index}: ${workbench_title}
Run Keyword And Continue On Failure Page Should Contain Element
... ${connection_xp}/td[@data-label="Connected workbenches"]//*[text()="${workbench_title}"]
... ${connection_xp}/td[@data-label="Connected workbenches"]//*[.="${workbench_title}"]
END
END

Data Connection Should Not Be Listed
[Documentation] Checks a Data Connection is not listed in DS Project details page
[Arguments] ${name}
Run Keyword And Continue On Failure Wait Until Page Does Not Contain Element
... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${name}"]]
... ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[.="${name}"]]

Get Openshift Secret From Data Connection
[Documentation] Retrieves name of Openshift secret corresponding to a given S3 Data Connection based on Dispayed name in DS Project details page
Expand Down Expand Up @@ -103,7 +103,7 @@ Fill Data Connection Form
Log msg=you are not connecting any workbenchs to ${dc_name} DataConnection
ELSE
Run Keyword And Continue On Failure
... Element Should Be Enabled xpath=//div[contains(@class,"modal")]//button[@aria-label="Options menu"]
... Element Should Be Enabled xpath=//div[contains(@class,"modal")]//button[@aria-label="Notebook select"]
FOR ${workbench_title} IN @{connected_workbench}
Set Connection Between Data Connection And Workbench ${workbench_title}
Run Keyword And Continue On Failure Element Should Be Enabled ${S3_DC_ADD_BTN}
Expand Down Expand Up @@ -137,7 +137,7 @@ Recreate S3 Data Connection
... ${connected_workbench}=${NONE} ${press_cancel}=${FALSE} ${aws_bucket_name}=${NONE}
Open Data Science Project Details Page project_title=${project_title} tab_id=data-connections
${is_exist}= Run Keyword And Return Status
... Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[text()="${dc_name}"]]
... Wait Until Page Contains Element ${DC_SECTION_XP}//tr[td[@data-label="Name"]/*/div[.="${dc_name}"]]
IF ${is_exist}
Log Data Connection '${dc_name}' already exists, updating connection console=True
Edit S3 Data Connection project_title=${project_title} dc_name=${dc_name} new_dc_name=${dc_name}${SPACE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ Workbench Should Be Listed
[Arguments] ${workbench_title} ${timeout}=10s
Run keyword And Continue On Failure
... Wait Until Page Contains Element
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]/*[div[text()="${workbench_title}"]] timeout=${timeout}
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]//*[.="${workbench_title}"] timeout=${timeout}

Workbench With Description Should Be Listed
[Documentation] Checks a workbench with particular name and description is listed in the DS Project details page
[Arguments] ${workbench_title} ${workbench_description} ${timeout}=10s
Run keyword And Continue On Failure
... Wait Until Page Contains Element
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"][//div[text()="${workbench_title}"] and //p[text()="${workbench_description}"]]
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"][//*[text()="${workbench_title}"] and //p[text()="${workbench_description}"]]
... timeout=${timeout}

Workbench Should Not Be Listed
Expand All @@ -286,7 +286,7 @@ Workbench Status Should Be
[Arguments] ${workbench_title} ${status} ${timeout}=10
Run keyword And Continue On Failure
... Wait Until Page Contains Element
... ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"]
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]//*[.="${workbench_title}"]/../../../td[@data-label="Status"]//span[text()="${status}"]
... timeout=${timeout}

Status Error Icon Should Appear
Expand All @@ -301,7 +301,7 @@ Wait Until Workbench Is Started
[Documentation] Waits until workbench status is "RUNNING" in the DS Project details page
[Arguments] ${workbench_title} ${timeout}=60s ${status}=${WORKBENCH_STATUS_RUNNING}
Wait Until Page Contains Element
... ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td[@data-label="Status"]//p[text()="${status}"]
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]//*[.="${workbench_title}"]/../../../td[@data-label="Status"]//span[text()="${status}"]
... timeout=${timeout}

Wait Until Workbench Is Stopped
Expand Down Expand Up @@ -350,27 +350,42 @@ Access To Workbench
END

Launch And Access Workbench
[Documentation] Launches a workbench from DS Project details page
[Documentation] Launches a workbench from DS Project details page and returns the handle of the current tab
[Arguments] ${workbench_title} ${username}=${TEST_USER_3.USERNAME}
... ${password}=${TEST_USER_3.PASSWORD} ${auth_type}=${TEST_USER_3.AUTH_TYPE}
${is_started}= Run Keyword And Return Status Workbench Status Should Be
... workbench_title=${workbench_title} status=${WORKBENCH_STATUS_RUNNING}
IF ${is_started} == ${TRUE}
Open Workbench workbench_title=${workbench_title}
${previous_handle}= Open Workbench workbench_title=${workbench_title}
Access To Workbench username=${username} password=${password}
... auth_type=${auth_type}
ELSE
Fail msg=Cannot Launch And Access Workbench ${workbench_title} because it is not running...
END
RETURN ${previous_handle}

Open Workbench
[Documentation] Clicks on "open" link for a given workbench
[Documentation] Clicks on "open" link for a given workbench and returns the handle of the current tab
[Arguments] ${workbench_title}
${desc}= Does Workbench Have A Description ${workbench_title}
${open_workbench_link}= Set Variable
... ${WORKBENCH_SECTION_XP}//tr[td[@data-label="Name"]/*[div[text()="${workbench_title}"]]]/td//a[text()="Open"]
Wait Until Page Contains Element ${open_workbench_link} timeout=30s
Click Link ${open_workbench_link}
Switch Window NEW
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]//*[.="${workbench_title}"]
IF ${desc}
${open_workbench_link}= Catenate ${open_workbench_link} /../../../td//a[.="Open"]
ELSE
${open_workbench_link}= Catenate ${open_workbench_link} /../../td//a[.="Open"]
END
SeleniumLibrary.Wait Until Page Contains Element ${open_workbench_link} timeout=30s
SeleniumLibrary.Click Link ${open_workbench_link}
${previous_handle}= SeleniumLibrary.Switch Window NEW
RETURN ${previous_handle}

Does Workbench Have A Description
[Documentation] Checks if a Workbench has a description in the list view of the project
[Arguments] ${workbench_title}
${has_description}= Run Keyword And Return Status SeleniumLibrary.Page Should Contain Element
... ${WORKBENCH_SECTION_XP}//td[@data-label="Name"]//*[.="${workbench_title}"]/../span[@data-testid="table-row-title-description"] # robocop: disable
RETURN ${has_description}

Stop Workbench
[Documentation] Stops a workbench from DS Project details page
Expand Down
Loading
Loading