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

ModelServer Dashboard - fix UI issues #1927

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
${TOKEN_AUTH_CHECKBOX_XP}= xpath://input[@id="alt-form-checkbox-auth"]
${ADD_SERVICE_ACCOUNT_BUTTON}= xpath://button[text()='Add a service account']
${SERVICE_ACCOUNT_INPUT}= xpath://input[@data-testid='service-account-form-name']
${REPLICAS_COUNT_XP}= xpath://section[@class='pf-v5-c-form__section']//span[@class='pf-v5-c-form-control']/input
${PROJECT_SELECTOR_XP}= xpath://main[contains(@id, 'dashboard-page-main')]//*[@data-testid="project-selector-dropdown"]
${REPLICAS_COUNT_XP}= css=[aria-label="model server replicas number input"]
${PROJECT_SELECTOR_XP}= xpath://main[contains(@id, 'dashboard-page-main')]//*[@data-testid="project-selector-toggle"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (121/120)


*** Keywords ***
Expand All @@ -43,8 +43,8 @@
SeleniumLibrary.Click Button Add model server
SeleniumLibrary.Wait Until Page Contains Element //span[.="Add model server"]
Set Model Server Name ${server_name}
Set Replicas Number With Buttons ${no_replicas}
Set Model Server Runtime ${runtime}
Set Replicas Number With Buttons ${no_replicas}
Set Server Size ${server_size}
IF ${no_gpus} > ${0}
${gpu_enabled}= Run Keyword And Return Status Verify GPU Selector Is Usable
Expand Down Expand Up @@ -73,7 +73,7 @@
Set Replicas Number With Buttons
[Documentation] Sets the number of replicas for the model serving pod
[Arguments] ${number}
${current}= Get Element Attribute ${REPLICAS_COUNT_XP} value
${current}= Get Value ${REPLICAS_COUNT_XP}
${difference}= Evaluate int(${number})-int(${current})
${op}= Set Variable plus
IF ${difference}<${0}
Expand All @@ -87,7 +87,7 @@
Click Minus Button
END
END
${current}= Get Element Attribute ${REPLICAS_COUNT_XP} value
${current}= Get Value ${REPLICAS_COUNT_XP}
Should Be Equal As Integers ${current} ${number}

Set Server Size
Expand Down Expand Up @@ -214,7 +214,7 @@
[Arguments] ${service_account_name}=default-name ${single_model}=${FALSE} ${model_name}=${NONE}
IF ${single_model}
# Expand the model
SeleniumLibrary.Click Button xpath: //a[text()='${model_name}']/parent::div/parent::td[@data-label='Name']/preceding-sibling::td/button # robocop: off=line-too-long
SeleniumLibrary.Click Button xpath: //a[text()='${model_name}']/ancestor::td/preceding-sibling::td/button # robocop: off=line-too-long
${token}= Get Single Model Token ${service_account_name}
ELSE
SeleniumLibrary.Wait Until Page Contains Element xpath://td[@data-label="Tokens"]/button
Expand All @@ -228,7 +228,7 @@
[Documentation] Gets the (Single Model) Token of an specific Service Account
[Arguments] ${service_account_name}
${token}= Get Element Attribute
... xpath://div[text()='${service_account_name}']/parent::td[@data-label='Token Name']/following-sibling::td[@data-label='Token Secret']//input value
... xpath://div[text()='${service_account_name}']/../../parent::td[@data-label='Token Name']/following-sibling::td[@data-label="Token Secret"]//input value

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (172/120)

Check warning

Code scanning / Robocop

Continuation marker should be aligned with starting row Warning test

Continuation marker should be aligned with starting row
RETURN ${token}

Click Plus Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
${S3_BUCKET_DC_INPUT_XP}= xpath=//input[@aria-label="Field list AWS_S3_BUCKET"]
${S3_DEFAULT_BUCKET}= ods-ci-s3
${MS_TABLE_PROJECT}= /../../td[@data-label="Project"]
${MS_TABLE_STATUS}= /../../td[@data-label="Status"]
${MS_TABLE_ENDPOINT}= /../../td[@data-label="Inference endpoint"]
${MS_TABLE_STATUS}= /../td[@data-label="Status"]
${MS_TABLE_ENDPOINT}= /../td[@data-label="Inference endpoint"]
${MS_TABLE_ENDPOINT_INPUT}= ${MS_TABLE_ENDPOINT}//div[@class="pf-v5-c-clipboard-copy"]//input
${MS_TABLE_STATUS_SUCCESS}= //span[contains(@class,"pf-v5-c-icon__content")][contains(@class,"pf-m-success")]
${MS_TABLE_STATUS_FAILURE}= //span[contains(@class,"pf-v5-c-icon__content")][contains(@class,"pf-m-danger")]
Expand Down Expand Up @@ -179,12 +179,12 @@
[Arguments] ${model_name} ${expected_status}=success
IF "${expected_status}"=="success"
SeleniumLibrary.Wait Until Page Contains Element
... //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS} timeout=2m
Page Should Not Contain Element //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE}
... //a[text()='test-model']/ancestor::td${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS} timeout=2m
Page Should Not Contain Element //a[text()='test-model']/ancestor::td${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (124/120)
ELSE
SeleniumLibrary.Wait Until Page Contains Element
... //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE} timeout=2m
Page Should Not Contain Element //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS}
... //a[text()='test-model']/ancestor::td${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE} timeout=2m
Page Should Not Contain Element //a[text()='test-model']/ancestor::td${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (124/120)
END

Delete Model Via UI
Expand All @@ -209,7 +209,7 @@
[Documentation] Grabs the serving route (URL) of an already deployed model from the Model Serving page.
[Arguments] ${model_name}
# TODO: Open model serving home page if needed?
${route_xpath}= Set Variable xpath://div[.="${model_name} "]${MS_TABLE_ENDPOINT_INPUT}
${route_xpath}= Set Variable xpath://a[text()='${model_name}']/ancestor::td${MS_TABLE_ENDPOINT_INPUT}
${loaded}= Run Keyword And Return Status SeleniumLibrary.Wait Until Page Contains Element ${route_xpath} timeout=15s
IF ${loaded} == ${FALSE}
Log message=Model Route was not loaded in UI (RHOAIENG-1919). Trying refreshing! level=WARN
Expand Down Expand Up @@ -273,14 +273,16 @@
${kserve}= Run Keyword And Return Status SeleniumLibrary.Page Should Contain
... Single-model serving enabled
${curl_cmd}= Set Variable curl -s ${url} -d ${inference_input}
IF ${token_auth}
IF ${token_auth} and "${token}" == "${NONE}"
IF "${project_title}" == "${NONE}"
${project_title}= Get Model Project ${model_name}
END
IF $token == ${NONE}
${token}= Get Access Token via UI ${project_title} service_account_name=${service_account_name}
... single_model=${kserve} model_name=${model_name}
END
END
IF "${token}" != "${NONE}"
${curl_cmd}= Catenate ${curl_cmd} -H "Authorization: Bearer ${token}"
END
IF ${kserve}
Expand Down Expand Up @@ -487,7 +489,9 @@
[Arguments] ${runtime}=Caikit TGIS
Page Should Contain Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}/..//span[contains(text(),"${runtime}")]
${runtime_xpath}= Set Variable ${KSERVE_RUNTIME_DROPDOWN}/parent::div//span[contains(text(),"${runtime}")]
Wait Until Page Contains Element ${runtime_xpath}
Click Element ${runtime_xpath}

Get Kserve Inference Host Via UI
[Documentation] Fetches the host of the model's URL from the Data Science Project UI
Expand Down
Loading