Skip to content

Commit

Permalink
Impl [Tests] QA Sprint 158 done (mlrun#2262)
Browse files Browse the repository at this point in the history
* Impl [Tests] QA Sprint 158 done


---------

Co-authored-by: EZheln <[email protected]>
  • Loading branch information
ilan7empest and EZheln authored Feb 7, 2024
1 parent 77ca5cf commit 7cfcb73
Show file tree
Hide file tree
Showing 19 changed files with 625 additions and 521 deletions.
File renamed without changes.
7 changes: 4 additions & 3 deletions tests/features/common-tools/common-consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,12 @@ module.exports = {
},
Jobs_And_Workflows: {
Tab_List: ['Monitor Jobs', 'Monitor Workflows', 'Schedule'],
Job_Action_Menu_Options: ['View YAML', 'Batch re-run', 'Monitoring', 'Delete'],
Job_Action_Menu_Options: ['Batch re-run', 'Monitoring', 'View YAML', 'Delete'],
Job_Overview_Action_Menu_Options: ['View YAML', 'Batch re-run', 'Delete'],
Running_Job_Action_Menu_Options: ['View YAML', 'Delete', 'Monitoring', 'Abort'],
Running_Job_Action_Menu_Options: ['Monitoring', 'Abort', 'View YAML'],
Workflows_Action_Menu_Options: ['View YAML'],
Pending_Job_Action_Menu_Options: ['View YAML', 'Batch re-run', 'Monitoring', 'Abort', 'Delete'],
Workflows_Info_Pane_Action_Menu_Options: ['Batch re-run', 'Monitoring', 'View YAML', 'Delete'],
Pending_Job_Action_Menu_Options: ['Batch re-run', 'Monitoring', 'Abort', 'View YAML'],
Schedule_Action_Menu_Options: ['View YAML', 'Run now', 'Edit', 'Delete']
},
Jobs_Monitor_Tab_Info_Pane: {
Expand Down
10 changes: 9 additions & 1 deletion tests/features/common/actions/action-menu.action.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ const action = {
},
checkActionMenuOptions: async function(driver, actionMenu, values) {
const options = await getOptionValues(driver, actionMenu.options)
expect(differenceWith(options, values, isEqual).length).equal(0)

if (options.length === values.length){
const diff = options.every((elem, index) => isEqual(elem, values[index]))
expect(diff).to.equal(true,
`Actual options in action menu [${options}] don't match with expected values [${values}]`)
} else {
expect(options.length).equal(values.length,
`Actual options in action menu [${options}] don't match with expected values [${values}]`)
}
},
verifyOptionInActionMenuEnabled: async function(driver, actionMenu, option){
const elements = await driver.findElements(actionMenu.options)
Expand Down
2 changes: 1 addition & 1 deletion tests/features/common/page-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ module.exports = {
Requested_Features_Info_Pane: infoPane['requestedFeaturesInfoPane'],
Results_Info_Pane: infoPane['resultsInfoPane'],
Schedule_Monitor_Tab: jobsAndWorkflows['ScheduleMonitorTab'],
Schedule_PopUp: interactivePopup['schedulePopUp'],
Statistics_Info_Pane: infoPane['statisticsInfoPane'],
Train_Model: interactivePopup['trainModel'],
Transformations_Info_Pane: infoPane['transformationsInfoPane'],
View_YAML: interactivePopup['viewYamlPopup'],
Workflows_Monitor_Tab: jobsAndWorkflows['WorkflowsMonitorTab'],
Expand Down
148 changes: 141 additions & 7 deletions tests/features/common/page-objects/interactive-popup.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ const dataInputsTable = {
edit_btn: '.form-table__actions-cell .round-icon-cp:nth-of-type(1)',
apply_btn: '.form-table__actions-cell .round-icon-cp:nth-of-type(1)',
delete_btn: '.form-table__actions-cell .round-icon-cp:nth-of-type(2)',
discard_btn: '.form-table__actions-cell .round-icon-cp:nth-of-type(2)',
name_input: '.form-field-input input',
path_dropdown: {
componentType: dropdownComponent,
Expand All @@ -344,6 +345,33 @@ const dataInputsTable = {
false,
false)
},
path_dropdown_autocomplete_artifacts: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
false)
},
path_dropdown_autocomplete_project: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
false)
},
path_dropdown_autocomplete_item: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
false)
},
path_input: 'input.form-field-combobox__input',
path_verify: '.form-table__cell_1:nth-of-type(3)'
}
Expand Down Expand Up @@ -414,6 +442,48 @@ const advancedEnvironmentVariablesTable = {
}
}

const functionsTableSelector = {
root: '.form .functions-list',
header: {},
body: {
row: {
root: '.job-card-template',
fields: {
name:
'.job-card-template__header > div:first-child',
sub_name:
'.job-card-template__header .job-card-template__sub-header .data-ellipsis',
description:
'.job-card-template__description',
labels: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.job-card-template__chips input',
'.chip-block span.chips_button',
'.chip-block .data-ellipsis.tooltip-wrapper .edit-chip-container',
false,
true
)
}
}
}
}
}

