diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource index 2333463d4..658107a81 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource @@ -24,8 +24,8 @@ ${SERVING_MODEL_SERVERS_SIDE_MENU}= xpath=//span[text()='Models and model ser ${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"] *** Keywords *** @@ -43,8 +43,8 @@ Create Model Server 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 @@ -73,7 +73,7 @@ Create Model Server 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} @@ -87,7 +87,7 @@ Set Replicas Number With Buttons 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 @@ -214,7 +214,7 @@ Get Model Serving Access Token via UI [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 @@ -228,7 +228,7 @@ Get Single Model Token [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 RETURN ${token} Click Plus Button diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource index 66a86b725..6e82c7309 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource @@ -19,8 +19,8 @@ ${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="Field list AWS_DEF ${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")] @@ -179,12 +179,12 @@ Verify Model Status [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} 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} END Delete Model Via UI @@ -209,7 +209,7 @@ Get Model Route Via UI [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 @@ -273,7 +273,7 @@ Get Model Inference ${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 @@ -281,6 +281,8 @@ Get Model Inference ${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} @@ -487,7 +489,9 @@ Set Model Server Runtime [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