diff --git a/e2e/content-services/document-list/document-list-component.e2e.ts b/e2e/content-services/document-list/document-list-component.e2e.ts index bbfc19734c..e366fdb500 100644 --- a/e2e/content-services/document-list/document-list-component.e2e.ts +++ b/e2e/content-services/document-list/document-list-component.e2e.ts @@ -21,7 +21,7 @@ import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, User import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { NodeEntry } from '@alfresco/js-api'; -import { DateFnsUtils } from '../../../lib/core/src/lib/common/utils/date-fns-utils'; +import { format } from 'date-fns'; describe('Document List Component', () => { let uploadedFolder: NodeEntry; @@ -123,7 +123,7 @@ describe('Document List Component', () => { await navigationBarPage.clickLogoutButton(); }); - it('[C279926] Should only display the user\'s files and folders', async () => { + it("[C279926] Should only display the user's files and folders", async () => { await contentServicesPage.goToDocumentList(); await contentServicesPage.checkContentIsDisplayed(folderName); await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); @@ -150,7 +150,7 @@ describe('Document List Component', () => { it('[C279929] Should be able to display the date with date type', async () => { await apiService.login(acsUser.username, acsUser.password); mediumDateUploadedNode = await uploadActions.uploadFile(mediumFileModel.location, mediumFileModel.name, '-my-'); - const createdDate = DateFnsUtils.formatDate(mediumDateUploadedNode.entry.createdAt, 'll'); + const createdDate = format(new Date(mediumDateUploadedNode.entry.createdAt), 'PP'); await contentServicesPage.goToDocumentList(); await contentServicesPage.enableMediumTimeFormat(); const dateValue = await contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created'); @@ -174,7 +174,9 @@ describe('Document List Component', () => { location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path }); - let fileANode; let fileBNode; let fileCNode; + let fileANode: NodeEntry; + let fileBNode: NodeEntry; + let fileCNode: NodeEntry; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -232,7 +234,6 @@ describe('Document List Component', () => { }); describe('', () => { - afterEach(async () => { await navigationBarPage.clickLogoutButton(); }); @@ -351,7 +352,7 @@ describe('Document List Component', () => { location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path }); - let file: any; + let file: NodeEntry; const viewer = new ViewerPage(); beforeAll(async () => { diff --git a/e2e/content-services/document-list/document-list-gallery.e2e.ts b/e2e/content-services/document-list/document-list-gallery.e2e.ts deleted file mode 100644 index 7f5705a3b1..0000000000 --- a/e2e/content-services/document-list/document-list-gallery.e2e.ts +++ /dev/null @@ -1,168 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { browser } from 'protractor'; -import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { FileModel } from '../../models/ACS/file.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { NodeEntry } from '@alfresco/js-api'; - -describe('Document List Component', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - const uploadActions = new UploadActions(apiService); - let acsUser: UserModel; - const navigationBarPage = new NavigationBarPage(); - - describe('Gallery View', () => { - const cardProperties = { - DISPLAY_NAME: 'Display name', - SIZE: 'Size', - LOCK: 'Lock', - CREATED_BY: 'Created by', - CREATED: 'Created' - }; - - const pdfFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const testFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path - }); - - const docxFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path - }); - const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`; - let filePdfNode: NodeEntry; - let fileTestNode: NodeEntry; - let fileDocxNode: NodeEntry; - let folderNode: NodeEntry; - let filePDFSubNode: NodeEntry; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-'); - fileTestNode = await uploadActions.uploadFile(testFile.location, testFile.name, '-my-'); - fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-'); - folderNode = await uploadActions.createFolder(folderName, '-my-'); - filePDFSubNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, folderNode.entry.id); - - await loginPage.login(acsUser.username, acsUser.password); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - - await apiService.loginWithProfile('admin'); - if (filePdfNode) { - await uploadActions.deleteFileOrFolder(filePdfNode.entry.id); - } - if (fileTestNode) { - await uploadActions.deleteFileOrFolder(fileTestNode.entry.id); - } - if (fileDocxNode) { - await uploadActions.deleteFileOrFolder(fileDocxNode.entry.id); - } - if (filePDFSubNode) { - await uploadActions.deleteFileOrFolder(filePDFSubNode.entry.id); - } - if (folderNode) { - await uploadActions.deleteFileOrFolder(folderNode.entry.id); - } - }); - - beforeEach(async () => { - await contentServicesPage.goToDocumentList(); - await contentServicesPage.clickGridViewButton(); - await contentServicesPage.checkCardViewContainerIsDisplayed(); - }); - - it('[C280016] Should be able to choose Gallery View', async () => { - await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(4); - }); - - it('[C280023] Gallery Card should show details', async () => { - await expect(await contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg'); - await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg'); - await expect(await contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg'); - await expect(await contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg'); - await contentServicesPage.checkMenuIsShowedForElementIndex(0); - await contentServicesPage.checkMenuIsShowedForElementIndex(1); - await contentServicesPage.checkMenuIsShowedForElementIndex(2); - await contentServicesPage.checkMenuIsShowedForElementIndex(3); - }); - - it('[C280069] Gallery Card should show attributes', async () => { - await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME); - await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE); - await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY); - await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED); - - await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName); - await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${acsUser.firstName} ${acsUser.lastName}`); - - await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/); - - await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name); - await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`); - await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${acsUser.firstName} ${acsUser.lastName}`); - - await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); - - await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name); - await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`11.81 KB`); - await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)) - .toBe(`${acsUser.firstName} ${acsUser.lastName}`); - - await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); - - await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name); - await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`); - await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)) - .toBe(`${acsUser.firstName} ${acsUser.lastName}`); - - await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); - }); - - it('[C261993] Should be able to sort Gallery Cards by display name', async () => { - await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME); - await contentServicesPage.checkListIsSortedByNameColumn('asc'); - }); - - it('[C261995] Should be able to sort Gallery Cards by author', async () => { - await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY); - await contentServicesPage.checkListIsSortedByAuthorColumn('asc'); - }); - - it('[C261996] Should be able to sort Gallery Cards by created date', async () => { - await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED); - await contentServicesPage.checkListIsSortedByCreatedColumn('asc'); - }); - }); -}); diff --git a/e2e/content-services/document-list/document-list-permissions.e2e.ts b/e2e/content-services/document-list/document-list-permissions.e2e.ts index 8222ed0cec..0a84c09183 100644 --- a/e2e/content-services/document-list/document-list-permissions.e2e.ts +++ b/e2e/content-services/document-list/document-list-permissions.e2e.ts @@ -18,17 +18,16 @@ import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { createApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing'; -import { SitesApi } from '@alfresco/js-api'; +import { SiteEntry, SitesApi } from '@alfresco/js-api'; describe('Document List Component', () => { - const loginPage = new LoginPage(); const errorPage = new ErrorPage(); const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); - let privateSite; + let privateSite: SiteEntry; let acsUser = null; describe('Permission Message', () => { @@ -57,7 +56,7 @@ describe('Document List Component', () => { it('[C217334] Should display a message when accessing file without permissions', async () => { await BrowserActions.getUrl(browser.baseUrl + '/files/' + privateSite.entry.guid); await expect(await errorPage.getErrorCode()).toBe('403'); - await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.'); + await expect(await errorPage.getErrorDescription()).toBe("You're not allowed access to this resource on the server."); }); - }); + }); }); diff --git a/e2e/content-services/document-list/document-list-selection.e2e.ts b/e2e/content-services/document-list/document-list-selection.e2e.ts deleted file mode 100644 index 6d652c7bc3..0000000000 --- a/e2e/content-services/document-list/document-list-selection.e2e.ts +++ /dev/null @@ -1,131 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { createApiService, LoginPage, PaginationPage, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FolderModel } from '../../models/ACS/folder.model'; -import { browser } from 'protractor'; -import { FileModel } from '../../models/ACS/file.model'; -import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page'; - -describe('Document List - Selection', () => { - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const uploadDialog = new UploadDialogPage(); - const paginationPage = new PaginationPage(); - let acsUser: UserModel; - const folderModel = new FolderModel({ name: 'folder' }); - const docxFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location - }); - const displayColumnName = 'Display name'; - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - beforeAll(async () => { - try { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - - await loginPage.login(acsUser.username, acsUser.password); - - await contentServicesPage.goToDocumentList(); - await contentServicesPage.createNewFolder(folderModel.name); - await contentServicesPage.uploadFile(docxFileModel.location); - await contentServicesPage.checkContentIsDisplayed(docxFileModel.name); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - } catch (error) { - throw new Error(`API call failed in beforeAll: ${error}`); - } - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C274696] Should be able to select and unselect a file or folder', async () => { - await contentServicesPage.selectRow(docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name); - - await paginationPage.clickItemsPerPageDropdown(); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name); - - await contentServicesPage.selectRow(docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name); - - await contentServicesPage.selectRow(folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - - await paginationPage.clickItemsPerPageDropdown(); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - - await contentServicesPage.selectRow(folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, folderModel.name); - }); - - it('[C260057] Should be able to choose between the Selection Mode options and select items accordingly', async () => { - await contentServicesPage.chooseSelectionMode('None'); - - await contentServicesPage.selectRow(docxFileModel.name); - await contentServicesPage.selectFolderWithCommandKey(folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, folderModel.name); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[]'); - - await contentServicesPage.chooseSelectionMode('Single'); - - await contentServicesPage.selectRow(docxFileModel.name); - await contentServicesPage.selectFolderWithCommandKey(folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name ); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + folderModel.name + '\"]'); - - await contentServicesPage.chooseSelectionMode('Multiple'); - - await contentServicesPage.selectRow(docxFileModel.name); - await contentServicesPage.selectFolderWithCommandKey(folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + docxFileModel.name + '","' + folderModel.name + '\"]'); - }); - - it('[C212928] Should be able to enable the Multiselect (with checkboxes) toggle and select items accordingly', async () => { - await contentServicesPage.chooseSelectionMode('Multiple'); - await contentServicesPage.clickMultiSelectToggle(); - await expect(await contentServicesPage.multiSelectToggleIsEnabled()).toBe(true); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[]'); - - await contentServicesPage.selectItemWithCheckbox(docxFileModel.name); - await contentServicesPage.selectItemWithCheckbox(folderModel.name); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + docxFileModel.name + '","' + folderModel.name + '\"]'); - - await contentServicesPage.unSelectItemWithCheckbox(docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name ); - - await contentServicesPage.clickSelectAllCheckbox(); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name); - await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + folderModel.name + '","' + docxFileModel.name + '\"]'); - }); - -}); diff --git a/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts b/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts deleted file mode 100644 index b866ee4037..0000000000 --- a/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts +++ /dev/null @@ -1,92 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { browser } from 'protractor'; -import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { FileModel } from '../../models/ACS/file.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { NodeEntry } from '@alfresco/js-api'; - -describe('Document List Component', () => { - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const apiService = createApiService(); - - const uploadActions = new UploadActions(apiService); - const navigationBarPage = new NavigationBarPage(); - const usersActions = new UsersActions(apiService); - - let acsUser: UserModel; - - describe('Thumbnails and tooltips', () => { - const pdfFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`; - let filePdfNode: NodeEntry; - let folderNode: NodeEntry; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - - acsUser = await usersActions.createUser(); - - await apiService.login(acsUser.username, acsUser.password); - filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-'); - folderNode = await uploadActions.createFolder(folderName, '-my-'); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - - await apiService.loginWithProfile('admin'); - if (filePdfNode) { - await uploadActions.deleteFileOrFolder(filePdfNode.entry.id); - } - if (folderNode) { - await uploadActions.deleteFileOrFolder(folderNode.entry.id); - } - }); - - beforeEach(async () => { - await loginPage.login(acsUser.username, acsUser.password); - await contentServicesPage.goToDocumentList(); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260108] Should display tooltip for file\'s name', async () => { - await expect(await contentServicesPage.getDocumentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name); - }); - - it('[C260109] Should display tooltip for folder\'s name', async () => { - await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName); - }); - - it('[C274701] Should be able to enable thumbnails', async () => { - await contentServicesPage.enableThumbnails(); - await contentServicesPage.checkAcsContainer(); - const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); - await expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`); - }); - }); -}); diff --git a/e2e/core/pages/content-services.page.ts b/e2e/core/pages/content-services.page.ts index 79aabd9240..4cd1703cec 100644 --- a/e2e/core/pages/content-services.page.ts +++ b/e2e/core/pages/content-services.page.ts @@ -47,8 +47,6 @@ export class ContentServicesPage { createdHeader = $$('div[data-automation-id="auto_header_content_id_createdAt"] > span').first(); emptyFolder = $('.adf-empty-folder-this-space-is-empty'); emptyFolderImage = $('.adf-empty-folder-image'); - gridViewButton = $('button[data-automation-id="document-list-grid-view"]'); - cardViewContainer = $('div.app-document-list-container div.adf-datatable-card'); nameColumnHeader = 'name'; createdByColumnHeader = 'createdByUser.displayName'; createdColumnHeader = 'createdAt'; @@ -58,11 +56,8 @@ export class ContentServicesPage { downloadContent = $('button[data-automation-id="Download"]'); downloadButton = $('button[title="Download"]'); multiSelectToggle = $('[data-automation-id="multiSelectToggle"]'); - selectAllCheckbox = $$('.adf-checkbox-sr-only').first(); selectionModeDropdown = $('.mat-select[placeholder="Selection Mode"]'); - selectedNodesList = $$('.app-content-service-settings li'); siteListDropdown = new DropdownPage($(`mat-select[data-automation-id='site-my-files-option']`)); - sortingDropdown = new DropdownPage($('mat-select[data-automation-id="grid-view-sorting"]')); async pressContextMenuActionNamed(actionName: string): Promise { await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`); @@ -78,7 +73,7 @@ export class ContentServicesPage { return this.contentList; } - async checkDeleteIsDisabled(content): Promise { + async checkDeleteIsDisabled(content: string): Promise { await this.contentList.clickOnActionMenu(content); const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`); await BrowserVisibility.waitUntilElementIsVisible(disabledDelete); @@ -349,36 +344,6 @@ export class ContentServicesPage { return BrowserActions.getAttribute(iconRow, 'src'); } - async checkGridViewButtonIsVisible(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton); - } - - async clickGridViewButton(): Promise { - await this.checkGridViewButtonIsVisible(); - await BrowserActions.click(this.gridViewButton); - } - - async checkCardViewContainerIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer); - } - - async getCardElementShowedInPage(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer); - return $$('div.app-document-list-container div.adf-datatable-card div.adf-cell-value img').count(); - } - - async getDocumentCardIconForElement(elementName: string): Promise { - const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`); - return BrowserActions.getAttribute(elementIcon, 'src'); - } - - async checkDocumentCardPropertyIsShowed(elementName: string, propertyName: string): Promise { - const elementProperty = $( - `.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]` - ); - await BrowserVisibility.waitUntilElementIsVisible(elementProperty); - } - async getAttributeValueForElement(elementName: string, propertyName: string): Promise { const elementSize = $( `.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span` @@ -386,15 +351,6 @@ export class ContentServicesPage { return BrowserActions.getText(elementSize); } - async checkMenuIsShowedForElementIndex(elementIndex: number): Promise { - const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`); - await BrowserVisibility.waitUntilElementIsVisible(elementMenu); - } - - async selectGridSortingFromDropdown(sortingOption: string): Promise { - await this.sortingDropdown.selectDropdownOption(sortingOption); - } - async checkSelectedSiteIsDisplayed(siteName: string): Promise { await this.siteListDropdown.checkOptionIsSelected(siteName); } @@ -409,14 +365,6 @@ export class ContentServicesPage { await BrowserActions.click(this.multiSelectToggle); } - async multiSelectToggleIsEnabled(): Promise { - return this.multiSelectToggle.isEnabled(); - } - - async clickSelectAllCheckbox(): Promise { - await BrowserActions.click(this.selectAllCheckbox); - } - async selectFolder(folderName: string): Promise { const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`); await BrowserVisibility.waitUntilElementIsVisible(folderSelected); @@ -433,20 +381,4 @@ export class ContentServicesPage { const dropdownPage = new DropdownPage(this.selectionModeDropdown); await dropdownPage.selectDropdownOption(option); } - - async getItemSelected(): Promise { - return BrowserActions.getArrayText(this.selectedNodesList); - } - - async selectItemWithCheckbox(itemName: string): Promise { - const item = $(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`); - await BrowserVisibility.waitUntilElementIsVisible(item); - await BrowserActions.click(item); - } - - async unSelectItemWithCheckbox(itemName: string): Promise { - const item = $(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`); - await BrowserVisibility.waitUntilElementIsVisible(item); - await BrowserActions.click(item); - } } diff --git a/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts b/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts index d06931a7ed..c5dd305a2b 100644 --- a/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts +++ b/e2e/process-services-cloud/pages/tasks-cloud-demo.page.ts @@ -15,51 +15,24 @@ * limitations under the License. */ -import { element, by, browser, $ } from 'protractor'; import { - TogglePage, TaskFiltersCloudComponentPage, EditTaskFilterCloudComponentPage, TaskListCloudComponentPage, - BrowserActions, DropdownPage, TestElement, DataTableComponentPage + BrowserActions, + TestElement, + DataTableComponentPage } from '@alfresco/adf-testing'; export class TasksCloudDemoPage { createButton = TestElement.byCss('button[data-automation-id="create-button"'); newTaskButton = TestElement.byCss('button[data-automation-id="btn-start-task"]'); - settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first(); - appButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first(); - displayTaskDetailsToggle = $('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'); - displayProcessDetailsToggle = $('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'); - multiSelectionToggle = $('mat-slide-toggle[data-automation-id="multiSelection"]'); - testingModeToggle = $('mat-slide-toggle[data-automation-id="testingMode"]'); - selectedRows = element(by.xpath('//div[text()=\' Selected Rows: \']')); - noOfSelectedRows = element.all(by.xpath('//div[text()=\' Selected Rows: \']//li')); spinner = TestElement.byTag('mat-progress-spinner'); - modeDropdown = new DropdownPage($('mat-form-field[data-automation-id="selectionMode"]')); - - togglePage = new TogglePage(); editTaskFilterCloud = new EditTaskFilterCloudComponentPage(); taskFilterCloudComponent = new TaskFiltersCloudComponentPage(); dataTableComponentPage = new DataTableComponentPage(); - async disableDisplayTaskDetails(): Promise { - await this.togglePage.disableToggle(this.displayTaskDetailsToggle); - } - - async disableDisplayProcessDetails(): Promise { - await this.togglePage.disableToggle(this.displayProcessDetailsToggle); - } - - async enableMultiSelection(): Promise { - await this.togglePage.enableToggle(this.multiSelectionToggle); - } - - async enableTestingMode(): Promise { - await this.togglePage.enableToggle(this.testingModeToggle); - } - taskListCloudComponent(): TaskListCloudComponentPage { return new TaskListCloudComponentPage(); } @@ -69,37 +42,6 @@ export class TasksCloudDemoPage { await BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]'); } - async clickSettingsButton(): Promise { - await BrowserActions.click(this.settingsButton); - await browser.sleep(400); - await new TestElement(this.multiSelectionToggle).waitVisible(); - await this.modeDropdown.checkDropdownIsClickable(); - } - - async clickAppButton(): Promise { - await BrowserActions.click(this.appButton); - } - - async selectSelectionMode(mode: string): Promise { - await this.modeDropdown.clickDropdown(); - await this.modeDropdown.selectOption(mode); - } - - checkSelectedRowsIsDisplayed(): Promise { - return new TestElement(this.selectedRows).waitVisible(); - } - - async getNoOfSelectedRows(): Promise { - await this.checkSelectedRowsIsDisplayed(); - return this.noOfSelectedRows.count(); - } - - async getSelectedTaskRowText(rowNo: string): Promise { - await this.checkSelectedRowsIsDisplayed(); - const row = element(by.xpath(`//div[text()=' Selected Rows: ']//li[${rowNo}]`)); - return BrowserActions.getText(row); - } - async clickStartNewTaskButton() { await this.createButton.click(); await this.newTaskButton.click(); diff --git a/e2e/process-services-cloud/process/process-list-selection-cloud.e2e.ts b/e2e/process-services-cloud/process/process-list-selection-cloud.e2e.ts deleted file mode 100644 index 3bf70b4c1d..0000000000 --- a/e2e/process-services-cloud/process/process-list-selection-cloud.e2e.ts +++ /dev/null @@ -1,197 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { createApiService, AppListCloudPage, GroupIdentityService, IdentityService, LoginPage, ProcessDefinitionsService, ProcessInstancesService, LocalStorageUtil } from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page'; -import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessDetailsCloudDemoPage } from './../pages/process-details-cloud-demo.page'; -import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config'; -import CONSTANTS = require('../../util/constants'); - -describe('Process list cloud', () => { - - describe('Process List - selection', () => { - - const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name; - - const loginSSOPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const appListCloudComponent = new AppListCloudPage(); - - const processCloudDemoPage = new ProcessCloudDemoPage(); - const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent(); - const processList = processCloudDemoPage.processListCloudComponent(); - const processFilter = processCloudDemoPage.processFilterCloudComponent; - - const tasksCloudDemoPage = new TasksCloudDemoPage(); - const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage(); - - const apiService = createApiService(); - const identityService = new IdentityService(apiService); - const groupIdentityService = new GroupIdentityService(apiService); - const processDefinitionService = new ProcessDefinitionsService(apiService); - const processInstancesService = new ProcessInstancesService(apiService); - - let testUser; let groupInfo; - - const noOfProcesses = 3; - const processInstances = []; - const editProcessFilterConfiguration = new EditProcessFilterConfiguration(); - const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration(); - const PROCESSES = CONSTANTS.PROCESS_FILTERS; - - const checkRowIsSelectedById = async (mode = 'Single') => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.selectSelectionMode(mode); - await tasksCloudDemoPage.clickAppButton(); - await processFilter.isProcessFiltersListVisible(); - await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING); - await editProcessFilter.setFilter({ initiator: `${testUser.firstName} ${testUser.lastName}`}); - await processList.getDataTable().waitTillContentLoaded(); - await processList.selectRowById(processInstances[0]); - await processList.checkRowIsSelectedById(processInstances[0]); - }; - - beforeAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - - testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]); - groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); - await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); - - await apiService.login(testUser.username, testUser.password); - const processDefinition = await processDefinitionService - .getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.simpleProcess, simpleApp); - - for (let i = 0; i < noOfProcesses; i++) { - const response = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp); - processInstances.push(response.entry.id); - } - - await loginSSOPage.login(testUser.username, testUser.password); - await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile)); - }); - - afterAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - await identityService.deleteIdentityUser(testUser.idIdentityService); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToProcessServicesCloudPage(); - await expect(processInstances.length).toEqual(noOfProcesses, 'Wrong preconditions'); - await appListCloudComponent.checkApsContainer(); - await appListCloudComponent.goToApp(simpleApp); - await processFilter.clickOnProcessFilters(); - await processFilter.clickRunningProcessesFilter(); - await expect(await processFilter.getActiveFilterName()).toBe(PROCESSES.RUNNING); - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.disableDisplayProcessDetails(); - await tasksCloudDemoPage.clickAppButton(); - }); - - it('[C297469] Should NOT be able to select a process when settings are set to None', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.selectSelectionMode('None'); - await tasksCloudDemoPage.clickAppButton(); - await processFilter.isProcessFiltersListVisible(); - await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING); - await editProcessFilter.openFilter(); - await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`); - await processList.getDataTable().waitTillContentLoaded(); - await processList.selectRowById(processInstances[0]); - await processList.getDataTable().checkNoRowIsSelected(); - }); - - it('[C297468] Should be able to select only one process when settings are set to Single', async () => { - await checkRowIsSelectedById(); - await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(1); - await processList.selectRowById(processInstances[1]); - await processList.checkRowIsSelectedById(processInstances[1]); - await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(1); - }); - - it('[C297470] Should be able to select multiple processes using keyboard', async () => { - await checkRowIsSelectedById('Multiple'); - await processList.selectRowWithKeyboard(processInstances[1]); - await processList.checkRowIsSelectedById(processInstances[0]); - await processList.checkRowIsSelectedById(processInstances[1]); - await processList.checkRowIsNotSelectedById(processInstances[2]); - await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(2); - }); - - it('[C297465] Should be able to select multiple processes using checkboxes', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); - await tasksCloudDemoPage.clickAppButton(); - await processFilter.isProcessFiltersListVisible(); - await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING); - await editProcessFilter.setFilter({ initiator: `${testUser.firstName} ${testUser.lastName}`}); - await processList.getDataTable().waitTillContentLoaded(); - await processList.checkCheckboxById(processInstances[0]); - await processList.checkRowIsCheckedById(processInstances[0]); - await processList.checkCheckboxById(processInstances[1]); - await processList.checkRowIsCheckedById(processInstances[1]); - await processList.checkRowIsNotCheckedById(processInstances[2]); - await processList.checkCheckboxById(processInstances[1]); - await processList.checkRowIsNotCheckedById(processInstances[1]); - await processList.checkRowIsCheckedById(processInstances[0]); - }); - - it('[C299125] Should be possible to select all the rows when multiselect is true', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); - await tasksCloudDemoPage.clickAppButton(); - await processFilter.isProcessFiltersListVisible(); - await editProcessFilter.setFilter({ initiator: `${testUser.firstName} ${testUser.lastName}`}); - await processList.getDataTable().waitTillContentLoaded(); - await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING); - await browser.sleep(1000); - await processList.getDataTable().checkAllRowsButtonIsDisplayed(); - await processList.getDataTable().checkAllRows(); - await processList.checkRowIsCheckedById(processInstances[0]); - await processList.checkRowIsCheckedById(processInstances[1]); - await processList.checkRowIsCheckedById(processInstances[2]); - - await processList.getDataTable().checkAllRowsButtonIsDisplayed(); - await processList.getDataTable().uncheckAllRows(); - await processList.checkRowIsNotCheckedById(processInstances[0]); - await processList.checkRowIsNotCheckedById(processInstances[1]); - await processList.checkRowIsNotCheckedById(processInstances[2]); - }); - - it('[C297467] Should be able to see selected processes', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); - await tasksCloudDemoPage.enableTestingMode(); - await tasksCloudDemoPage.clickAppButton(); - await processFilter.isProcessFiltersListVisible(); - await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING); - await editProcessFilter.setFilter({ initiator: `${testUser.firstName} ${testUser.lastName}`}); - await processList.getDataTable().waitTillContentLoaded(); - await processList.checkCheckboxById(processInstances[0]); - await processList.checkRowIsCheckedById(processInstances[0]); - await processDetailsCloudDemoPage.checkListedSelectedProcessInstance(processInstances[0]); - - await processList.checkCheckboxById(processInstances[1]); - await processList.checkRowIsCheckedById(processInstances[1]); - await processDetailsCloudDemoPage.checkListedSelectedProcessInstance(processInstances[1]); - }); - }); -}); diff --git a/e2e/process-services-cloud/task-list/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list/task-list-selection.e2e.ts deleted file mode 100644 index c7ffeb874c..0000000000 --- a/e2e/process-services-cloud/task-list/task-list-selection.e2e.ts +++ /dev/null @@ -1,183 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { createApiService, - AppListCloudPage, - GroupIdentityService, - IdentityService, - LoginPage, - StringUtil, - TasksService -} from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; - -describe('Task list cloud - selection', () => { - - describe('Task list cloud - selection', () => { - - const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name; - - const loginSSOPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const appListCloudComponent = new AppListCloudPage(); - const tasksCloudDemoPage = new TasksCloudDemoPage(); - const taskFilter = tasksCloudDemoPage.taskFilterCloudComponent; - - const apiService = createApiService(); - const identityService = new IdentityService(apiService); - const groupIdentityService = new GroupIdentityService(apiService); - const tasksService = new TasksService(apiService); - - const noOfTasks = 3; - let response; let testUser; let groupInfo; - const tasks = []; - - beforeAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - - testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]); - - groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); - await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); - await apiService.login(testUser.username, testUser.password); - - for (let i = 0; i < noOfTasks; i++) { - response = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp); - await tasksService.claimTask(response.entry.id, simpleApp); - tasks.push(response.entry.name); - } - - await loginSSOPage.login(testUser.username, testUser.password); - }); - - afterAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - await identityService.deleteIdentityUser(testUser.idIdentityService); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToProcessServicesCloudPage(); - await appListCloudComponent.checkApsContainer(); - await appListCloudComponent.goToApp(simpleApp); - await taskFilter.checkTaskFilterIsDisplayed('my-tasks'); - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - }); - - it('[C291914] Should not be able to select any row when selection mode is set to None', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.selectSelectionMode('None'); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkNoRowIsSelected(); - }); - - it('[C291918] Should be able to select only one row when selection mode is set to Single', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.selectSelectionMode('Single'); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsSelected(tasks[0]); - await expect(await tasksCloudDemoPage.taskListCloudComponent().getDataTable().getNumberOfSelectedRows()).toEqual(1); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsSelected(tasks[1]); - await expect(await tasksCloudDemoPage.taskListCloudComponent().getDataTable().getNumberOfSelectedRows()).toEqual(1); - }); - - it('[C291919] Should be able to select only one row when selection mode is set to Multiple', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().selectRow(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsSelected(tasks[0]); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().selectRowWithKeyboard(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsSelected(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsSelected(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsNotSelected(tasks[2]); - }); - - it('[C291916] Should be able to select multiple row when multiselect is true', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsChecked(tasks[0]); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsChecked(tasks[1]); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[2]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsNotChecked(tasks[2]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsNotChecked(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsChecked(tasks[0]); - }); - - it('[C291915] Should be possible select all the rows when multiselect is true', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.disableDisplayTaskDetails(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkAllRowsButtonIsDisplayed(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkAllRows(); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsChecked(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().checkRowIsChecked(tasks[2]); - }); - - it('[C297472] Should be able to see selected tasks with Multiselection and Testing switched on', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); - await tasksCloudDemoPage.enableTestingMode(); - await tasksCloudDemoPage.clickAppButton(); - await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded(); - - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[0]); - await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(tasks[1]); - await tasksCloudDemoPage.taskListCloudComponent().clickCheckbox(tasks[1]); - - await expect(await tasksCloudDemoPage.getNoOfSelectedRows()).toBe(2); - await expect(await tasksCloudDemoPage.getSelectedTaskRowText('1')).toBe(tasks[0]); - await expect(await tasksCloudDemoPage.getSelectedTaskRowText('2')).toBe(tasks[1]); - }); - }); -});