From 406cce148a745b3258eb0a44b132d3b030cbb920 Mon Sep 17 00:00:00 2001 From: Wojciech Duda <69160975+wojd0@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:07:09 +0200 Subject: [PATCH] [MIGRATION] - change selector for expanded expansion panel content --- .../core/pages/material/material-locators.ts | 3 +- ...dit-process-filter-cloud-component.page.ts | 25 ++++++++++++----- .../edit-task-filter-cloud-component.page.ts | 28 +++++++++++++------ 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts b/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts index b069b5da21..4c82396245 100644 --- a/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts +++ b/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts @@ -212,7 +212,8 @@ export const materialLocators = { class: '.mat-expansion-panel-header', root: 'mat-expansion-panel-header' }, - title: '.mat-expansion-panel-header-title' + title: '.mat-expansion-panel-header-title', + expanded: '.mat-expanded' }, indicator: '.mat-expansion-indicator' }, diff --git a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts index dc7fa34fdc..e44d7bfbc6 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts @@ -36,7 +36,6 @@ export interface FilterProps { } export class EditProcessFilterCloudComponentPage { - rootElement = $$('adf-cloud-edit-process-filter').first(); customiseFilter = $('#adf-edit-process-filter-sub-title-id'); saveButton = $('button[data-automation-id="adf-filter-action-save"]'); @@ -48,17 +47,29 @@ export class EditProcessFilterCloudComponentPage { statusDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-status']`)); sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-sort']`)); orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-order']`)); - processDefinitionNameDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-processDefinitionName']`)); - suspendedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-suspendedDateRange']`)); - startedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-startedDateRange']`)); - completedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-completedDateRange']`)); - suspendedDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-suspendedDateRange']`)); + processDefinitionNameDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-processDefinitionName']`) + ); + suspendedDateRangeDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-suspendedDateRange']`) + ); + startedDateRangeDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-startedDateRange']`) + ); + completedDateRangeDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-completedDateRange']`) + ); + suspendedDateRangeWithin = new DatePickerPage( + $(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-suspendedDateRange']`) + ); peopleCloudComponent = new PeopleCloudComponentPage(); editProcessFilterDialogPage = new EditProcessFilterDialogPage(); private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`); - private content = TestElement.byCss(`adf-cloud-edit-process-filter ${materialLocators.Expansion.panel.root} [style*="visible"]`); + private content = TestElement.byCss( + `adf-cloud-edit-process-filter ${materialLocators.Expansion.panel.root}${materialLocators.Expansion.panel.expanded} ${materialLocators.Expansion.panel.content.class}` + ); editProcessFilterDialog(): EditProcessFilterDialogPage { return this.editProcessFilterDialogPage; diff --git a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts index a0b2d1502a..0437b0ae8e 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-task-filter-cloud-component.page.ts @@ -28,7 +28,6 @@ import { materialLocators } from '../../public-api'; export type StatusType = 'All' | 'Created' | 'Assigned' | 'Cancelled' | 'Suspended' | 'Completed'; export class EditTaskFilterCloudComponentPage { - rootElement = $$('adf-cloud-edit-task-filter').first(); customiseFilter = $('#adf-edit-task-filter-sub-title-id'); assignee = $('input[data-automation-id="adf-cloud-edit-task-property-assignee"]'); @@ -51,21 +50,33 @@ export class EditTaskFilterCloudComponentPage { sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-sort']`)); priorityDropdown = new DropdownPage(this.priority); orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-order']`)); - completedDateDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-process-property-completedDateRange"]`)); + completedDateDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-process-property-completedDateRange"]`) + ); assignmentDropdown = new DropdownPage($(`.adf-task-assignment-filter`)); - processDefinitionNameDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-task-property-processDefinitionName"]`)); - createdDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-createdDateRange']`)); - createdDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-createdDateRange']`)); + processDefinitionNameDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-task-property-processDefinitionName"]`) + ); + createdDateRangeDropdown = new DropdownPage( + $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-createdDateRange']`) + ); + createdDateRangeWithin = new DatePickerPage( + $(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-createdDateRange']`) + ); dueDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-dueDateRange']`)); - dueDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-picker-date-range-dueDateRange']`)); + dueDateRangeWithin = new DatePickerPage( + $(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-picker-date-range-dueDateRange']`) + ); peopleCloudComponent = new PeopleCloudComponentPage(); groupCloudComponent = new GroupCloudComponentPage(); - dataTable = new DataTableComponentPage( $('adf-cloud-task-list')); + dataTable = new DataTableComponentPage($('adf-cloud-task-list')); private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`); - private content = this.rootElement.$(`div${materialLocators.Expansion.panel.content.class}[style*="visible"]`); + private content = this.rootElement.$( + `${materialLocators.Expansion.panel.root}${materialLocators.Expansion.panel.expanded} ${materialLocators.Expansion.panel.content.class}` + ); async isFilterDisplayed(): Promise { return BrowserVisibility.waitUntilElementIsVisible(this.filter); @@ -307,5 +318,4 @@ export class EditTaskFilterCloudComponentPage { async getProcessInstanceId(): Promise { return BrowserActions.getInputValue(this.processInstanceId); } - }