const functionSelectionTabs = {
root: '.wizard-form__content .content-menu',
header: {},
body: {
root: '.content-menu__list',
row: {
root: '.content-menu__item',
fields: {
key: 'a'
}
}
}
}

// Common components

const commonCancelButton = By.css('.pop-up-dialog button.pop-up-dialog__btn_cancel')
Expand Down Expand Up @@ -478,10 +548,10 @@ module.exports = {
Title: commonTitle,
Name_Input: inputGroup(
generateInputGroup(
'.pop-up-dialog [data-testid="name-form-field-input"]',
'.pop-up-dialog [data-testid="name-form-field-input"] .form-field__wrapper-normal',
true,
'.input__warning svg',
true
'.form-field__warning svg',
'.form-field__warning svg'
)
),
Description_Input: textAreaGroup(
Expand Down Expand Up @@ -514,10 +584,12 @@ module.exports = {
},
modalWizardForm:{
Title: By.css('.modal .modal__header-title'),
Cross_Cancel_Button: By.css('.modal .modal__header-button'),
Cross_Close_Button: By.css('.modal .modal__header-button'),
Function_Title: By.css(
'.modal .modal__content h6.modal__header-sub-title'
),
Function_Selection_Tabs: commonTable(functionSelectionTabs),
Functions_Table: commonTable(functionsTableSelector),
Hyperparameter_Checkbox: checkboxComponent({
root: '#overlay_container .form-field-checkbox',
elements: {
Expand All @@ -532,6 +604,7 @@ module.exports = {
Schedule_Training_Job_Button: commonScheduleButton,
Schedule_For_Later_Button: commonScheduleButton,
Save_Button: commonRunSaveButton,
Run_Button: commonRunSaveButton,
Run_Name_Input: inputGroup(
generateInputGroup(
'.form-row .form-field-input .form-field__wrapper',
Expand Down Expand Up @@ -742,9 +815,33 @@ module.exports = {
Resources_Node_Selector_Table: commonTable(resourcesNodeSelectorTable)
},
Accordion_Subheader: By.css('.modal__body .job-wizard__advanced .form-table-title'),
Advanced_Environment_Variables_Table: commonTable(advancedEnvironmentVariablesTable)
},
trainModel:{
Advanced_Environment_Variables_Table: commonTable(advancedEnvironmentVariablesTable),
Hyperparameter_Strategy_Accordion:{
Strategy_Dropdown: dropdownComponent(
generateDropdownGroup(
'.modal__content .modal__body .job-wizard__hyperparameter-strategy .strategy-grid-item',
'.form-field-select .form-field__wrapper-normal',
'.options-list__body .select__item-label',
'.data-ellipsis'
)
),
Max_Iterations: inputGroup(
generateInputGroup(
'.modal__content .modal__body .wizard-form__content .max-iterations-grid-item .form-field__wrapper-normal',
true,
true,
false
)
),
Max_Errors: inputGroup(
generateInputGroup(
'.modal__content .modal__body .wizard-form__content .max-errors-grid-item .form-field__wrapper-normal',
true,
true,
false
)
)
},
Ranking_Subheader: By.css('.job-wizard__hyperparameter-strategy .ranking-title-grid-item'),
Ranking_Result_Input: inputGroup(
generateInputGroup(
Expand Down Expand Up @@ -1153,5 +1250,42 @@ module.exports = {
notificationPopUp: {
Notification_Pop_Up: By.css('.notification_container .notification_body'),
Notification_Pop_Up_Cross_Close_Button: By.css('.notification_container .notification_body_close_icon')
},
schedulePopUp: {
Schedule_For_Later: {
Schedule_Button: By.css('.schedule-wizard .modal__footer-actions .btn-secondary'),
Time_unit_Dropdown: dropdownComponent(
generateDropdownGroup(
'.simple-schedule-item .form-field-select .form-field__wrapper',
'.form-field__control .form-field__select',
'.options-list__body .select__item',
'.data-ellipsis .data-ellipsis'
)
),
Intervals_Dropdown: dropdownComponent(
generateDropdownGroup(
'.simple-schedule-item:nth-of-type(2) .form-field-select .form-field__wrapper',
'.form-field__control .form-field__select',
'.options-list__body .select__item',
'.data-ellipsis .data-ellipsis'
)
),
At_time_Input: numberInputGroup(
generateNumberInputGroup(
'.form-col-1 .time-picker-container .time-picker__control',
false,
true,
false
)
),
Schedule_item_Sunday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(1)'),
Schedule_item_Monday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(2)'),
Schedule_item_Tuesday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(3)'),
Schedule_item_Wednesday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(4)'),
Schedule_item_Thursday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(5)'),
Schedule_item_Friday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(6)'),
Schedule_item_Saturday: By.css('.simple-schedule-item .schedule-repeat-week .schedule-repeat-week_day:nth-of-type(7)'),
Error_Message: By.css('.schedule-content .error')
}
}
}
48 changes: 10 additions & 38 deletions tests/features/common/page-objects/jobs-and-workflows.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,6 @@ const batchTabSelector = {
}
}

const functionsTableSelector = {
root: '.form .functions-list',
header: {},
body: {
row: {
root: '.job-card-template',
fields: {
name:
'.job-card-template__header > div:first-child',
sub_name:
'.job-card-template__header .job-card-template__sub-header .data-ellipsis',
description:
'.job-card-template__description',
labels: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.job-card-template__chips input',
'.chip-block span.chips_button',
'.chip-block .data-ellipsis.tooltip-wrapper .edit-chip-container',
false,
true
)
}
}
}
}
}

const checkboxCategorySelector = {
root: '.hub-filter .categories-list',
header: {},
Expand Down Expand Up @@ -174,7 +146,7 @@ const BatchRunDataInputsTable = {
path_dropdown: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(2) .form-field-combobox',
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field__icons:nth-of-type(1)',
'.form-field-combobox__dropdown-list-option',
false,
Expand All @@ -183,7 +155,7 @@ const BatchRunDataInputsTable = {
path_dropdown_autocomplete_artifacts: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(2) .form-field-combobox',
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
Expand All @@ -192,7 +164,7 @@ const BatchRunDataInputsTable = {
path_dropdown_autocomplete_project: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(2) .form-field-combobox',
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
Expand All @@ -201,14 +173,14 @@ const BatchRunDataInputsTable = {
path_dropdown_autocomplete_item: {
componentType: dropdownComponent,
structure: generateDropdownGroup(
'.form-table__cell_1:nth-of-type(2) .form-field-combobox',
'.form-table__cell_1:nth-of-type(3) .form-field-combobox',
'.form-field-combobox__input',
'.form-field-combobox__dropdown-list-option',
false,
false)
},
path_input: 'input.form-field-combobox__input',
path_verify: '.form-table__cell_1:nth-of-type(2)'
path_verify: '.form-table__cell_1:nth-of-type(3)'
}
}
}
Expand Down Expand Up @@ -723,9 +695,9 @@ module.exports = {
Batch_Run_Header: By.css(
'.modal .modal__content h5.modal__header-title'
),
Function_Title: By.css(
'.modal .modal__content h6.modal__header-sub-title'
),
// Function_Title: By.css( TODO: delete when finish batch-run common wizard
// '.modal .modal__content h6.modal__header-sub-title'
// ),
Cross_Close_Button: By.css(
'.modal .modal__header-button .round-icon-cp'
),
Expand Down Expand Up @@ -763,7 +735,7 @@ module.exports = {
Apply_Button: By.css('.hub-filter .filters-wizard__modal-buttons .btn-secondary')
},
Filter_Button_Hub_Tab: By.css('.hub-tab .form-row .filters-button button'),
Functions_Table: commonTable(functionsTableSelector),
//Functions_Table: commonTable(functionsTableSelector), TODO: delete when finish batch-run common wizard
Overlay: By.css('#overlay_container .chip-block-hidden .chip-block-hidden__scrollable-container'),
Back_Button: By.css('.modal__content [data-testid="wizard-btn-back"]'),
Next_Button: By.css('.modal__content [data-testid="wizard-btn-next"]'),
Expand Down Expand Up @@ -822,7 +794,7 @@ module.exports = {
),
Delete_Button_Parameters: By.css('.form-table__parameter-row .form-table__actions-cell .round-icon-cp:nth-of-type(2)'),
Run_Button: By.css('.modal__content [data-testid="run-btn"]'),
Schedule_for_later_Button: By.css('.modal__content [data-testid="schedule-btn"]'),
//Schedule_for_later_Button: By.css('.modal__content [data-testid="schedule-btn"]'), TODO: delete when finish batch-run common wizard
},
CreateJob: {
Back_Arrow_Button: By.css(
Expand Down
4 changes: 2 additions & 2 deletions tests/features/common/page-objects/project.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const projectDashboardRealtimeFunctionsTable = {
}

const projectJobsAndWorkflows = {
root: '.project-data-card:nth-of-type(1) .project-data-card__table',
root: '.main-info__statistics-section:nth-of-type(4) .project-data-card:nth-of-type(1)',
header: {
root: '.project-data-card__table-header',
sorters: {
Expand Down Expand Up @@ -345,7 +345,7 @@ const commonAccessKeyInput = inputGroup(
module.exports = {
project: {
Create_New: createNewObject,
Refresh_Button: By.css('.main-info__toolbar .refresh button[id=refresh]'),
Refresh_Button: By.css('.main-info__toolbar [data-testid="refresh"]'),
Dashboard_Realtime_Functions_Table: commonTable(
projectDashboardRealtimeFunctionsTable
),
Expand Down
2 changes: 1 addition & 1 deletion tests/features/common/page-objects/projects.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = {
Projects_Sort_Dropdown: dropdownComponent(
generateDropdownGroup(
'.projects-content-header-item .sort .split-btn__button:nth-of-type(2)',
'button .tooltip-wrapper svg', // Open Component
'button svg', // Open Component
'.select__item', // Options
'.data-ellipsis > .tooltip-wrapper' // Option value
)
Expand Down
Loading

0 comments on commit 7cfcb73

Please sign in to comment.