From 566020e4cdd27986a4cd4a795b281ce5b04d7e0e Mon Sep 17 00:00:00 2001 From: Olena Zhelnytska Date: Wed, 8 Oct 2025 14:13:19 +0200 Subject: [PATCH] Updated LLM prompts test suite --- tests/features/artifacts.feature | 165 ++++--- tests/features/common-tools/common-consts.js | 27 ++ tests/features/common/page-objects.js | 1 + .../common/page-objects/info-pane.po.js | 136 ++++++ .../page-objects/interactive-popup.po.js | 8 + .../common/page-objects/llm-prompts.po.js | 29 +- tests/features/llmPrompts.feature | 420 +++++++++++++++++- tests/mockServer/dataGenerators.js | 256 ++++++++++- tests/mockServer/mock.js | 2 +- 9 files changed, 962 insertions(+), 82 deletions(-) diff --git a/tests/features/artifacts.feature b/tests/features/artifacts.feature index 8953e5f775..e8f619012c 100644 --- a/tests/features/artifacts.feature +++ b/tests/features/artifacts.feature @@ -300,76 +300,6 @@ Feature: Artifacts Page Then click on "Tabel_View_Button" element on "Files_Info_Pane" wizard Then verify "Cross_Close_Button" element visibility on "Files_Info_Pane" wizard - @MLA - @passive - @smoke - Scenario: MLA013 - Check Details panel still active on page refresh - # * set tear-down property "project" created with "automation-test" value - # * set tear-down property "file" created in "automation-test" project with "test-file" value - * create "automation-test" MLRun Project with code 201 - * create "test-file" File with "test" tag in "automation-test" project with code 200 - Given open url - And wait load page - And click on row root with value "automation-test" in "name" column in "Projects_Table" table on "Projects" wizard - And wait load page - And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard - And click on cell with value "Artifacts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard - And wait load page - Then verify "Table_FilterBy_Button" element on "Files" wizard should display hover tooltip "Common_Tooltips"."FilterBy_Button" - Then click on "Table_FilterBy_Button" element on "Files" wizard - Then select "test" option in "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard - Then click on "Apply_Button" element on "FilterBy_Popup" wizard - And wait load page - When click on cell with value "test-file" in "name" column in "Files_Table" table on "Files" wizard - And wait load page - Then check "test" value in "tag" column in "Overview_Table" table on "Files_Info_Pane" wizard - Then click on "Edit_btn_table_view" element on "Files_Info_Pane" wizard - And wait load page - When type value "v1" to "Version_tag_Input" field on "Files_Info_Pane" wizard - Then click on "Apply_Button" element on "Files_Info_Pane" wizard - Then click on "Apply_Changes_Button" element on "Files_Info_Pane" wizard - And wait load page - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard - Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" - Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard - Then verify "Header" element visibility on "Files_Info_Pane" wizard - Then "Header" element on "Files_Info_Pane" should contains "test-file" value - Then refresh a page - And wait load page - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard - Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" - Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard - Then verify "Header" element visibility on "Files_Info_Pane" wizard - Then "Header" element on "Files_Info_Pane" should contains "test-file" value - Then verify "Table_Refresh_Button" element visibility on "Files" wizard - Then verify "Table_Refresh_Button" element on "Files" wizard should display hover tooltip "Common_Tooltips"."Refresh_Button" - Then click on "Table_Refresh_Button" element on "Files" wizard - And wait load page - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard - Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" - Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard - Then verify "Header" element visibility on "Files_Info_Pane" wizard - Then click on "Cross_Close_Button" element on "Files_Info_Pane" wizard - And wait load page - Then verify "Header" element not exists on "Files_Info_Pane" wizard - When click on cell with value "test-file" in "name" column in "Files_Table" table on "Files" wizard - And wait load page - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Not_In_Filtered_List_Message" element not exists on "Files_Info_Pane" wizard - Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard - Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" - Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard - Then verify "Header" element visibility on "Files_Info_Pane" wizard - @MLA @passive @inProgress @@ -893,6 +823,101 @@ Feature: Artifacts Page And wait load page Then verify "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard selected attribute option value "All tags" + @MLA + @passive + @smoke + Scenario: MLA013 - Check Details panel still active on page refresh + Given open url + And wait load page + And click on row root with value "default" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "Artifacts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And wait load page + Then select "Add a tag" option in action menu on "Files" wizard in "Files_Table" table at row with "training_iteration_results" value in "name" column + And wait load page + Then verify "Add_Tag_Popup" element visibility on "Add_Tag_Popup" wizard + Then type value "test" to "Tag_Input" field on "Add_Tag_Popup" wizard + Then click on "Add_Button" element on "Add_Tag_Popup" wizard + And wait load page + Then verify "Notification_Pop_Up" element visibility on "Notification_Popup" wizard + And wait load page + Then "Notification_Pop_Up" element on "Notification_Popup" should contains "Tag was added successfully" value + And wait load page + Then verify "Notification_Pop_Up_Cross_Close_Button" element visibility on "Notification_Popup" wizard + Then click on "Notification_Pop_Up_Cross_Close_Button" element on "Notification_Popup" wizard + Then verify "Table_FilterBy_Button" element on "Files" wizard should display hover tooltip "Common_Tooltips"."FilterBy_Button" + Then click on "Table_FilterBy_Button" element on "Files" wizard + Then select "test" option in "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "training_iteration_results" in "name" column in "Files_Table" table on "Files" wizard + And wait load page + Then check "test" value in "tag" column in "Overview_Table" table on "Files_Info_Pane" wizard + Then click on "Edit_btn_table_view" element on "Files_Info_Pane" wizard + And wait load page + When type value "v1" to "Version_tag_Input" field on "Files_Info_Pane" wizard + Then click on "Apply_Button" element on "Files_Info_Pane" wizard + Then click on "Apply_Changes_Button" element on "Files_Info_Pane" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard + Then verify "Header" element visibility on "Files_Info_Pane" wizard + Then "Header" element on "Files_Info_Pane" should contains "training_iteration_results" value + Then refresh a page + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard + Then verify "Header" element visibility on "Files_Info_Pane" wizard + Then "Header" element on "Files_Info_Pane" should contains "training_iteration_results" value + Then verify "Table_Refresh_Button" element visibility on "Files" wizard + Then verify "Table_Refresh_Button" element on "Files" wizard should display hover tooltip "Common_Tooltips"."Refresh_Button" + Then click on "Table_Refresh_Button" element on "Files" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "Files_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "Files_Info_Pane" should be equal "Files_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard + Then verify "Header" element visibility on "Files_Info_Pane" wizard + Then click on "Cross_Close_Button" element on "Files_Info_Pane" wizard + And wait load page + Then verify "Header" element not exists on "Files_Info_Pane" wizard + And verify "No_Data_Message" element visibility on "commonPagesHeader" wizard + Then "No_Data_Message" component on "commonPagesHeader" should be equal "No_Data_Message"."Common_Message_Artifact_Tag" + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then click on "Clear_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "training_iteration_results" in "name" column in "Files_Table" table on "Files" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element not exists on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard + Then verify "Header" element visibility on "Files_Info_Pane" wizard + Then click on "Table_FilterBy_Button" element on "Files" wizard + Then select "v1" option in "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "training_iteration_results" in "name" column in "Files_Table" table on "Files" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element not exists on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" element visibility on "Files_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard should contains "Files_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "Files_Info_Pane" wizard + Then verify "Header" element visibility on "Files_Info_Pane" wizard + @MLA @smoke Scenario: MLA023 - Check components on artifact Full view content diff --git a/tests/features/common-tools/common-consts.js b/tests/features/common-tools/common-consts.js index f81eca0ac9..774c2a5b92 100644 --- a/tests/features/common-tools/common-consts.js +++ b/tests/features/common-tools/common-consts.js @@ -110,6 +110,7 @@ export default { }, Common_Lists: { Action_Menu_List: ['Add a tag', 'Download', 'Copy URI', 'View YAML', 'Delete', 'Delete all versions'], + Action_Menu_List_LLM_Prompt: ['Add a tag', 'Download', 'Copy URI', 'View YAML'], Action_Menu_List_Version_History: ['Add a tag', 'Download', 'Copy URI', 'View YAML', 'Delete'], Action_Menu_List_Expanded: ['Add a tag', 'Download', 'Copy URI', 'View YAML', 'Delete all'], Action_Menu_List_Dataset_Transition_Popup: ['Download', 'Copy URI', 'View YAML'], @@ -154,6 +155,26 @@ export default { ], Overview_Producer_Headers: ['Name:', 'Kind:', 'Tag:', 'Owner:', 'UID:'] }, + LLM_Prompts_Info_Pane: { + Tab_List: ['Overview', 'Prompt Template', 'Generation Configuration'], + Tab_List_Prompt_Template: ['Prompt', 'Arguments'], + Info_Banner_Message: /The LLM prompt is not in the filtered list\. Closing the details panel will return you to the current list\./, + Overview_General_Headers: [ + 'Key:', + 'Description:', + 'Model name:', + 'Hash:', + 'Version tag:', + 'Original source:', + 'Iter:', + 'URI:', + 'Path:', + 'UID:', + 'Updated:', + 'Labels:' + ], + Overview_Producer_Headers: ['Name:', 'Kind:', 'Tag:', 'Owner:', 'UID:'] + }, Alerts_Jobs_Info_Pane: { Overview_General_Headers: [ 'Project Name:', @@ -399,6 +420,7 @@ export default { Auto_Refresh: 'Uncheck Auto Refresh to view more results', FilterBy_Button: 'Filter', FilterBy_Button_1: 'Filter (1)', + Argument: 'The essence of all things', Show_All_Versions: 'Show all versions', Open_Metrics: 'Open metrics', Refresh_Button: 'Refresh', @@ -545,6 +567,7 @@ export default { FeatureSets_Stats_Tip: 'Each feature set can have multiple versions, produced by multiple runs and given multiple tags.\n' + ' You can browse them in the Feature store page.', + Model_Version_Tag: 'Enter a model name to enable field.', Artifacts_Stats_Tip: 'Each artifact can have multiple versions, produced by multiple runs and given multiple tags.\n' + ' You can browse them in the Artifacts page.', @@ -766,6 +789,10 @@ export default { Common_Message_Jobs_Monitoring: /No data matches the filter: "Start time: \d{2}\/\d{2}\/\d{4} \d{2}:\d{2} - \d{2}\/\d{2}\/\d{4} \d{2}:\d{2}, Project: (.+?)"/, Common_Message_Monitor_Jobs_Name: /No data matches the filter: "Name: (.+?)"/, + Common_Message_LLM_Prompt_Name: /No data matches the filter: "Name: (.+?), LLM prompt version tag: (.+?), Show best iteration only: (.+?)"/, + Common_Message_LLM_Prompt_Label: /No data matches the filter: "Name: (.+?), LLM prompt version tag: (.+?), Labels: (.+?), Show best iteration only: (.+?)"/, + Common_Message_LLM_Prompt_Tag: /No data matches the filter: "LLM prompt version tag: (.+?), Show best iteration only: (.+?)"/, + Common_Message_Artifact_Tag: /No data matches the filter: "Version tag: (.+?), Show best iteration only: (.+?)"/, Common_Message_Jobs_Monitoring_Workflow_Project: /No data matches the filter: "Created at: \d{2}\/\d{2}\/\d{4} \d{2}:\d{2} - \d{2}\/\d{2}\/\d{4} \d{2}:\d{2}, Project: (.+?)"/, Common_Message_Jobs_Monitoring_Status: diff --git a/tests/features/common/page-objects.js b/tests/features/common/page-objects.js index 42df075d58..e55d8b4c73 100644 --- a/tests/features/common/page-objects.js +++ b/tests/features/common/page-objects.js @@ -85,6 +85,7 @@ export default { Jobs_Monitoring_Scheduled_Tab: jobsMonitoring['crossScheduledMonitorTab'], Jobs_Monitor_Tab_Info_Pane: infoPane['jobsMonitorTabInfoPane'], LLM_Prompts: llmPrompts['llmPrompts'], + LLM_Prompts_Info_Pane: infoPane['llmPromptsInfoPane'], Metrics_Selector_Popup: interactivePopup['metricsSelectorPopup'], ML_Function_Info_Pane: infoPane['mlFunctionInfoPane'], ML_Functions: Functions['mlFunctions'], diff --git a/tests/features/common/page-objects/info-pane.po.js b/tests/features/common/page-objects/info-pane.po.js index cc02bfc567..4e1e87ef52 100644 --- a/tests/features/common/page-objects/info-pane.po.js +++ b/tests/features/common/page-objects/info-pane.po.js @@ -63,6 +63,62 @@ const infoPaneTabSelector = { } } +const promptTemplateTabSelector = { + root: '.table__item .item-header-wrapper .content-menu__tabs', + header: {}, + body: { + row: { + root: '.content-menu__tab', + fields: { + key: '', + hintButton: '.tip-container' + } + } + } +} + +const promptArgumentsTabSelector = { + root: '.table__item .item-info .content-menu__tabs', + header: {}, + body: { + row: { + root: '.content-menu__tab', + fields: { + key: '', + hintButton: '.tip-container' + } + } + } +} + +const argumentsTabTable = { + root: '.arguments-tab', + header: {}, + body: { + row: { + root: '.arguments-tab__row', + fields: { + key: '.arguments-tab__row-key', + value: '.arguments-tab__row-value' + } + } + } +} + +const generationConfigurationTabTable = { + root: '.generation-configuration-tab', + header: {}, + body: { + row: { + root: '.generation-configuration-tab__row', + fields: { + key: '.generation-configuration-tab__row-key', + value: '.generation-configuration-tab__row-value' + } + } + } +} + const infoPaneOverviewHeaders = { root: '.table__item .item-info__details-wrapper:nth-of-type(1)', header: {}, @@ -78,6 +134,20 @@ const infoPaneOverviewHeaders = { } } +const infoPaneOverviewPromptTable = { + root: '.table__item .prompt-tab__table', + header: {}, + body: { + row: { + root: '.prompt-tab__row', + fields: { + role: '.prompt-tab__role', + content: '.prompt-tab__content' + } + } + } +} + const infoPaneOverviewProducerHeaders = { root: '.table__item .item-info__details-wrapper:nth-of-type(2)', header: {}, @@ -121,6 +191,7 @@ const infoPaneOverviewSourcesHeaders = { } } } + const artifactOverviewTable = { root: '.table__item .item-info__details:nth-of-type(1)', header: {}, @@ -143,6 +214,20 @@ const artifactOverviewTable = { } } +const llmPromptOverviewTable = { + root: '.table__item .item-info__details-wrapper:nth-of-type(1)', + header: {}, + body: { + row: { + root: '', + fields: { + key: '.details-item:nth-of-type(1) .details-item__data', + tag: '.details-item:nth-of-type(5) .details-item__data' + } + } + } +} + const datasetOverviewTable = { root: '.table__item .item-info__details:nth-of-type(1)', header: {}, @@ -990,6 +1075,57 @@ export default { Cross_Close_Button: By.css('.graph-pane__title .round-icon-cp .round-icon-cp__circle'), Overview_Headers: commonTable(modelsRealTimeinfoPaneOverviewHeaders) }, + llmPromptsInfoPane: { + Header: header, + Updated: updated, + Not_In_Filtered_List_Message: By.css('[data-testid="detailsPanel"] .item-header__status .info-banner'), + Action_Menu: commonActionMenu, + Apply_Changes_Button: applyChangesButton, + Apply_Button: applyButton, + Cross_Close_Button: crossCloseButton, + Full_View_Button: fullViewButton, + Tabel_View_Button: tabelViewButton, + Info_Pane_Tab_Selector: commonInfoPaneTabSelector, + Prompt_Template_Tab_Selector: commonTable(promptTemplateTabSelector), + Prompt_Arguments_Tab_Selector: commonTable(promptArgumentsTabSelector), + Arguments_Tab_Table: commonTable(argumentsTabTable), + Generation_Configuration_Tab_Table: commonTable(generationConfigurationTabTable), + Find_In_Prompt_Filter_Input: inputGroup( + generateInputGroup( + '.search-navigator [data-testid="search-container"]', + true, + false + ) + ), + Overview_General_Headers: commonTable(infoPaneOverviewHeaders), + Overview_Producer_Headers: commonTable(infoPaneOverviewProducerHeaders), + Overview_Hash_Header: labelComponent( + generateLabelGroup( + '.item-info__details:nth-of-type(1) .details-item:nth-of-type(4) .details-item__header', + false, + true + ) + ), + Overview_UID_Header: labelComponent( + generateLabelGroup( + '.item-info__details-wrapper:nth-of-type(2) .item-info__details .details-item:nth-of-type(5) .details-item__header', + false, + true + ) + ), + Overview_Table: commonTable(llmPromptOverviewTable), + Prompt_Template_Table: commonTable(infoPaneOverviewPromptTable), + Prompt_Template_Argument: By.css('.prompt-tab__table .prompt-tab__row:nth-of-type(3) .prompt-tab__content span'), + Generation_Configuration_Counter: By.css('.generation-configuration-tab .generation-configuration-tab__counter'), + Edit_btn_table_view: commonEditBtnTableView, + Version_tag_Input: inputGroup( + generateInputGroup( + '.details-item:nth-of-type(5) .details-item__input-wrapper', + false, + false + ) + ) + }, paginationInfoPane: { BE_Pagination_Navigate_Prev: By.css( '[data-testid="pagination-navigate-double-prev-btn"] button' diff --git a/tests/features/common/page-objects/interactive-popup.po.js b/tests/features/common/page-objects/interactive-popup.po.js index 417d550bb6..3d2a2e27ba 100644 --- a/tests/features/common/page-objects/interactive-popup.po.js +++ b/tests/features/common/page-objects/interactive-popup.po.js @@ -1732,6 +1732,14 @@ export default { true ) ), + Model_Name_Filter_Input: inputGroup( + generateInputGroup('[data-testid="model-name-form-field-input"]', true, false, 'svg') + ), + Model_Version_Tag_Filter_Input: inputGroup( + generateInputGroup('[data-testid="model-tag-form-field-input"]', true, false, 'svg') + ), + Model_Version_Tag_Filter_Field: By.css('[data-testid="model-tag-form-field-input"] > div:nth-child(2)'), + Model_Version_Tag_Filter_Tip: By.css('[data-testid="model-tag-form-field-input"] > div:nth-child(2) .form-field__icons svg'), Status_Filter_Element: By.css('[data-testid="state-form-field-select"]'), Status_Filter_Dropdown: dropdownComponent( generateDropdownGroup( diff --git a/tests/features/common/page-objects/llm-prompts.po.js b/tests/features/common/page-objects/llm-prompts.po.js index 9b36a87c0e..9e1f4ab606 100644 --- a/tests/features/common/page-objects/llm-prompts.po.js +++ b/tests/features/common/page-objects/llm-prompts.po.js @@ -25,6 +25,7 @@ import { generateDropdownGroup } from '../../common-tools/common-tools' import inputGroup from '../components/input-group.component' +import actionMenu from '../components/action-menu.component' const commonSearchByNameFilterInput = inputGroup( generateInputGroup( @@ -34,6 +35,14 @@ const commonSearchByNameFilterInput = inputGroup( ) ) +const actionMenuStructure = { + root: '.actions-menu__container', + menuElements: { + open_button: '[data-testid="actions-menu"] button', + options: '.actions-menu__body .actions-menu__option' + } +} + const overallTable = { root: '.table__content', header: { @@ -53,10 +62,11 @@ const overallTable = { root: '.table-row', fields: { name: '[data-testid="name"] a .link', + uid: '.table-body__cell:nth-of-type(1) a .name-wrapper .link', labels: { componentType: dropdownComponent, structure: generateDropdownGroup( - '.table-body__cell:nth-of-type(7)', + '.table-body__cell:nth-of-type(3)', '.chip-block span.chips_button', '.chip-block-hidden_visible .data-ellipsis.tooltip-wrapper', false, @@ -66,7 +76,12 @@ const overallTable = { producer: '[data-testid="producer"] .data-ellipsis', owner: '[data-testid="owner"] .data-ellipsis', updated: '[data-testid="updated"] .data-ellipsis', - size: '[data-testid="size"] .data-ellipsis' + size: '[data-testid="size"] .data-ellipsis', + show_all_versions: '[data-testid="quick-link-show-all-versions"]', + action_menu: { + componentType: actionMenu, + structure: actionMenuStructure + }, } } } @@ -77,6 +92,14 @@ export default { Search_By_Name_Filter_Input: commonSearchByNameFilterInput, Table_FilterBy_Button: By.css('[data-testid="filter-menu-btn-tooltip-wrapper"]'), Refresh_Button: By.css('[data-testid="refresh"] [data-testid="refresh-tooltip-wrapper"]'), - LLMPrompts_Table: commonTable(overallTable) + LLMPrompts_Table: commonTable(overallTable), + Overlay: By.css('#overlay_container .chip-block-hidden_visible'), + History_Back_Button: By.css('.history-back-link .history-back-link__icon'), + Version_History_Title: By.css( + '.history-back-link .history-back-link__title [data-testid="version-history"]' + ), + Version_History_Prompt_Name: By.css( + '.history-back-link .history-back-link__title .data-ellipsis.tooltip-wrapper' + ) } } diff --git a/tests/features/llmPrompts.feature b/tests/features/llmPrompts.feature index ea20a8653e..46c0bb06fd 100644 --- a/tests/features/llmPrompts.feature +++ b/tests/features/llmPrompts.feature @@ -7,18 +7,16 @@ Feature: LLM prompts Page Scenario: MLLP001 - Check components on LLM prompts page Given open url And wait load page - When turn on demo mode with query params "false" - And wait load page - And click on row root with value "default" in "name" column in "Projects_Table" table on "Projects" wizard + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard And wait load page Then verify breadcrumbs "tab" label should be equal "Project monitoring" value - Then verify breadcrumbs "project" label should be equal "default" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard And hover "MLRun_Logo" component on "commonPagesHeader" wizard And wait load page Then verify breadcrumbs "tab" label should be equal "LLM prompts" value - Then verify redirection to "projects/default/llm-prompts?bePage=1&fePage=1" + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard And click on cell with value "Project monitoring" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard And hover "MLRun_Logo" component on "commonPagesHeader" wizard @@ -27,7 +25,7 @@ Feature: LLM prompts Page And wait load page And select "tab" with "LLM prompts" value in breadcrumbs menu And wait load page - Then verify redirection to "projects/default/llm-prompts?bePage=1&fePage=1" + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" Then verify breadcrumbs "tab" label should be equal "LLM prompts" value Then verify "Search_By_Name_Filter_Input" element visibility on "LLM_Prompts" wizard Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard @@ -38,6 +36,11 @@ Feature: LLM prompts Page Then verify "Table_Label_Filter_Input" element visibility on "FilterBy_Popup" wizard Then verify "Table_Tree_Filter_Dropdown" element visibility on "FilterBy_Popup" wizard Then verify "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard selected attribute option value "latest" + Then verify "Model_Name_Filter_Input" element visibility on "FilterBy_Popup" wizard + Then verify "Model_Version_Tag_Filter_Input" element visibility on "FilterBy_Popup" wizard + Then verify "Model_Version_Tag_Filter_Field" element on "FilterBy_Popup" wizard is disabled by class name + Then verify "Model_Version_Tag_Filter_Tip" element visibility on "FilterBy_Popup" wizard + Then verify "Model_Version_Tag_Filter_Tip" element on "FilterBy_Popup" wizard should display hover hint "Label_Hint"."Model_Version_Tag" Then verify "Show_Iterations_Checkbox" element visibility on "FilterBy_Popup" wizard Then "Show_Iterations_Checkbox" element should be checked on "FilterBy_Popup" wizard Then verify "Clear_Button" element visibility on "FilterBy_Popup" wizard @@ -72,4 +75,407 @@ Feature: LLM prompts Page Then verify "Pagination_Page_Number" element visibility on "Pagination_Info_Pane" wizard Then "Pagination_Page_Number" element on "Pagination_Info_Pane" should contains "1" value Then verify "Pagination_Count" element visibility on "Pagination_Info_Pane" wizard - Then "Pagination_Count" element on "Pagination_Info_Pane" should contains "Showing 1 - 3" value + Then "Pagination_Count" element on "Pagination_Info_Pane" should contains "Showing 1 - 1" value + + @MLLP + @smoke + Scenario: MLLP002 - Verify searching by llm prompt name on LLM prompts page + Given open url + And wait load page + And click on row root with value "auto-generated-data" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "auto-generated-data" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/auto-generated-data/llm-prompts?bePage=1&fePage=1" + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "Project monitoring" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + And wait load page + Then verify "LLM_Prompts_Counter_Subtitle" element visibility in "Artifacts_Stats_Container" on "Project" wizard + Then "LLM_Prompts_Counter_Subtitle" element in "Artifacts_Stats_Container" on "Project" should contains "LLM prompt artifacts" value + When click on "LLM_Prompts_Counter_Number" element in "Artifacts_Stats_Container" on "Project" wizard + And wait load page + Then verify redirection to "projects/auto-generated-data/llm-prompts?bePage=1&fePage=1" + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify "Search_By_Name_Filter_Input" element visibility on "LLM_Prompts" wizard + Then type value "59" to "Search_By_Name_Filter_Input" field on "LLM_Prompts" wizard + Then click on "Refresh_Button" element on "LLM_Prompts" wizard + And wait load page + Then value in "name" column with "text" in "LLMPrompts_Table" on "LLM_Prompts" wizard should contains "59" + And wait load page + Then type value "yyyy" to "Search_By_Name_Filter_Input" field on "LLM_Prompts" wizard + Then click on "Refresh_Button" element on "LLM_Prompts" wizard + And wait load page + And verify "No_Data_Message" element visibility on "commonPagesHeader" wizard + Then "No_Data_Message" component on "commonPagesHeader" should be equal "No_Data_Message"."Common_Message_LLM_Prompt_Name" + + @MLLP + @smoke + Scenario: MLLP003 - Verify filtering by llm prompt label on LLM prompts page + Given open url + And wait load page + And click on row root with value "auto-generated-data" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "auto-generated-data" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/auto-generated-data/llm-prompts?bePage=1&fePage=1" + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "Project monitoring" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + And wait load page + Then verify "LLM_Prompts_Counter_Subtitle" element visibility in "Artifacts_Stats_Container" on "Project" wizard + Then "LLM_Prompts_Counter_Subtitle" element in "Artifacts_Stats_Container" on "Project" should contains "LLM prompt artifacts" value + When click on "LLM_Prompts_Counter_Number" element in "Artifacts_Stats_Container" on "Project" wizard + And wait load page + Then verify redirection to "projects/auto-generated-data/llm-prompts?bePage=1&fePage=1" + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then type value "language" to "Table_Label_Filter_Input" field on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + Then type value "50" to "Search_By_Name_Filter_Input" field on "LLM_Prompts" wizard + Then click on "Refresh_Button" element on "LLM_Prompts" wizard + And wait load page + Then value in "labels" column with "dropdowns" in "LLMPrompts_Table" on "LLM_Prompts" wizard should contains "language" in "Overlay" + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then type value "type=qa" to "Table_Label_Filter_Input" field on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + Then value in "labels" column with "text" in "LLMPrompts_Table" on "LLM_Prompts" wizard should contains "type=qa" + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then type value "v3io_user=123" to "Table_Label_Filter_Input" field on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + And verify "No_Data_Message" element visibility on "commonPagesHeader" wizard + Then "No_Data_Message" component on "commonPagesHeader" should be equal "No_Data_Message"."Common_Message_LLM_Prompt_Label" + + @MLLP + @smoke + Scenario: MLLP004 - Verify the Show iterations checkbox on LLM prompts page + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "Project monitoring" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + And wait load page + And select "tab" with "LLM prompts" value in breadcrumbs menu + And wait load page + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then verify "Show_Iterations_Checkbox" element visibility on "FilterBy_Popup" wizard + Then "Show_Iterations_Checkbox" element should be checked on "FilterBy_Popup" wizard + Then uncheck "Show_Iterations_Checkbox" element on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then "Show_Iterations_Checkbox" element should be unchecked on "FilterBy_Popup" wizard + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then verify "show_all_versions" option is present on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column + Then verify "show_all_versions" option on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column should display hover tooltip "Common_Tooltips"."Show_All_Versions" with scroll "false" + Then click on cell with row index 1 in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then verify "Header" element visibility on "LM_Prompts_Info_Pane" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then check "Show_Iterations_Checkbox" element on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + Then verify "Header" element not exists on "LM_Prompts_Info_Pane" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then "Show_Iterations_Checkbox" element should be checked on "FilterBy_Popup" wizard + + @MLLP + @smoke + Scenario: MLLP005 - Check components on prompt item infopane on Overview tab table + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then click on cell with row index 1 in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Updated" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" dropdown element on "LLM_Prompts_Info_Pane" wizard should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + Then select "Download" option in action menu on "LLM_Prompts_Info_Pane" wizard + And wait load page + And wait load page + Then verify "Download_Pop_Up" element visibility on "Downloads_Popup" wizard + And wait load page + Then verify "Download_Pop_Up_Cross_Cancel_Button" element visibility on "Downloads_Popup" wizard + And wait load page + Then verify "Download_Pop_Up_Cross_Cancel_Button" element visibility on "Downloads_Popup" wizard + And wait load page + Then verify "Header_Download_Pop_Up" element visibility on "Downloads_Popup" wizard + Then "Header_Download_Pop_Up" element on "Downloads_Popup" should contains "Downloads" value + Then click on "Download_Pop_Up_Cross_Cancel_Button" element on "Downloads_Popup" wizard + Then verify "Cross_Close_Button" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Full_View_Button" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Overview_General_Headers" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Overview_General_Headers" + Then verify "Overview_Hash_Header" on "LLM_Prompts_Info_Pane" wizard should display "Label_Hint"."Overview_Hash" + Then verify "Overview_Producer_Headers" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Overview_Producer_Headers" + Then verify "Overview_UID_Header" on "LLM_Prompts_Info_Pane" wizard should display "Label_Hint"."Overview_UID" + Then click on "Full_View_Button" element on "LLM_Prompts_Info_Pane" wizard + Then verify "Cross_Close_Button" element not exists on "LLM_Prompts_Info_Pane" wizard + Then click on "Tabel_View_Button" element on "LLM_Prompts_Info_Pane" wizard + Then verify "Cross_Close_Button" element visibility on "LLM_Prompts_Info_Pane" wizard + + @MLLP + @smoke + Scenario: MLLP006 - Verify Add a Tag, Edit a tag action and detail panel behavior after page refresh + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then select "Add a tag" option in action menu on "LLM_Prompts" wizard in "LLMPrompts_Table" table at row with "my_llm" value in "name" column + And wait load page + Then verify "Add_Tag_Popup" element visibility on "Add_Tag_Popup" wizard + Then type value "test" to "Tag_Input" field on "Add_Tag_Popup" wizard + Then click on "Add_Button" element on "Add_Tag_Popup" wizard + And wait load page + Then verify "Notification_Pop_Up" element visibility on "Notification_Popup" wizard + And wait load page + Then "Notification_Pop_Up" element on "Notification_Popup" should contains "Tag was added successfully" value + And wait load page + Then verify "Notification_Pop_Up_Cross_Close_Button" element visibility on "Notification_Popup" wizard + Then click on "Notification_Pop_Up_Cross_Close_Button" element on "Notification_Popup" wizard + Then verify "Table_FilterBy_Button" element on "LLM_Prompts" wizard should display hover tooltip "Common_Tooltips"."FilterBy_Button" + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then select "test" option in "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "my_llm" in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then check "test" value in "tag" column in "Overview_Table" table on "LLM_Prompts_Info_Pane" wizard + Then click on "Edit_btn_table_view" element on "LLM_Prompts_Info_Pane" wizard + And wait load page + When type value "v1" to "Version_tag_Input" field on "LLM_Prompts_Info_Pane" wizard + Then click on "Apply_Button" element on "LLM_Prompts_Info_Pane" wizard + Then click on "Apply_Changes_Button" element on "LLM_Prompts_Info_Pane" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "LLM_Prompts_Info_Pane" should be equal "LLM_Prompts_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Header" element on "LLM_Prompts_Info_Pane" should contains "my_llm" value + Then refresh a page + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "LLM_Prompts_Info_Pane" should be equal "LLM_Prompts_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Header" element on "LLM_Prompts_Info_Pane" should contains "my_llm" value + Then verify "Refresh_Button" element visibility on "LLM_Prompts" wizard + Then verify "Refresh_Button" element on "LLM_Prompts" wizard should display hover tooltip "Common_Tooltips"."Refresh_Button" + Then click on "Refresh_Button" element on "LLM_Prompts" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Not_In_Filtered_List_Message" component on "LLM_Prompts_Info_Pane" should be equal "LLM_Prompts_Info_Pane"."Info_Banner_Message" + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then click on "Cross_Close_Button" element on "LLM_Prompts_Info_Pane" wizard + And wait load page + Then verify "Header" element not exists on "LLM_Prompts_Info_Pane" wizard + And wait load page + And verify "No_Data_Message" element visibility on "commonPagesHeader" wizard + Then "No_Data_Message" component on "commonPagesHeader" should be equal "No_Data_Message"."Common_Message_LLM_Prompt_Tag" + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then click on "Clear_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "my_llm" in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element not exists on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then select "v1" option in "Table_Tree_Filter_Dropdown" dropdown on "FilterBy_Popup" wizard + Then click on "Apply_Button" element on "FilterBy_Popup" wizard + And wait load page + When click on cell with value "my_llm" in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Not_In_Filtered_List_Message" element not exists on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Overview" tab is active in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + + @MLLP + @smoke + Scenario: MLLP007 - Check components on prompt item infopane on Prompt Template tab table + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then click on cell with row index 1 in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then select "Prompt Template" tab in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + And wait load page + Then verify "Prompt_Template_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Template_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Prompt Template" tab is active in "Prompt_Template_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Updated" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" dropdown element on "LLM_Prompts_Info_Pane" wizard should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + Then verify "Cross_Close_Button" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Arguments_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Arguments_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List_Prompt_Template" + Then verify "Prompt" tab is active in "Prompt_Arguments_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Find_In_Prompt_Filter_Input" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Template_Table" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Template_Argument" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Prompt_Template_Argument" element on "LLM_Prompts_Info_Pane" should contains "{something_with_meaning}" value + Then verify "Prompt_Template_Argument" element on "LLM_Prompts_Info_Pane" wizard should display hover tooltip "Common_Tooltips"."Argument" + Then click on "Prompt_Template_Argument" element on "LLM_Prompts_Info_Pane" wizard + And wait load page + Then verify "Prompt Template" tab is active in "Prompt_Template_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Arguments" tab is active in "Prompt_Arguments_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then value in "key" column with "text" in "Arguments_Tab_Table" on "LLM_Prompts_Info_Pane" wizard should contains "word" + Then value in "value" column with "text" in "Arguments_Tab_Table" on "LLM_Prompts_Info_Pane" wizard should contains "The essence of all things" + + @MLLP + @smoke + Scenario: MLLP008 - Check components on prompt item infopane on Generation Configuration tab table + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then click on cell with row index 1 in "name" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then select "Generation Configuration" tab in "Info_Pane_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + And wait load page + Then verify "Prompt_Template_Tab_Selector" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Prompt_Template_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard should contains "LLM_Prompts_Info_Pane"."Tab_List" + Then verify "Generation Configuration" tab is active in "Prompt_Template_Tab_Selector" on "LLM_Prompts_Info_Pane" wizard + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Updated" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" dropdown element on "LLM_Prompts_Info_Pane" wizard should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + Then verify "Cross_Close_Button" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Generation_Configuration_Counter" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Generation_Configuration_Counter" element on "LLM_Prompts_Info_Pane" should contains "1 modifications made to the default configuration:" value + Then value in "key" column with "text" in "Generation_Configuration_Tab_Table" on "LLM_Prompts_Info_Pane" wizard should contains "temperature" + Then value in "value" column with "text" in "Generation_Configuration_Tab_Table" on "LLM_Prompts_Info_Pane" wizard should contains "0.5" + + @MLLP + @smoke + @uniqueTag + Scenario: MLLP009 - Check components on prompt version history page + Given open url + And wait load page + And click on row root with value "llmdeploy332" in "name" column in "Projects_Table" table on "Projects" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "Project monitoring" value + Then verify breadcrumbs "project" label should be equal "llmdeploy332" value + And hover "Project_Navigation_Toggler" component on "commonPagesHeader" wizard + And click on cell with value "LLM prompts" in "link" column in "General_Info_Quick_Links" table on "commonPagesHeader" wizard + And hover "MLRun_Logo" component on "commonPagesHeader" wizard + And wait load page + Then verify breadcrumbs "tab" label should be equal "LLM prompts" value + Then verify redirection to "projects/llmdeploy332/llm-prompts?bePage=1&fePage=1" + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard + Then verify action menu on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + Then verify "show_all_versions" option is present on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column + Then verify "show_all_versions" option on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column should display hover tooltip "Common_Tooltips"."Show_All_Versions" with scroll "false" + Then click on "show_all_versions" option on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "my_llm" value in "name" column with scroll "false" + And wait load page + Then verify "History_Back_Button" element visibility on "LLM_Prompts" wizard + Then verify "Version_History_Title" element visibility on "LLM_Prompts" wizard + Then "Version_History_Title" element on "LLM_Prompts" should contains "Version history:" value + Then verify "Version_History_Prompt_Name" element visibility on "LLM_Prompts" wizard + Then "Version_History_Prompt_Name" element on "LLM_Prompts" should contains "my_llm" value + Then verify "Refresh_Button" element visibility on "LLM_Prompts" wizard + Then verify "Table_FilterBy_Button" element visibility on "LLM_Prompts" wizard + Then click on "Table_FilterBy_Button" element on "LLM_Prompts" wizard + Then "Show_Iterations_Checkbox" element should be unchecked on "FilterBy_Popup" wizard + Then verify action menu on "LLM_Prompts" wizard in "LLMPrompts_Table" table with "1d459c52a1102adcbbe242e6bb36e99129f2a8b9" value in "uid" column should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + When click on cell with row index 1 in "uid" column in "LLMPrompts_Table" table on "LLM_Prompts" wizard + And wait load page + Then check "latest" value in "tag" column in "Overview_Table" table on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" element visibility on "LLM_Prompts_Info_Pane" wizard + Then verify "Action_Menu" dropdown element on "LLM_Prompts_Info_Pane" wizard should contains "Common_Lists"."Action_Menu_List_LLM_Prompt" + Then verify "Header" element visibility on "LLM_Prompts_Info_Pane" wizard + Then "Header" element on "LLM_Prompts_Info_Pane" should contains "my_llm" value + Then click on "History_Back_Button" element on "LLM_Prompts" wizard + Then verify "LLMPrompts_Table" element visibility on "LLM_Prompts" wizard diff --git a/tests/mockServer/dataGenerators.js b/tests/mockServer/dataGenerators.js index 288dc83825..d9601c546f 100644 --- a/tests/mockServer/dataGenerators.js +++ b/tests/mockServer/dataGenerators.js @@ -31,6 +31,8 @@ export function makeUID(length) { return result } +export const makeHash = () => Math.random().toString(16).substring(2, 42) + export const generateArtifacts = existingArtifacts => { const artifactKinds = ['dataset', 'model', 'document', 'artifact'] const getArtifactTemplate = i => ({ @@ -64,6 +66,243 @@ export const generateArtifacts = existingArtifacts => { }, status: {} }) + + // unique model with unique prompt + const getModelWithPrompt = i => { + const modelKey = `model_${i}_${makeUID(6)}` + const modelUid = makeUID(32) + const modelTree = makeUID(32) + const modelHash = makeHash() + + const model = { + kind: 'model', + metadata: { + project: 'auto-generated-data', + uid: modelUid, + key: modelKey, + iter: 0, + tree: modelTree, + hash: modelHash, + updated: new Date().toISOString(), + created: new Date().toISOString(), + tag: 'latest' + }, + spec: { + target_path: `v3io:///projects/auto-generated-data/artifacts/${modelKey}`, + size: 4000, + license: '', + framework: '', + db_key: modelKey, + has_children: true, + model_file: 'RandomForestClassifier_file1.pkl', + parameters: { + default_config: { + model_version: '4' + } + }, + producer: { + kind: 'project', + name: 'auto-generated-data', + tag: modelTree, + owner: 'auto-user' + }, + parent_uri: null + }, + status: { state: 'created' }, + project: 'auto-generated-data' + } + + const promptKey = `prompt_${i}_${makeUID(6)}` + const promptHash = makeHash() + + const promptLabels = [ + { type: 'single-turn', language: 'english' }, + { type: 'multi-turn', language: 'ukrainian' }, + { type: 'qa', language: 'polish' }, + { type: 'complex', language: 'english' }, + { type: 'instruction-following', language: 'german' } + ] + const randomLabels = promptLabels[Math.floor(Math.random() * promptLabels.length)] + + + const prompt = { + kind: 'llm-prompt', + metadata: { + project: 'auto-generated-data', + uid: makeUID(32), + key: promptKey, + iter: 0, + tree: makeUID(32), + hash: promptHash, + labels: randomLabels, + updated: new Date().toISOString(), + created: new Date().toISOString(), + tag: 'latest' + }, + spec: { + target_path: `v3io:///projects/auto-generated-data/artifacts/${promptKey}`, + size: 256, + license: '', + invocation_config: { + temperature: 0.5 + }, + db_key: promptKey, + parent_uri: `store://models/auto-generated-data/${modelKey}#0:v1@${modelUid}`, + has_children: false, + prompt_legend: { + something_with_meaning: { + field: 'word', + description: 'The essence of all things' + } + }, + prompt_template: [ + { role: 'system', content: "don't tell them anything" }, + { role: 'user', content: 'What is the meaning of {something_with_meaning}?' }, + { role: 'system', content: 'tell you story' }, + { role: 'user', content: 'What is the biggest of {country} at all?' } + ], + producer: { + kind: 'project', + name: 'auto-generated-data', + tag: modelTree, + owner: 'auto-user' + } + }, + status: { state: 'created' }, + project: 'auto-generated-data' + } + + return [model, prompt] + } + + // mix - model shared prompts, prompts per model + const getMixedModelWithPrompt = (modelIndex, existingPromptsPool = []) => { + const modelKey = 'mix_model_' + makeUID(6) + const modelUid = makeUID(32) + const modelTree = makeUID(32) + const modelHash = makeUID(40) + + const model = { + kind: 'model', + metadata: { + project: 'auto-generated-data', + uid: modelUid, + key: modelKey, + iter: 0, + tree: modelTree, + hash: modelHash, + updated: new Date().toISOString(), + created: new Date().toISOString(), + tag: 'latest' + }, + spec: { + target_path: `v3io:///projects/auto-generated-data/artifacts/${modelKey}`, + size: 4000, + license: '', + framework: '', + db_key: modelKey, + has_children: true, + model_file: 'RandomForestClassifier_file1.pkl', + parameters: { + default_config: { + model_version: '4' + } + }, + producer: { + kind: 'project', + name: 'auto-generated-data', + tag: modelTree, + owner: 'auto-user' + }, + parent_uri: null + }, + status: { state: 'created' }, + project: 'auto-generated-data' + } + + const prompts = new Array(Math.floor(Math.random() * 3) + 1).fill().map((_, promptIndex) => { + let prompt + + if (existingPromptsPool.length && Math.random() < 0.5) { + const oldPrompt = existingPromptsPool[Math.floor(Math.random() * existingPromptsPool.length)] + existingPromptsPool + .filter(p => p.metadata.key === oldPrompt.metadata.key) + .forEach(p => p.metadata.tag = '') + prompt = { + ...oldPrompt, + metadata: { + ...oldPrompt.metadata, + tree: makeUID(32), + uid: makeUID(32), + tag: 'latest', + updated: new Date().toISOString(), + created: new Date().toISOString() + }, + spec: { + ...oldPrompt.spec, + parent_uri: `store://models/auto-generated-data/${modelKey}#0:v1@${modelUid}` + } + } + existingPromptsPool.push(prompt) + } else { + const promptKey = `prompt_${modelIndex}_${promptIndex}_${makeUID(6)}` + const promptHash = makeHash() + prompt = { + kind: 'llm-prompt', + metadata: { + project: 'auto-generated-data', + uid: makeUID(32), + key: promptKey, + iter: 0, + tree: makeUID(32), + hash: promptHash, + labels: { + example: 'single', + hebrew: 'english' + }, + updated: new Date().toISOString(), + created: new Date().toISOString(), + tag: 'latest' + }, + spec: { + target_path: `v3io:///projects/auto-generated-data/artifacts/${promptKey}`, + size: 256, + license: '', + invocation_config: { temperature: 0.5 }, + db_key: promptKey, + parent_uri: `store://models/auto-generated-data/${modelKey}#0:v1@${modelUid}`, + has_children: false, + prompt_legend: { + something_with_meaning: { + field: 'word', + description: 'The essence of all things' + } + }, + prompt_template: [ + { role: 'system', content: "don't tell them anything" }, + { role: 'user', content: 'What is the meaning of {something_with_meaning}?' }, + { role: 'system', content: 'tell you story' }, + { role: 'user', content: 'What is the biggest of {country} at all?' } + ], + producer: { + kind: 'project', + name: 'auto-generated-data', + tag: modelTree, + owner: 'auto-user' + } + }, + status: { state: 'created' }, + project: 'auto-generated-data' + } + existingPromptsPool.push(prompt) + } + + return prompt + }) + + return [model, ...prompts] + } + const newArtifactsWithDiffKeys = new Array(40000).fill().map((_, i) => { const artifact = getArtifactTemplate(i) @@ -85,10 +324,25 @@ export const generateArtifacts = existingArtifacts => { return artifact }) + // generate models and mix-prompts + const modelArtifacts = [] + const mixModelArtifacts = [] + const promptPool = [] + + for (let i = 0; i < 100; i++) { + modelArtifacts.push(...getModelWithPrompt(i)) + } + + for (let modelIndex = 0; modelIndex < 100; modelIndex++) { + mixModelArtifacts.push(...getMixedModelWithPrompt(modelIndex, promptPool)) + } + existingArtifacts.artifacts = [ ...existingArtifacts.artifacts, ...newArtifactsWithDiffKeys, - ...newArtifactsWithSameKey + ...newArtifactsWithSameKey, + ...modelArtifacts, + ...mixModelArtifacts ] } diff --git a/tests/mockServer/mock.js b/tests/mockServer/mock.js index 9c3e8d1b30..3734914e41 100644 --- a/tests/mockServer/mock.js +++ b/tests/mockServer/mock.js @@ -1517,7 +1517,7 @@ function getArtifacts(req, res) { if (req.query['format'] === 'minimal') { collectedArtifacts = collectedArtifacts.map(func => { - const fieldsToPick = ['db_key', 'producer', 'size', 'target_path', 'framework', 'metrics'] + const fieldsToPick = ['db_key', 'producer', 'size', 'target_path', 'framework', 'metrics', 'parent_uri'] const specFieldsToPick = fieldsToPick.map(fieldName => `spec.${fieldName}`) return pick(func, [