From 8f68899ce05c1580651f9c95ecefcbafa9adef12 Mon Sep 17 00:00:00 2001 From: davidcanonieto Date: Mon, 27 Apr 2020 00:09:52 +0100 Subject: [PATCH] [ADF-4900] Card View and Metadata Components refactoring (#5592) * [ADF-4900] Card View and Metadata Components refactoring * CSS linting * Unit test excluded * Rebase branch * Fix unit tests * Fix linting * Fix e2e tests * Fix 2e2 tests * Fix process-services e2e tests * More fixes * Fix more e2e tests * Fix unit test * Improve flaky unit test * Fix process services e2e tests * Update Process Header Cloud Page * Fix linting * Fix timing issue * Lintintg * Fix selectors * Fix e2e tests * Fix timing issue * Fix C260328 * Fix spellcheck * save screenshot * performance issue * Fix unit tests and e2e tests * fix e2e * refactoring * fix lint * fix e2e * Fix C309698 * fix other e2e * fix lint * increase timeout Co-authored-by: Eugenio Romano --- .../card-view/card-view.component.html | 2 +- .../card-view/card-view.component.ts | 62 +- .../file-view/file-view.component.html | 4 +- .../metadata/metadata-smoke-tests.e2e.ts | 56 +- .../permissions/permissions-component.e2e.ts | 6 - .../permissions/site-permissions.e2e.ts | 6 +- e2e/pages/adf/card-view-component.page.ts | 4 - e2e/pages/adf/metadata-view.page.ts | 81 ++- .../process-services/process-details.page.ts | 24 +- .../adf/process-services/task-details.page.ts | 83 ++- .../edit-task-filters-component.e2e.ts | 38 +- .../form-field/dropdown-widget.e2e.ts | 4 +- ...cess-task-attach-content-file-cloud.e2e.ts | 2 +- .../start-task-form-cloud.e2e.ts | 6 +- .../start-task-custom-app-cloud.e2e.ts | 2 +- .../task-filters-cloud.e2e.ts | 8 +- .../task-form-cloud-component-tab.e2e.ts | 32 +- .../task-form-cloud-component.e2e.ts | 26 +- .../task-header-cloud.e2e.ts | 13 +- .../task-list-cloud-action-menu.e2e.ts | 2 +- .../task-list-properties-sort.e2e.ts | 2 +- .../task-list-properties.e2e.ts | 66 +- .../task-list-selection.e2e.ts | 2 +- e2e/process-services/info-drawer.e2e.ts | 46 +- e2e/process-services/task-details.e2e.ts | 2 - .../widgets/people-group-widget.e2e.ts | 3 +- .../content-metadata.component.html | 31 +- .../content-metadata.component.scss | 8 +- .../content-metadata.component.spec.ts | 113 ++-- .../content-metadata.component.ts | 69 +- lib/core/card-view/card-view.module.scss | 2 + lib/core/card-view/card-view.module.ts | 4 +- .../card-view-arrayitem.component.scss | 2 + .../card-view-boolitem.component.html | 15 +- .../card-view-dateitem.component.html | 8 +- .../card-view-dateitem.component.scss | 4 + ...card-view-keyvaluepairsitem.component.html | 54 +- ...card-view-keyvaluepairsitem.component.scss | 50 +- .../card-view-mapitem.component.html | 23 +- .../card-view-mapitem.component.scss | 4 + .../card-view-selectitem.component.html | 26 +- .../card-view-selectitem.component.scss | 10 + .../card-view-textitem.component.html | 257 ++++---- .../card-view-textitem.component.scss | 50 +- .../card-view-textitem.component.spec.ts | 622 ++++++++---------- .../card-view-textitem.component.ts | 114 ++-- .../card-view/card-view.component.scss | 32 +- .../card-view/card-view.component.spec.ts | 10 +- .../models/card-view-floatitem.model.ts | 1 + .../models/card-view-intitem.model.ts | 1 + .../models/card-view-textitem.model.ts | 1 + .../process-header-cloud.component.spec.ts | 36 +- .../task-header-cloud.component.spec.ts | 91 ++- .../process-instance-header.component.spec.ts | 50 +- .../components/task-header.component.spec.ts | 14 +- .../card-view/card-view-text-item.page.ts | 26 +- .../src/lib/core/utils/browser-actions.ts | 12 +- .../edit-task-filter-cloud-component.page.ts | 2 +- .../process-header-cloud-component.page.ts | 28 +- .../pages/start-tasks-cloud-component.page.ts | 4 - .../task-filters-cloud-component.page.ts | 46 +- .../pages/task-form-cloud-component.page.ts | 3 +- .../pages/task-header-cloud-component.page.ts | 16 +- package.json | 2 +- .../travis/e2e/process-services-cloud-e2e.sh | 2 +- 65 files changed, 1211 insertions(+), 1214 deletions(-) diff --git a/demo-shell/src/app/components/card-view/card-view.component.html b/demo-shell/src/app/components/card-view/card-view.component.html index 672afa20c8..6d152113db 100644 --- a/demo-shell/src/app/components/card-view/card-view.component.html +++ b/demo-shell/src/app/components/card-view/card-view.component.html @@ -4,7 +4,7 @@ diff --git a/demo-shell/src/app/components/card-view/card-view.component.ts b/demo-shell/src/app/components/card-view/card-view.component.ts index a7175a26f8..6d2d8d2eba 100644 --- a/demo-shell/src/app/components/card-view/card-view.component.ts +++ b/demo-shell/src/app/components/card-view/card-view.component.ts @@ -78,8 +78,43 @@ export class CardViewComponent implements OnInit, OnDestroy { value: 'Spock', key: 'name', default: 'default bar', + editable: this.isEditable + }), + new CardViewTextItemModel({ + label: 'CardView Text Item - Protected value', + value: 'Spock', + key: 'name', + default: 'default bar', multiline: false, icon: 'icon', + editable: false + }), + new CardViewTextItemModel({ + label: 'CardView Text Item - Multiline', + value: 'Spock', + key: 'name', + default: 'default bar', + multiline: true, + icon: 'icon', + editable: this.isEditable + }), + new CardViewTextItemModel({ + label: 'CardView Text Item - Default Value', + value: '', + key: 'name', + default: 'default bar', + multiline: false, + icon: 'icon', + editable: this.isEditable + }), + new CardViewTextItemModel({ + label: 'CardView Text Item - Multivalue (chips)', + value: [1, 2, 3], + key: 'name', + default: 'default bar', + multiline: true, + multivalued: true, + icon: 'icon', editable: this.isEditable }), new CardViewDateItemModel({ @@ -105,6 +140,13 @@ export class CardViewComponent implements OnInit, OnDestroy { default: false, editable: this.isEditable }), + new CardViewBoolItemModel({ + label: 'Agree to all terms and conditions', + value: true, + key: 'boolean', + default: false, + editable: this.isEditable + }), new CardViewIntItemModel({ label: 'CardView Int Item', value: 213, @@ -118,14 +160,20 @@ export class CardViewComponent implements OnInit, OnDestroy { key: 'float', default: 0.0, editable: this.isEditable, - pipes: [{ pipe: this.decimalNumberPipe}] + pipes: [{ pipe: this.decimalNumberPipe }] }), new CardViewKeyValuePairsItemModel({ label: 'CardView Key-Value Pairs Item', - value: [], + value: [{ name: 'hey', value: 'you' }, { name: 'hey', value: 'you' }], key: 'key-value-pairs', editable: this.isEditable }), + new CardViewKeyValuePairsItemModel({ + label: 'CardView Key-Value Pairs Item', + value: [{ name: 'hey', value: 'you' }, { name: 'hey', value: 'you' }], + key: 'key-value-pairs', + editable: false + }), new CardViewSelectItemModel({ label: 'CardView Select Item', value: 'one', @@ -146,6 +194,7 @@ export class CardViewComponent implements OnInit, OnDestroy { default: 'click here', editable: this.isEditable, clickable: true, + icon: 'close', clickCallBack: () => { this.respondToCardClick(); } @@ -154,14 +203,15 @@ export class CardViewComponent implements OnInit, OnDestroy { label: 'CardView Array of items', value: of([ { icon: 'directions_bike', value: 'Zlatan' }, - { icon: 'directions_bike', value: 'Lionel Messi'}, - { value: 'Mohamed', directions_bike: 'save'}, - { value: 'Ronaldo'} + { icon: 'directions_bike', value: 'Lionel Messi' }, + { value: 'Mohamed', directions_bike: 'save' }, + { value: 'Ronaldo' } ]), key: 'array', icon: 'edit', default: 'Empty', - noOfItemsToDisplay: 2 + noOfItemsToDisplay: 2, + editable: this.isEditable }) ]; } diff --git a/demo-shell/src/app/components/file-view/file-view.component.html b/demo-shell/src/app/components/file-view/file-view.component.html index afbe02014a..0c0214f5e9 100644 --- a/demo-shell/src/app/components/file-view/file-view.component.html +++ b/demo-shell/src/app/components/file-view/file-view.component.html @@ -49,7 +49,7 @@ [color]="'primary'" (change)="toggleMulti()" [checked]="multi"> - multi accordion + Multi accordion

@@ -59,7 +59,7 @@ [color]="'primary'" (change)="toggleReadOnly()" [checked]="isReadOnly"> - Editable + Read Only

diff --git a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts index b9ea9c27fa..772cbfaea6 100644 --- a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts +++ b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts @@ -76,7 +76,7 @@ describe('Metadata component', () => { const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-'); Object.assign(pngFileModel, pngUploadedFile.entry); pngFileModel.update(pngUploadedFile.entry); - }); + }); afterAll(async () => { await navigationBarPage.clickLogoutButton(); @@ -171,28 +171,18 @@ describe('Metadata component', () => { await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit'); await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit'); - await metadataViewPage.clickEditPropertyIcons('name'); - await metadataViewPage.updatePropertyIconIsDisplayed('name'); - await metadataViewPage.clearPropertyIconIsDisplayed('name'); - await metadataViewPage.enterPropertyText('name', 'exampleText'); - await metadataViewPage.clickClearPropertyIcon('name'); + await metadataViewPage.clickResetMetadata(); await expect(await metadataViewPage.getPropertyText('name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name); - await metadataViewPage.clickEditPropertyIcons('name'); await metadataViewPage.enterPropertyText('name', 'exampleText.png'); - await metadataViewPage.clickUpdatePropertyIcon('name'); - await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png'); - - await metadataViewPage.clickEditPropertyIcons('properties.cm:title'); await metadataViewPage.enterPropertyText('properties.cm:title', 'example title'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title'); - await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title'); - - await metadataViewPage.clickEditPropertyIcons('properties.cm:description'); await metadataViewPage.enterDescriptionText('example description'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description'); + + await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png'); + await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title'); await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description'); + await metadataViewPage.clickSaveMetadata(); await viewerPage.clickCloseButton(); await contentServicesPage.waitForTableBody(); @@ -208,10 +198,9 @@ describe('Metadata component', () => { await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description'); await metadataViewPage.editIconClick(); - await metadataViewPage.clickEditPropertyIcons('name'); await metadataViewPage.enterPropertyText('name', browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name); - await metadataViewPage.clickUpdatePropertyIcon('name'); await expect(await metadataViewPage.getPropertyText('name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name); + await metadataViewPage.clickSaveMetadata(); }); it('[C260181] Should be possible edit all the metadata aspect', async () => { @@ -228,22 +217,16 @@ describe('Metadata component', () => { await metadataViewPage.editIconClick(); - await metadataViewPage.clickEditPropertyIcons('properties.exif:software'); await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software'); - await metadataViewPage.clickUpdatePropertyIcon('properties.exif:software'); - await expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software'); - - await metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings'); await metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings'); - await metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings'); - await expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings'); - - await metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber'); await metadataViewPage.enterPropertyText('properties.exif:fNumber', 22); - await metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber'); + await metadataViewPage.clickSaveMetadata(); + + await expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings'); + await expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software'); await expect(await metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22'); }); - }); + }); describe('Folder metadata', () => { @@ -253,7 +236,6 @@ describe('Metadata component', () => { await loginPage.loginToContentServicesUsingUserModel(acsUser); await navigationBarPage.clickContentServicesButton(); await contentServicesPage.waitForTableBody(); - }); it('[C261157] Should be possible use the metadata component When the node is a Folder', async () => { @@ -269,22 +251,19 @@ describe('Metadata component', () => { await metadataViewPage.editIconClick(); - await metadataViewPage.clickEditPropertyIcons('name'); await metadataViewPage.enterPropertyText('name', 'newnameFolder'); - await metadataViewPage.clickClearPropertyIcon('name'); + await metadataViewPage.clickResetButton(); await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName); - await metadataViewPage.clickEditPropertyIcons('name'); await metadataViewPage.enterPropertyText('name', 'newnameFolder'); - await metadataViewPage.clickUpdatePropertyIcon('name'); + await metadataViewPage.clickSaveMetadata(); await expect(await metadataViewPage.getPropertyText('name')).toEqual('newnameFolder'); - await metadataViewPage.clickEditPropertyIcons('name'); await metadataViewPage.enterPropertyText('name', folderName); - await metadataViewPage.clickUpdatePropertyIcon('name'); + await metadataViewPage.clickSaveMetadata(); await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName); }); - }); + }); it('[C279960] Should show the last username modifier when modify a File', async () => { await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); @@ -300,9 +279,8 @@ describe('Metadata component', () => { await metadataViewPage.editIconClick(); - await metadataViewPage.clickEditPropertyIcons('properties.cm:description'); await metadataViewPage.enterDescriptionText('check author example description'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description'); + await metadataViewPage.clickSaveMetadata(); await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description'); await loginPage.loginToContentServicesUsingUserModel(acsUser); diff --git a/e2e/content-services/permissions/permissions-component.e2e.ts b/e2e/content-services/permissions/permissions-component.e2e.ts index ac1784a0ab..dec6cae197 100644 --- a/e2e/content-services/permissions/permissions-component.e2e.ts +++ b/e2e/content-services/permissions/permissions-component.e2e.ts @@ -359,9 +359,7 @@ describe('Permissions Component', () => { await metadataViewPage.editIconIsDisplayed(); await metadataViewPage.editIconClick(); await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title'); - await metadataViewPage.clickEditPropertyIcons('properties.cm:title'); await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle1'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title'); await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1'); await metadataViewPage.clickCloseButton(); await contentServicesPage.uploadFile(fileLocation); @@ -383,9 +381,7 @@ describe('Permissions Component', () => { await metadataViewPage.editIconIsDisplayed(); await metadataViewPage.editIconClick(); await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title'); - await metadataViewPage.clickEditPropertyIcons('properties.cm:title'); await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle2'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title'); await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle2'); await metadataViewPage.clickCloseButton(); await contentServicesPage.uploadFile(testFileModel.location); @@ -407,9 +403,7 @@ describe('Permissions Component', () => { await metadataViewPage.editIconIsDisplayed(); await metadataViewPage.editIconClick(); await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title'); - await metadataViewPage.clickEditPropertyIcons('properties.cm:title'); await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle3'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title'); await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle3'); await metadataViewPage.clickCloseButton(); await contentServicesPage.uploadFile(pngFileModel.location); diff --git a/e2e/content-services/permissions/site-permissions.e2e.ts b/e2e/content-services/permissions/site-permissions.e2e.ts index 0659b9e932..53c35cc22e 100644 --- a/e2e/content-services/permissions/site-permissions.e2e.ts +++ b/e2e/content-services/permissions/site-permissions.e2e.ts @@ -287,10 +287,8 @@ describe('Permissions Component', () => { await metadataViewPage.editIconClick(); await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title'); - await metadataViewPage.clickEditPropertyIcons('properties.cm:title'); await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle'); - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title'); await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle'); await metadataViewPage.clickCloseButton(); @@ -321,10 +319,8 @@ describe('Permissions Component', () => { await metadataViewPage.editIconClick(); await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description'); - await metadataViewPage.clickEditPropertyIcons('properties.cm:description'); await metadataViewPage.enterDescriptionText('newDescription'); - - await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description'); + await metadataViewPage.clickSaveMetadata(); await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription'); diff --git a/e2e/pages/adf/card-view-component.page.ts b/e2e/pages/adf/card-view-component.page.ts index 88a8f480cd..e07cb9a72d 100644 --- a/e2e/pages/adf/card-view-component.page.ts +++ b/e2e/pages/adf/card-view-component.page.ts @@ -49,10 +49,6 @@ export class CardViewComponentPage { return this.nameCardTextItem.getFieldValue(); } - async clickOnNameTextField(): Promise { - await this.nameCardTextItem.clickOnToggleTextField(); - } - async enterNameTextField(text: string): Promise { await this.nameCardTextItem.enterTextField(text); } diff --git a/e2e/pages/adf/metadata-view.page.ts b/e2e/pages/adf/metadata-view.page.ts index 0d6514c0b9..316424c8f6 100644 --- a/e2e/pages/adf/metadata-view.page.ts +++ b/e2e/pages/adf/metadata-view.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, element, ElementFinder } from 'protractor'; +import { by, element, ElementFinder, Key, protractor } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class MetadataViewPage { @@ -23,15 +23,15 @@ export class MetadataViewPage { title: ElementFinder = element(by.css(`div[info-drawer-title]`)); expandedAspect: ElementFinder = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`)); aspectTitle = by.css(`mat-panel-title`); - name: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-name'] span`)); - creator: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-createdByUser.displayName'] span`)); + name: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-name']`)); + creator: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`)); createdDate: ElementFinder = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`)); - modifier: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-modifiedByUser.displayName'] span`)); + modifier: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`)); modifiedDate: ElementFinder = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt'] span`)); - mimetypeName: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-content.mimeTypeName']`)); - size: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-content.sizeInBytes']`)); - description: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description'] span`)); - author: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:author'] span`)); + mimetypeName: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-content.mimeTypeName']`)); + size: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-content.sizeInBytes']`)); + description: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description']`)); + author: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:author']`)); titleProperty: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`)); editIcon: ElementFinder = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`)); informationButton: ElementFinder = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`)); @@ -45,6 +45,8 @@ export class MetadataViewPage { closeButton: ElementFinder = element(by.cssContainingText('button.mat-button span', 'Close')); displayAspect: ElementFinder = element(by.css(`input[placeholder='Display Aspect']`)); applyAspect: ElementFinder = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect')); + saveMetadataButton: ElementFinder = element(by.css(`[data-automation-id='save-metadata']`)); + resetMetadataButton: ElementFinder = element(by.css(`[data-automation-id='reset-metadata']`)); async getTitle(): Promise { return BrowserActions.getText(this.title); @@ -55,11 +57,11 @@ export class MetadataViewPage { } async getName(): Promise { - return BrowserActions.getText(this.name); + return BrowserActions.getInputValue(this.name); } async getCreator(): Promise { - return BrowserActions.getText(this.creator); + return BrowserActions.getInputValue(this.creator); } async getCreatedDate(): Promise { @@ -67,7 +69,7 @@ export class MetadataViewPage { } async getModifier(): Promise { - return BrowserActions.getText(this.modifier); + return BrowserActions.getInputValue(this.modifier); } async getModifiedDate(): Promise { @@ -75,19 +77,19 @@ export class MetadataViewPage { } async getMimetypeName(): Promise { - return BrowserActions.getText(this.mimetypeName); + return BrowserActions.getInputValue(this.mimetypeName); } async getSize(): Promise { - return BrowserActions.getText(this.size); + return BrowserActions.getInputValue(this.size); } async getDescription(): Promise { - return BrowserActions.getText(this.description); + return BrowserActions.getInputValue(this.description); } async getAuthor(): Promise { - return BrowserActions.getText(this.author); + return BrowserActions.getInputValue(this.author); } async getTitleProperty(): Promise { @@ -136,61 +138,44 @@ export class MetadataViewPage { } async editPropertyIconIsDisplayed(propertyName: string) { - const editPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); + const editPropertyIcon: ElementFinder = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon')); await BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon); } - async updatePropertyIconIsDisplayed(propertyName: string) { - const updatePropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-update-' + propertyName + '"]')); - await BrowserVisibility.waitUntilElementIsVisible(updatePropertyIcon); - } - - async clickUpdatePropertyIcon(propertyName: string): Promise { - const updatePropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-update-' + propertyName + '"]')); - await BrowserActions.click(updatePropertyIcon); - } - - async clickClearPropertyIcon(propertyName: string): Promise { - const clearPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-reset-' + propertyName + '"]')); + async clickResetButton(): Promise { + const clearPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="reset-metadata"]')); await BrowserActions.click(clearPropertyIcon); } async enterPropertyText(propertyName: string, text: string | number): Promise { - const textField: ElementFinder = element(by.css('input[data-automation-id="card-textitem-editinput-' + propertyName + '"]')); + const textField: ElementFinder = element(by.css('input[data-automation-id="card-textitem-value-' + propertyName + '"]')); await BrowserActions.clearSendKeys(textField, text.toString()); + await textField.sendKeys(protractor.Key.ENTER); } async enterPresetText(text: string): Promise { const presetField: ElementFinder = element(by.css('input[data-automation-id="adf-text-custom-preset"]')); - await BrowserActions.clearSendKeys(presetField, text); + await BrowserActions.clearSendKeys(presetField, text.toString()); + await presetField.sendKeys(protractor.Key.ENTER); const applyButton: ElementFinder = element(by.css('button[id="adf-metadata-aplly"]')); await BrowserActions.click(applyButton); } async enterDescriptionText(text: string): Promise { - const textField: ElementFinder = element(by.css('textarea[data-automation-id="card-textitem-edittextarea-properties.cm:description"]')); + const textField: ElementFinder = element(by.css('textarea[data-automation-id="card-textitem-value-properties.cm:description"]')); await BrowserActions.clearSendKeys(textField, text); + await textField.sendKeys(Key.TAB); } async getPropertyText(propertyName: string, type?: string): Promise { const propertyType = type || 'textitem'; - const textField: ElementFinder = element(by.css('span[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]')); + const textField: ElementFinder = element(by.css('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]')); - return BrowserActions.getText(textField); - } - - async clearPropertyIconIsDisplayed(propertyName: string): Promise { - const clearPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-reset-' + propertyName + '"]')); - await BrowserVisibility.waitUntilElementIsVisible(clearPropertyIcon); - } - - async clickEditPropertyIcons(propertyName: string): Promise { - const editPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); - await BrowserActions.click(editPropertyIcon); + return BrowserActions.getInputValue(textField); } async getPropertyIconTooltip(propertyName: string): Promise { - const editPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); + const editPropertyIcon: ElementFinder = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon')); return editPropertyIcon.getAttribute('title'); } @@ -247,4 +232,12 @@ export class MetadataViewPage { async clickApplyAspect(): Promise { await BrowserActions.click(this.applyAspect); } + + async clickSaveMetadata(): Promise { + await BrowserActions.click(this.saveMetadataButton); + } + + async clickResetMetadata(): Promise { + await BrowserActions.click(this.resetMetadataButton); + } } diff --git a/e2e/pages/adf/process-services/process-details.page.ts b/e2e/pages/adf/process-services/process-details.page.ts index a6417050d3..4c0561253b 100644 --- a/e2e/pages/adf/process-services/process-details.page.ts +++ b/e2e/pages/adf/process-services/process-details.page.ts @@ -21,14 +21,14 @@ import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class ProcessDetailsPage { processTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title"]')); processDetailsMessage: ElementFinder = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]')); - processStatusField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-status"]')); + processStatusField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-status"]')); processEndDateField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-ended"]')); - processCategoryField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-category"]')); - processBusinessKeyField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-businessKey"]')); - processCreatedByField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-assignee"]')); + processCategoryField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-category"]')); + processBusinessKeyField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-businessKey"]')); + processCreatedByField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-assignee"]')); processCreatedField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-created"]')); - processIdField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-id"]')); - processDescription: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-description"]')); + processIdField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-id"]')); + processDescription: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-description"]')); showDiagramButtonDisabled: ElementFinder = element(by.css('button[id="show-diagram-button"][disabled]')); propertiesList: ElementFinder = element(by.css('div[class="adf-property-list"]')); showDiagramButton: ElementFinder = element(by.id('show-diagram-button')); @@ -67,7 +67,7 @@ export class ProcessDetailsPage { } getProcessStatus(): Promise { - return BrowserActions.getText(this.processStatusField); + return BrowserActions.getInputValue(this.processStatusField); } getEndDate(): Promise { @@ -75,15 +75,15 @@ export class ProcessDetailsPage { } getProcessCategory(): Promise { - return BrowserActions.getText(this.processCategoryField); + return BrowserActions.getInputValue(this.processCategoryField); } getBusinessKey(): Promise { - return BrowserActions.getText(this.processBusinessKeyField); + return BrowserActions.getInputValue(this.processBusinessKeyField); } getCreatedBy(): Promise { - return BrowserActions.getText(this.processCreatedByField); + return BrowserActions.getInputValue(this.processCreatedByField); } getCreated(): Promise { @@ -91,11 +91,11 @@ export class ProcessDetailsPage { } getId(): Promise { - return BrowserActions.getText(this.processIdField); + return BrowserActions.getInputValue(this.processIdField); } getProcessDescription(): Promise { - return BrowserActions.getText(this.processDescription); + return BrowserActions.getInputValue(this.processDescription); } async clickShowDiagram(): Promise { diff --git a/e2e/pages/adf/process-services/task-details.page.ts b/e2e/pages/adf/process-services/task-details.page.ts index 4f2947a8ad..61bf087e80 100644 --- a/e2e/pages/adf/process-services/task-details.page.ts +++ b/e2e/pages/adf/process-services/task-details.page.ts @@ -16,7 +16,7 @@ */ import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing'; -import { browser, by, element, ElementFinder } from 'protractor'; +import { browser, by, element, ElementFinder, Key } from 'protractor'; import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page'; export class TaskDetailsPage { @@ -24,18 +24,20 @@ export class TaskDetailsPage { appSettingsTogglesClass = new AppSettingsTogglesPage(); formContent: ElementFinder = element(by.css('adf-form')); - formNameField: ElementFinder = element(by.css('span[data-automation-id*="formName"] span')); - assigneeField: ElementFinder = element(by.css('span[data-automation-id*="assignee"] span')); - statusField: ElementFinder = element(by.css('span[data-automation-id*="status"] span')); - categoryField: ElementFinder = element(by.css('span[data-automation-id*="category"] span')); + formNameField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-formName"]')); + formNameButton: ElementFinder = element(by.css('[data-automation-id="card-textitem-toggle-formName"]')); + assigneeField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-assignee"]')); + assigneeButton: ElementFinder = element(by.css('[data-automation-id="card-textitem-toggle-assignee"]')); + statusField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-status"]')); + categoryField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-category"] ')); parentNameField: ElementFinder = element(by.css('span[data-automation-id*="parentName"] span')); - parentTaskIdField: ElementFinder = element(by.css('span[data-automation-id*="parentTaskId"] span')); - durationField: ElementFinder = element(by.css('span[data-automation-id*="duration"] span')); + parentTaskIdField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-parentTaskId"] ')); + durationField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-duration"] ')); endDateField: ElementFinder = element.all(by.css('span[data-automation-id*="endDate"] span')).first(); createdField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-created"] span')); - idField: ElementFinder = element.all(by.css('span[data-automation-id*="id"] span')).first(); - descriptionField: ElementFinder = element(by.css('span[data-automation-id*="description"] span')); - dueDateField: ElementFinder = element(by.css('span[data-automation-id*="dueDate"] span')); + idField: ElementFinder = element.all(by.css('[data-automation-id="card-textitem-value-id"]')).first(); + descriptionField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-description"]')); + dueDateField: ElementFinder = element.all(by.css('span[data-automation-id*="dueDate"] span')).first(); activitiesTitle: ElementFinder = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div')); commentField: ElementFinder = element(by.id('comment-input')); addCommentButton: ElementFinder = element(by.css('[data-automation-id="comments-input-add"]')); @@ -62,8 +64,8 @@ export class TaskDetailsPage { removeAttachForm: ElementFinder = element(by.id('adf-attach-form-remove-button')); attachFormName: ElementFinder = element(by.css('span[class="adf-form-title ng-star-inserted"]')); emptyTaskDetails: ElementFinder = element(by.css('adf-task-details > div > div')); - priority: ElementFinder = element(by.css('span[data-automation-id*="priority"] span')); - editableAssignee = element(by.css('span[data-automation-id="card-textitem-value-assignee"][class*="clickable"]')); + priority: ElementFinder = element(by.css('[data-automation-id*="card-textitem-value-priority"]')); + editableAssignee = element(by.css('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]')); claimElement = element(by.css('[data-automation-id="header-claim-button"]')); releaseElement = element(by.css('[data-automation-id="header-unclaim-button"]')); saveFormButton = element(by.css('button[id="adf-form-save"]')); @@ -75,20 +77,10 @@ export class TaskDetailsPage { } async checkEditableFormIsNotDisplayed(): Promise { - const editableForm = element(by.css('span[data-automation-id="card-textitem-value-formName"][class*="clickable"]')); + const editableForm = element(by.css('[data-automation-id="card-textitem-value-formName"][class*="clickable"]')); await BrowserVisibility.waitUntilElementIsNotVisible(editableForm); } - async checkEditDescriptionButtonIsNotDisplayed(): Promise { - const editDescriptionButton = element(by.css('button[data-automation-id="card-textitem-edit-icon-description"]')); - await BrowserVisibility.waitUntilElementIsNotVisible(editDescriptionButton); - } - - async checkEditPriorityButtonIsNotDisplayed(): Promise { - const editPriorityButton = element(by.css('button[data-automation-id="card-textitem-edit-icon-priority"]')); - await BrowserVisibility.waitUntilElementIsNotVisible(editPriorityButton); - } - async checkDueDatePickerButtonIsNotDisplayed(): Promise { const dueDatePickerButton = element(by.css('mat-datetimepicker-toggle[data-automation-id="datepickertoggle-dueDate"]')); await BrowserVisibility.waitUntilElementIsNotVisible(dueDatePickerButton); @@ -151,17 +143,17 @@ export class TaskDetailsPage { } async checkFormIsAttached(formName): Promise { - const attachedFormName = await BrowserActions.getText(this.formNameField); + const attachedFormName = await BrowserActions.getInputValue(this.formNameField); await expect(attachedFormName).toEqual(formName); } getFormName(): Promise { - return BrowserActions.getText(this.formNameField); + return BrowserActions.getInputValue(this.formNameField); } async clickForm(): Promise { await BrowserActions.closeMenuAndDialogs(); - await BrowserActions.click(this.formNameField); + await BrowserActions.click(this.formNameButton); } async checkStandaloneNoFormMessageIsDisplayed(): Promise { @@ -173,7 +165,7 @@ export class TaskDetailsPage { } getAssignee(): Promise { - return BrowserActions.getText(this.assigneeField); + return BrowserActions.getInputValue(this.assigneeField); } isAssigneeClickable(): Promise { @@ -181,11 +173,11 @@ export class TaskDetailsPage { } getStatus(): Promise { - return BrowserActions.getText(this.statusField); + return BrowserActions.getInputValue(this.statusField); } getCategory(): Promise { - return BrowserActions.getText(this.categoryField); + return BrowserActions.getInputValue(this.categoryField); } getParentName(): Promise { @@ -193,11 +185,11 @@ export class TaskDetailsPage { } getParentTaskId(): Promise { - return BrowserActions.getText(this.parentTaskIdField); + return BrowserActions.getInputValue(this.parentTaskIdField); } getDuration(): Promise { - return BrowserActions.getText(this.durationField); + return BrowserActions.getInputValue(this.durationField); } getEndDate(): Promise { @@ -209,11 +201,16 @@ export class TaskDetailsPage { } getId(): Promise { - return BrowserActions.getText(this.idField); + return BrowserActions.getInputValue(this.idField); } getDescription(): Promise { - return BrowserActions.getText(this.descriptionField); + return BrowserActions.getInputValue(this.descriptionField); + } + + async getDescriptionPlaceholder(): Promise { + await BrowserVisibility.waitUntilElementIsPresent(this.descriptionField); + return this.descriptionField.getAttribute('placeholder'); } getDueDate(): Promise { @@ -221,32 +218,30 @@ export class TaskDetailsPage { } getPriority(): Promise { - return BrowserActions.getText(this.priority); + return BrowserActions.getInputValue(this.priority); } async updatePriority(priority?: string): Promise { await BrowserActions.click(this.priority); - await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-editinput-priority"]')), priority ? priority : ' '); - await BrowserActions.click(element(by.css('button[data-automation-id="card-textitem-update-priority"]'))); + await BrowserActions.clearWithBackSpace(this.priority); + await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-value-priority"]')), priority ? priority : ' '); + await this.priority.sendKeys(Key.TAB); } async updateDueDate(): Promise { await BrowserActions.click(this.dueDateField); - await BrowserActions.click(element(by.css('.mat-datetimepicker-calendar-body-cell'))); + await BrowserActions.click(element.all(by.css('.mat-datetimepicker-calendar-body-cell')).first()); } async updateDescription(description?: string): Promise { await BrowserActions.click(this.descriptionField); - const input = 'textarea[data-automation-id="card-textitem-edittextarea-description"]'; - await BrowserActions.clearSendKeys(element(by.css(input)), description ? description : ''); - if (!description) { - await browser.executeScript(`document.querySelector('${input}').dispatchEvent(new Event('input'))`); - } - await BrowserActions.click(element(by.css('button[data-automation-id="card-textitem-update-description"]'))); + await BrowserActions.clearWithBackSpace(this.descriptionField); + await BrowserActions.clearSendKeys(element(by.css('[data-automation-id="card-textitem-value-description"]')), description ? description : ''); + await this.descriptionField.sendKeys(Key.TAB); } async updateAssignee(fullName: string): Promise { - await BrowserActions.click(this.assigneeField); + await BrowserActions.click(this.assigneeButton); await BrowserActions.clearSendKeys(element(by.css('[id="userSearchText"]')), fullName); await BrowserActions.click(element(by.cssContainingText('.adf-people-full-name', fullName))); await BrowserActions.click(element(by.css('button[id="add-people"]'))); diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts index d2c6ae562d..53ce515876 100644 --- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts @@ -74,12 +74,12 @@ describe('Edit task filters cloud', () => { }); afterEach(async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); }); it('[C291785] All the filters property should be set up accordingly with the Query Param', async () => { await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('ASSIGNED'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); @@ -87,7 +87,7 @@ describe('Edit task filters cloud', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('COMPLETED'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); @@ -98,9 +98,9 @@ describe('Edit task filters cloud', () => { }); it('[C306896] Delete Save and Save as actions should be displayed when clicking on custom filter header', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); @@ -115,13 +115,13 @@ describe('Edit task filters cloud', () => { }); it('[C291795] New filter is added when clicking Save As button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); @@ -135,7 +135,7 @@ describe('Edit task filters cloud', () => { await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Id'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkSaveAsButtonIsEnabled()).toEqual(false); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkDeleteButtonIsEnabled()).toEqual(true); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Id'); @@ -143,13 +143,13 @@ describe('Edit task filters cloud', () => { }); it('[C291796] Two filters with same name can be created when clicking the Save As button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); @@ -178,13 +178,13 @@ describe('Edit task filters cloud', () => { }); it('[C291797] A filter is overrided when clicking on save button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); const editTaskFilterDialog = await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog(); @@ -204,13 +204,13 @@ describe('Edit task filters cloud', () => { }); it('[C291798] A filter is deleted when clicking on delete button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); await editTaskFilterCloudComponent.setSortFilterDropDown('Id'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton(); const editTaskFilterDialog = await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog(); @@ -227,7 +227,7 @@ describe('Edit task filters cloud', () => { }); it('[C291800] Task filter should not be created when task filter dialog is closed', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); @@ -241,8 +241,8 @@ describe('Edit task filters cloud', () => { await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().clickOnCancelButton(); await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterNotDisplayed('Cancel'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toEqual('My Tasks'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('CreatedDate'); @@ -250,7 +250,7 @@ describe('Edit task filters cloud', () => { }); it('[C291801] Save button of task filter dialog should be disabled when task name is empty', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent(); await editTaskFilterCloudComponent.openFilter(); @@ -272,7 +272,7 @@ describe('Edit task filters cloud', () => { }); it('[C291799] Task filter dialog is displayed when clicking on Save As button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); const tasksCloud = tasksCloudDemoPage.editTaskFilterCloudComponent(); await tasksCloud.openFilter(); await tasksCloud.setSortFilterDropDown('Id'); diff --git a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts index f53982de41..e09446ae70 100644 --- a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts +++ b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts @@ -91,7 +91,7 @@ describe('Form Field Component - Dropdown Widget', () => { }); it('[C290069] Should be able to read rest service dropdown options, save and complete the task form', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(task.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(task.entry.name); await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); @@ -108,7 +108,7 @@ describe('Form Field Component - Dropdown Widget', () => { await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(task.entry.name); await notificationHistoryPage.checkNotifyContains('Task has been saved successfully'); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(task.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(task.entry.name); await taskFormCloudComponent.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts index 0a86dccd84..b643a191d1 100644 --- a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts +++ b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts @@ -127,7 +127,7 @@ describe('Process Task - Attach content file', () => { await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(taskName); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskName); await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters(); diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts index 085ffcd818..d92fa3895c 100644 --- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts @@ -300,7 +300,7 @@ describe('Start Task Form', () => { await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters(); @@ -511,7 +511,7 @@ describe('Start Task Form', () => { await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); await contentFileWidget.checkFileIsAttached(testFileModel.name); @@ -546,7 +546,7 @@ describe('Start Task Form', () => { await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); await contentFileWidget.checkFileIsAttached(testFileModel.name); diff --git a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts index dfe589bfa5..cc953c05b1 100644 --- a/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task/start-task-custom-app-cloud.e2e.ts @@ -194,7 +194,7 @@ describe('Start Task', () => { await browser.driver.sleep(1000); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); }); diff --git a/e2e/process-services-cloud/task-filters-cloud.e2e.ts b/e2e/process-services-cloud/task-filters-cloud.e2e.ts index bcfa681a92..0ac8721fbc 100644 --- a/e2e/process-services-cloud/task-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-filters-cloud.e2e.ts @@ -69,11 +69,11 @@ describe('Task filters cloud', () => { const task = await tasksService.createStandaloneTask(newTask, simpleApp); await tasksService.claimTask(task.entry.id, simpleApp); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(newTask); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(newTask); @@ -86,11 +86,11 @@ describe('Task filters cloud', () => { await tasksService.claimTask(toBeCompletedTask.entry.id, simpleApp); await tasksService.completeTask(toBeCompletedTask.entry.id, simpleApp); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask); diff --git a/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts b/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts index ef87cb9cbc..ac689460dc 100644 --- a/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts +++ b/e2e/process-services-cloud/task-form-cloud-component-tab.e2e.ts @@ -158,7 +158,7 @@ describe('Task form cloud component', () => { describe('Complete task with form - cloud directive', () => { it('[C315174] Should be able to complete a standalone task with visible tab with empty value for field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[0].entry.name); @@ -174,13 +174,11 @@ describe('Task form cloud component', () => { await widget.tab().checkTabIsDisplayedByLabel(tab.tabFieldValue); await taskFormCloudComponent.clickCompleteButton(); - await browser.sleep(1000); - await browser.refresh(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(visibilityConditionTasks[0].entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[0].entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(visibilityConditionTasks[0].entry.name); await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields); @@ -188,7 +186,7 @@ describe('Task form cloud component', () => { }); it('[C315177] Should be able to complete a standalone task with invisible tab with invalid value for field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[1].entry.name); @@ -213,13 +211,11 @@ describe('Task form cloud component', () => { await widget.tab().checkTabIsNotDisplayedByLabel(tab.tabFieldField); await taskFormCloudComponent.clickCompleteButton(); - await browser.sleep(1000); - await browser.refresh(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(visibilityConditionTasks[1].entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[1].entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(visibilityConditionTasks[1].entry.name); await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields); @@ -227,7 +223,7 @@ describe('Task form cloud component', () => { }); it('[C315178] Should be able to complete a standalone task with invisible tab with valid value', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[2].entry.name); @@ -251,14 +247,12 @@ describe('Task form cloud component', () => { await widget.textWidget().setValue(widgets.textOneId, value.notDisplayTab); await widget.tab().checkTabIsNotDisplayedByLabel(tab.tabFieldVar); await taskFormCloudComponent.clickCompleteButton(); - await browser.sleep(1000); - await browser.refresh(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(visibilityConditionTasks[2].entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[2].entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(visibilityConditionTasks[2].entry.name); @@ -267,7 +261,7 @@ describe('Task form cloud component', () => { }); it('[C315175] Should be able to complete a standalone task with invisible tab with empty value for field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[3].entry.name); @@ -280,13 +274,11 @@ describe('Task form cloud component', () => { await widget.textWidget().isWidgetNotVisible(widgets.textTwoId); await taskFormCloudComponent.clickCompleteButton(); - await browser.sleep(1000); - await browser.refresh(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(visibilityConditionTasks[3].entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[3].entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(visibilityConditionTasks[3].entry.name); await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields); @@ -294,7 +286,7 @@ describe('Task form cloud component', () => { }); it('[C315176] Should not be able to complete a standalone task with visible tab with invalid value for field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[4].entry.name); @@ -316,7 +308,7 @@ describe('Task form cloud component', () => { }); it('[C315179] Should be able to complete a standalone task with visible tab with valid value for field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[5].entry.name); @@ -331,13 +323,11 @@ describe('Task form cloud component', () => { await widget.textWidget().setValue(widgets.textThreeId, value.displayTab); await taskFormCloudComponent.clickCompleteButton(); - await browser.sleep(1000); - await browser.refresh(); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(visibilityConditionTasks[5].entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(visibilityConditionTasks[5].entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(visibilityConditionTasks[5].entry.name); await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields); diff --git a/e2e/process-services-cloud/task-form-cloud-component.e2e.ts b/e2e/process-services-cloud/task-form-cloud-component.e2e.ts index 2c7241412c..4f95c64003 100644 --- a/e2e/process-services-cloud/task-form-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/task-form-cloud-component.e2e.ts @@ -119,7 +119,7 @@ describe('Task form cloud component', () => { it('[C310366] Should refresh buttons and form after an action is complete', async () => { await appListCloudComponent.goToApp(simpleApp); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee(); @@ -142,7 +142,7 @@ describe('Task form cloud component', () => { await taskFormCloudComponent.checkReleaseButtonIsDisplayed(); await taskFormCloudComponent.clickCompleteButton(); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(formTaskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(formTaskId); @@ -155,7 +155,7 @@ describe('Task form cloud component', () => { it('[C306872] Should not be able to Release a process task which has only assignee', async () => { await appListCloudComponent.goToApp(simpleApp); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(assigneeTaskId); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(assigneeTaskId); @@ -171,14 +171,14 @@ describe('Task form cloud component', () => { }); it('[C307032] Should display the appropriate title for the unclaim option of a Task', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(candidateUsersTask.entry.id); await tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(candidateUsersTask.entry.id); await expect(await taskFormCloudComponent.getReleaseButtonText()).toBe('RELEASE'); }); it('[C310142] Empty content is displayed when having a task without form', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assigneeTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(assigneeTask.entry.name); await taskFormCloudComponent.checkFormIsNotDisplayed(); @@ -189,7 +189,7 @@ describe('Task form cloud component', () => { }); it('[C310199] Should not be able to complete a task when required field is empty or invalid data is added to a field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(formValidationsTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(formValidationsTask.entry.name); await taskFormCloudComponent.checkFormIsDisplayed(); @@ -225,7 +225,7 @@ describe('Task form cloud component', () => { }); it('[C307093] Complete button is not displayed when the task is already completed', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('Completed Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); @@ -234,7 +234,7 @@ describe('Task form cloud component', () => { }); it('[C307095] Task can not be completed by owner user', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); @@ -250,7 +250,7 @@ describe('Task form cloud component', () => { }); it('[C307110] Task list is displayed after clicking on Cancel button', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assigneeTask.entry.name); @@ -263,7 +263,7 @@ describe('Task form cloud component', () => { }); it('[C307094] Standalone Task can be completed by a user that is owner and assignee', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(toBeCompletedTask.entry.name); @@ -273,13 +273,13 @@ describe('Task form cloud component', () => { await taskFormCloudComponent.clickCompleteButton(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(toBeCompletedTask.entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(toBeCompletedTask.entry.name); await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed(); }); it('[C307111] Task of a process can be completed by a user that is owner and assignee', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask.entry.name); @@ -289,7 +289,7 @@ describe('Task form cloud component', () => { await taskFormCloudComponent.clickCompleteButton(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask.entry.name); - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask.entry.name); await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed(); }); diff --git a/e2e/process-services-cloud/task-header-cloud.e2e.ts b/e2e/process-services-cloud/task-header-cloud.e2e.ts index 5718aa48d4..8fa71d4ea1 100644 --- a/e2e/process-services-cloud/task-header-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-header-cloud.e2e.ts @@ -138,7 +138,7 @@ describe('Task Header cloud component', () => { }); it('[C291943] Should display task details for assigned task', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(basicCreatedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(basicCreatedTaskName); @@ -158,7 +158,7 @@ describe('Task Header cloud component', () => { }); it('[C291944] Should display task details for completed task', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); @@ -178,7 +178,7 @@ describe('Task Header cloud component', () => { }); it('[C291945] Should Parent Name and Parent Id not be empty in task details for sub task', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(subTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().selectRow(subTask.entry.name); @@ -204,19 +204,16 @@ describe('Task Header cloud component', () => { await startTaskCloudPage.addName(myTaskName); await startTaskCloudPage.typePriorityOf('50'); await startTaskCloudPage.clickStartButton(); - await tasksCloudDemoPage.taskFilterCloudComponent.clickMyTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(myTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(myTaskName); await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); - await taskHeaderCloudPage.priorityCardTextItem.clickOnEditButton(); await taskHeaderCloudPage.priorityCardTextItem.enterTextField('$$%£W21'); - await taskHeaderCloudPage.priorityCardTextItem.clickOnSaveButton(); const errorMessage = await taskHeaderCloudPage.priorityCardTextItem.getErrorMessage(); await expect(errorMessage).toBe('Enter a different value'); await taskHeaderCloudPage.priorityCardTextItem.enterTextField('600'); - await taskHeaderCloudPage.priorityCardTextItem.clickOnSaveButton(); const currentValue = await taskHeaderCloudPage.priorityCardTextItem.getFieldValue(); await expect(currentValue).toBe('600'); }); @@ -263,7 +260,7 @@ describe('Task Header cloud component', () => { }); it('[C311280] Should pick up the default date format from the app configuration', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.clickCompletedTasksFilter(); + await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('completed-tasks'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName); await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed(); diff --git a/e2e/process-services-cloud/task-list-cloud-action-menu.e2e.ts b/e2e/process-services-cloud/task-list-cloud-action-menu.e2e.ts index 9a6db14afe..98d03f2bd2 100644 --- a/e2e/process-services-cloud/task-list-cloud-action-menu.e2e.ts +++ b/e2e/process-services-cloud/task-list-cloud-action-menu.e2e.ts @@ -93,7 +93,7 @@ describe('Process list cloud', () => { await tasksCloudDemoPage.actionAdded('invisibleaction'); await tasksCloudDemoPage.clickAppButton(); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); + await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterIsDisplayed('my-tasks'); }); it('[C315723] Should be able to see and execute custom action menu', async () => { diff --git a/e2e/process-services-cloud/task-list-properties-sort.e2e.ts b/e2e/process-services-cloud/task-list-properties-sort.e2e.ts index ce5bdffba6..c29c94c2c1 100644 --- a/e2e/process-services-cloud/task-list-properties-sort.e2e.ts +++ b/e2e/process-services-cloud/task-list-properties-sort.e2e.ts @@ -128,7 +128,7 @@ describe('Edit task filters and task list properties', () => { await appListCloudComponent.checkApsContainer(); await appListCloudComponent.goToApp(simpleApp); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); + await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterIsDisplayed('my-tasks'); }); it('[C306901] Should display tasks sorted by task name when taskName is selected from sort dropdown', async () => { diff --git a/e2e/process-services-cloud/task-list-properties.e2e.ts b/e2e/process-services-cloud/task-list-properties.e2e.ts index b09da20ad9..240d2c6dd5 100644 --- a/e2e/process-services-cloud/task-list-properties.e2e.ts +++ b/e2e/process-services-cloud/task-list-properties.e2e.ts @@ -111,13 +111,10 @@ describe('Edit task filters and task list properties', () => { await appListCloudComponent.checkApsContainer(); await appListCloudComponent.goToApp(simpleApp); await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter(); - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); + await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterIsDisplayed('my-tasks'); }); it('[C292004] Filter by appName', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getAppNameDropDownValue()).toEqual(simpleApp); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name); @@ -131,9 +128,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C291906] Should be able to see only the task with specific taskId when typing it in the task Id field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setId(createdTask.entry.id); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getId()).toEqual(createdTask.entry.id); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(createdTask.entry.id); @@ -143,9 +137,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C291907] Should be able to see No tasks found when typing an invalid task id', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setId('invalidId'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getId()).toEqual('invalidId'); @@ -153,9 +144,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C297476] Filter by taskName', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setTaskName(createdTask.entry.name); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getTaskName()).toEqual(createdTask.entry.name); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name); @@ -165,9 +153,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C297613] Should be able to see No tasks found when typing a task name that does not exist', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setTaskName('invalidName'); await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().getTaskName()).toEqual('invalidName'); @@ -175,30 +160,23 @@ describe('Edit task filters and task list properties', () => { }); it('[C297480] Should be able to see only tasks that are part of a specific process when processInstanceId is set', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setProcessInstanceId(processInstance.entry.id); await tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ALL'); + await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee(); await expect(await tasksCloudDemoPage.taskListCloudComponent().getDataTable().getNumberOfRows()).toBe(1); + await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByProcessInstanceId(processInstance.entry.id); }); it('[C297684] Should be able to see No tasks found when typing an invalid processInstanceId', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setProcessInstanceId('invalidTaskId'); await expect(await tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); }); it('[C297478] Should be able to see only tasks that are assigned to a specific user when assignee is set', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignee('admin.adf'); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name); @@ -206,18 +184,12 @@ describe('Edit task filters and task list properties', () => { }); it('[C297686] Should be able to see No tasks found when typing an invalid user to assignee field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignee('invalid'); await expect(await tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); }); it('[C297482] Should be able to see only tasks with specific priority when priority is set', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority(priority); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(priorityTask.entry.name); @@ -225,17 +197,12 @@ describe('Edit task filters and task list properties', () => { }); it('[C297687] Should be able to see No tasks found when typing unused value for priority field', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority('87650'); await expect(await tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); }); it('[C297481] Should be able to see only tasks with specific parentTaskId when parentTaskId is set', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setParentTaskId(subTask.entry.parentTaskId); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(subTask.entry.name); @@ -243,9 +210,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C297486] Filter by Owner', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ALL'); await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee(); await tasksCloudDemoPage.editTaskFilterCloudComponent().setOwner(testUser.username); @@ -259,9 +223,6 @@ describe('Edit task filters and task list properties', () => { }); it('[C297484] Task is displayed when typing into lastModifiedFrom field a date before the task CreatedDate', async() => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(beforeDate); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name); @@ -270,17 +231,11 @@ describe('Edit task filters and task list properties', () => { }); it('[C297689] Task is not displayed when typing into lastModifiedFrom field the same date as tasks CreatedDate', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(currentDate); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTask.entry.name); }); it('[C297485] Task is displayed when typing into lastModifiedTo field a date after the task CreatedDate', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(afterDate); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name); @@ -289,19 +244,12 @@ describe('Edit task filters and task list properties', () => { }); it('[C297690] Task is not displayed when typing into lastModifiedTo field the same date as tasks CreatedDate', async () => { - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedTo(currentDate); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTask.entry.name); }); it('[C297691] Task is not displayed when typing into lastModifiedFrom field a date before the task due date ' + 'and into lastModifiedTo a date before task due date', async () => { - - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(beforeDate); await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedTo(beforeDate); await tasksCloudDemoPage.editTaskFilterCloudComponent().setTaskName(createdTask.entry.name); @@ -310,10 +258,6 @@ describe('Edit task filters and task list properties', () => { it('[C297692] Task is displayed when typing into lastModifiedFrom field a date before the tasks due date ' + 'and into lastModifiedTo a date after', async () => { - - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(beforeDate); await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedTo(afterDate); await tasksCloudDemoPage.editTaskFilterCloudComponent().setTaskName(createdTask.entry.name); @@ -322,10 +266,6 @@ describe('Edit task filters and task list properties', () => { it('[C297693] Task is not displayed when typing into lastModifiedFrom field a date after the tasks due date ' + 'and into lastModifiedTo a date after', async () => { - - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); - await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks'); - await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedFrom(afterDate); await tasksCloudDemoPage.editTaskFilterCloudComponent().setLastModifiedTo(afterDate); await expect(await tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage); diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts index 9a1faebf48..df6993336e 100644 --- a/e2e/process-services-cloud/task-list-selection.e2e.ts +++ b/e2e/process-services-cloud/task-list-selection.e2e.ts @@ -73,7 +73,7 @@ describe('Task list cloud - selection', () => { await navigationBarPage.navigateToProcessServicesCloudPage(); await appListCloudComponent.checkApsContainer(); await appListCloudComponent.goToApp(simpleApp); - await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed(); + await tasksCloudDemoPage.taskFilterCloudComponent.checkTaskFilterIsDisplayed('my-tasks'); await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); diff --git a/e2e/process-services/info-drawer.e2e.ts b/e2e/process-services/info-drawer.e2e.ts index 466be367e5..1654dcfc2c 100644 --- a/e2e/process-services/info-drawer.e2e.ts +++ b/e2e/process-services/info-drawer.e2e.ts @@ -45,7 +45,8 @@ describe('Info Drawer', () => { const date = { form: '12/08/2017', - header: 'Aug 12, 2017' + header: 'Aug 12, 2017', + dateFormat: 'll' }; const taskDetails = { @@ -65,19 +66,19 @@ describe('Info Drawer', () => { beforeAll(async () => { const users = new UsersActions(); - this.alfrescoJsApi = new AlfrescoApi({ + this.alfrescoApi = new AlfrescoApi({ provider: 'BPM', hostBpm: browser.params.testConfig.adf_aps.host }); - await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); - const assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); + await this.alfrescoApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + newTenant = await this.alfrescoApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const assigneeUserModel = await users.createApsUser(this.alfrescoApi, newTenant.id); assigneeUserModelFullName = assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName; - const processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); + const processUserModel = await users.createApsUser(this.alfrescoApi, newTenant.id); processUserModelFullName = processUserModel.firstName + ' ' + processUserModel.lastName; - await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - const applicationsService = new ApplicationsUtil(this.alfrescoJsApi); + await this.alfrescoApi.login(processUserModel.email, processUserModel.password); + const applicationsService = new ApplicationsUtil(this.alfrescoApi); appCreated = await applicationsService.importPublishDeployApp(app.file_path); await loginPage.loginToProcessServicesUsingUserModel(processUserModel); @@ -85,8 +86,8 @@ describe('Info Drawer', () => { afterAll(async () => { await this.alfrescoApi.activiti.modelsApi.deleteModel(appCreated.id); - await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(newTenant.id); + await this.alfrescoApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoApi.activiti.adminTenantsApi.deleteTenant(newTenant.id); }); beforeEach(async () => { @@ -96,7 +97,7 @@ describe('Info Drawer', () => { it('[C260319] New Task - displayed details', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask({...taskDetails, formName: app.formName, name}); + await taskPage.createTask({ ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); @@ -122,7 +123,7 @@ describe('Info Drawer', () => { it('[C260323] Priority - Editing field', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask({...taskDetails, formName: app.formName, name}); + await taskPage.createTask({ ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); @@ -141,7 +142,7 @@ describe('Info Drawer', () => { it('[C260325] Due Date - Changing', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask({...taskDetails, formName: app.formName, name}); + await taskPage.createTask({ ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); @@ -184,7 +185,7 @@ describe('Info Drawer', () => { it('[C260329] Task with no form', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask( {...taskDetails, formName: '', name}); + await taskPage.createTask( { ...taskDetails, formName: '', name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); @@ -202,7 +203,7 @@ describe('Info Drawer', () => { it('[C260320] Assign user to the task', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask( {...taskDetails, formName: app.formName, name}); + await taskPage.createTask( { ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); @@ -218,7 +219,7 @@ describe('Info Drawer', () => { }); await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy(); - await BrowserActions.click(taskPage.taskDetails().assigneeField); + await BrowserActions.click(taskPage.taskDetails().assigneeButton); const cancelSearch = element(by.css('button[id="close-people-search"]')); await BrowserVisibility.waitUntilElementIsPresent(cancelSearch); await BrowserActions.click(cancelSearch); @@ -231,7 +232,7 @@ describe('Info Drawer', () => { }); await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy(); - await BrowserActions.click(taskPage.taskDetails().assigneeField); + await BrowserActions.click(taskPage.taskDetails().assigneeButton); const addPeople = element(by.css('button[id="add-people"]')); await BrowserVisibility.waitUntilElementIsPresent(addPeople); await BrowserActions.click(addPeople); @@ -289,7 +290,7 @@ describe('Info Drawer', () => { it('[C260328] Description - Editing field', async () => { const name = StringUtil.generateRandomString(5); - await taskPage.createTask({...taskDetails, formName: app.formName, name}); + await taskPage.createTask({ ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS); @@ -305,10 +306,10 @@ describe('Info Drawer', () => { formName: app.formName }); + await taskPage.taskDetails().updateDescription(''); + await expect(await taskPage.taskDetails().getDescriptionPlaceholder()).toEqual('No description'); await taskPage.taskDetails().updateDescription('Good Bye'); await expect(await taskPage.taskDetails().getDescription()).toEqual('Good Bye'); - await taskPage.taskDetails().updateDescription(); - await expect(await taskPage.taskDetails().getDescription()).toEqual('No description'); await taskPage.taskDetails().clickCompleteFormTask(); }); @@ -317,7 +318,7 @@ describe('Info Drawer', () => { await LocalStorageUtil.setConfigField('adf-task-header', JSON.stringify(infoDrawerConfiguration)); const name = StringUtil.generateRandomString(5); - await taskPage.createTask({...taskDetails, formName: app.formName, name}); + await taskPage.createTask({ ...taskDetails, formName: app.formName, name }); await taskPage.tasksListPage().checkTaskListIsLoaded(); await taskPage.tasksListPage().getDataTable().waitForTableBody(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); @@ -330,12 +331,11 @@ describe('Info Drawer', () => { await expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority); await expect(await taskPage.taskDetails().getParentName()).toEqual(taskDetails.parentName); await taskPage.taskDetails().checkDueDatePickerButtonIsNotDisplayed(); - await taskPage.taskDetails().checkEditDescriptionButtonIsNotDisplayed(); await taskPage.taskDetails().clickCompleteFormTask(); }); - async function shouldHaveInfoDrawerDetails({description, status, priority, category, parentName, dateFormat, formName, fullName, dueDate}) { + async function shouldHaveInfoDrawerDetails({ description, status, priority, category, parentName, dateFormat, formName, fullName, dueDate }) { await expect(await taskPage.taskDetails().getAssignee()).toEqual(fullName); await expect(await taskPage.taskDetails().getDescription()).toEqual(description); await expect(await taskPage.taskDetails().getStatus()).toEqual(status); diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts index 7e28a1684f..223eda713e 100644 --- a/e2e/process-services/task-details.e2e.ts +++ b/e2e/process-services/task-details.e2e.ts @@ -323,8 +323,6 @@ describe('Task Details component', () => { await taskPage.taskDetails().checkEditableAssigneeIsNotDisplayed(); await taskPage.taskDetails().checkEditableFormIsNotDisplayed(); - await taskPage.taskDetails().checkEditDescriptionButtonIsNotDisplayed(); - await taskPage.taskDetails().checkEditPriorityButtonIsNotDisplayed(); await taskPage.taskDetails().checkDueDatePickerButtonIsNotDisplayed(); }); }); diff --git a/e2e/process-services/widgets/people-group-widget.e2e.ts b/e2e/process-services/widgets/people-group-widget.e2e.ts index 69d0827b8b..bb601eb85e 100644 --- a/e2e/process-services/widgets/people-group-widget.e2e.ts +++ b/e2e/process-services/widgets/people-group-widget.e2e.ts @@ -74,7 +74,8 @@ describe('People and Group widget', () => { await widget.groupWidget().insertGroup(groupVisibilityForm.FIELD.widget_id, groupVisibilityForm.searchTerm); await widget.groupWidget().checkDropDownListIsDisplayed(); - await expect(await widget.groupWidget().getDropDownList()).toEqual([ 'Heros', 'Users' ]); + const suggestions = await widget.groupWidget().getDropDownList(); + await expect(suggestions.sort()).toEqual([ 'Heros', 'Users' ]); await widget.groupWidget().selectGroupFromDropDown('Users'); await taskPage.taskDetails().clickCompleteFormTask(); }); diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html index b813ba75b5..7b463bd9a5 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html @@ -1,9 +1,9 @@