mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1880] e2e document-list selection mode (#5518)
* [AAE-1880] e2e document-list selection mode, open file/folder * resolved comments: backtick, refactoring names, using dropdownPage, removing comments, wrapping the API * added a new try-catch for beforeAll, fixed the error message * changed the name of a method from clickDropdownWithOption to selectDropdownOption * changed the method name from clickDropdown... to selectDropdownOption * added the variable type for some methods, delete the let list and refactor accordingly
This commit is contained in:
committed by
GitHub
parent
2b1a321baf
commit
24c728a8f5
@@ -21,7 +21,7 @@ import {
|
||||
PaginationPage,
|
||||
UploadActions,
|
||||
StringUtil,
|
||||
ContentNodeSelectorDialogPage
|
||||
ContentNodeSelectorDialogPage, ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/content-services.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
@@ -44,6 +44,7 @@ describe('Document List Component - Actions', () => {
|
||||
const paginationPage = new PaginationPage();
|
||||
const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
|
||||
const breadCrumbPage = new BreadCrumbPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
@@ -91,7 +92,6 @@ describe('Document List Component - Actions', () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
await browser.sleep(10000);
|
||||
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -203,6 +203,12 @@ describe('Document List Component - Actions', () => {
|
||||
await contentServicesPage.closeActionContext();
|
||||
});
|
||||
|
||||
it('[C260060] Should be able to open a file/folder through double click action - file', async () => {
|
||||
await contentServicesPage.doubleClickRow(pdfFileModel.name);
|
||||
await expect(await viewerPage.getDisplayedFileName()).toEqual(pdfFileModel.name);
|
||||
await viewerPage.checkPreviewFileDefaultOptionsAreDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Folder Actions', () => {
|
||||
@@ -218,6 +224,16 @@ describe('Document List Component - Actions', () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(folderName);
|
||||
});
|
||||
|
||||
it('[C260060] Should be able to open a file/folder through double click action - folder', async () => {
|
||||
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
|
||||
const numberOfSubFolders = 3;
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subFolder' + (i + 1));
|
||||
}
|
||||
await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders);
|
||||
});
|
||||
|
||||
it('[C260123] Should be able to delete a folder using context menu', async () => {
|
||||
await contentServicesPage.deleteContent(folderName);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(folderName);
|
||||
@@ -253,7 +269,6 @@ describe('Document List Component - Actions', () => {
|
||||
const contentServicesUser = new AcsUserModel();
|
||||
|
||||
beforeAll(async () => {
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
|
||||
await this.alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
|
||||
@@ -283,7 +298,6 @@ describe('Document List Component - Actions', () => {
|
||||
});
|
||||
|
||||
it('[C260132] Move action on folder with - Load more', async () => {
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||
|
||||
@@ -339,7 +353,6 @@ describe('Document List Component - Actions', () => {
|
||||
});
|
||||
|
||||
it('[C305051] Copy action on folder with - Load more', async () => {
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
|
@@ -105,7 +105,7 @@ describe('Document List - Pagination', () => {
|
||||
it('[C260062] Should use default pagination settings', async () => {
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
@@ -119,7 +119,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
@@ -141,7 +141,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||
@@ -149,7 +149,7 @@ describe('Document List - Pagination', () => {
|
||||
currentPage++;
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
|
||||
@@ -157,7 +157,7 @@ describe('Document List - Pagination', () => {
|
||||
currentPage++;
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
|
||||
@@ -165,7 +165,7 @@ describe('Document List - Pagination', () => {
|
||||
currentPage++;
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
@@ -184,7 +184,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
|
||||
@@ -192,7 +192,7 @@ describe('Document List - Pagination', () => {
|
||||
currentPage++;
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
|
||||
@@ -213,7 +213,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
|
||||
@@ -222,7 +222,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 16-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
@@ -276,7 +276,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
|
||||
@@ -285,7 +285,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
|
||||
@@ -294,7 +294,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyValue * currentPage} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
|
||||
@@ -303,7 +303,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 21-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
|
||||
@@ -329,7 +329,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne);
|
||||
await browser.refresh();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyOneValue + ' of ' + numberOfFilesAfterUpload);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue);
|
||||
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
|
||||
@@ -349,15 +349,15 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
}
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
await contentServicesPage.openFolder('subfolder6');
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
}
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of 2');
|
||||
|
||||
@@ -372,13 +372,13 @@ describe('Document List - Pagination', () => {
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
}
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
|
||||
await contentServicesPage.chooseSelectionMode('Single');
|
||||
|
||||
await contentServicesPage.selectFolder('subfolder1');
|
||||
await paginationPage.clickOnNextPage();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
await contentServicesPage.selectFolderWithCommandKey('subfolder6');
|
||||
await contentServicesPage.clickDownloadButton();
|
||||
|
||||
|
@@ -0,0 +1,137 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* 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 { LoginPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/content-services.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
import { AcsUserModel } from '../../models/ACS/acs-user.model';
|
||||
import { FolderModel } from '../../models/ACS/folder.model';
|
||||
import { browser } from 'protractor';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { UploadDialogPage } from '../../pages/adf/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();
|
||||
const acsUser = new AcsUserModel();
|
||||
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';
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
try {
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
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 + '\"]');
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user