[ADF-5235] Facet fix and improve search test (#6122)

* improve search test

* fix

* fix

* fix

* changes

* modify

* logout public URL

* improve stability some e2e

* fx lint

* fix

* fix

* improve

* fix

* improve

* fix

* fix

* fix

* fix [skip ci]

* fix

* some fix [skip ci]

* fix

* fix lint

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* convert C291893 in manual test case in testrail

* fix

* fix
This commit is contained in:
Eugenio Romano
2020-09-21 09:35:01 +01:00
committed by GitHub
parent 9c427b3142
commit 46ccda68b3
111 changed files with 987 additions and 604 deletions

View File

@@ -96,7 +96,7 @@ describe('Comment Component', () => {
await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test });
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
@@ -111,7 +111,7 @@ describe('Comment Component', () => {
it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
@@ -127,7 +127,7 @@ describe('Comment Component', () => {
it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
@@ -151,7 +151,6 @@ describe('Comment Component', () => {
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
@@ -198,7 +197,6 @@ describe('Comment Component', () => {
await contentServicesPage.checkAcsContainer();
await viewerPage.viewFile(pngUploadedFile.entry.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();

View File

@@ -101,7 +101,7 @@ describe('Create folder directive', () => {
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);

View File

@@ -46,13 +46,12 @@ describe('Create library directive', () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
acsUser = await usersActions.createUser();
await loginPage.login(acsUser.email, acsUser.password);
createSite = await apiService.getInstance().core.sitesApi.createSite({
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PUBLIC'
});
await loginPage.login(acsUser.email, acsUser.password);
});
afterAll(async () => {
@@ -86,15 +85,14 @@ describe('Create library directive', () => {
const libraryName = 'cancelLibrary';
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.clickCancel();
await createLibraryDialog.waitForDialogToClose();
});
it('[C290160] Should create a public library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPublic();
@@ -104,8 +102,6 @@ describe('Create library directive', () => {
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
@@ -116,6 +112,7 @@ describe('Create library directive', () => {
it('[C290173] Should create a private library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPrivate();
@@ -125,8 +122,6 @@ describe('Create library directive', () => {
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
@@ -148,8 +143,6 @@ describe('Create library directive', () => {
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
@@ -247,8 +240,6 @@ describe('Create library directive', () => {
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create library dialog remained open');
});
it('[C290179] Should not accept more than the expected characters for input fields', async () => {

View File

@@ -109,6 +109,7 @@ describe('Delete Directive', () => {
});
describe('Handling multiselection', () => {
beforeEach(async () => {
await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id);

View File

@@ -173,7 +173,7 @@ describe('Favorite directive', () => {
await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.doubleClickRow(testFolder1.entry.name);
await contentServicesPage.openFolder(testFolder1.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);

View File

@@ -175,7 +175,7 @@ describe('Restore content directive', () => {
it('[C260240] Should validate restore when the original location no longer exists', async () => {
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.openFolder(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.deleteContent(subFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
@@ -204,7 +204,7 @@ describe('Restore content directive', () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.openFolder(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
});
@@ -266,7 +266,7 @@ describe('Restore content directive', () => {
await contentServicesPage.selectSite(publicSite.entry.title);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
await contentServicesPage.doubleClickRow(siteFolder.entry.name);
await contentServicesPage.openFolder(siteFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
@@ -287,7 +287,6 @@ describe('Restore content directive', () => {
await loginPage.login(anotherAcsUser.email, anotherAcsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
afterAll(async () => {
@@ -318,9 +317,9 @@ describe('Restore content directive', () => {
await contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
await contentServicesPage.doubleClickRow(folderWithin.entry.name);
await contentServicesPage.openFolder(folderWithin.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});

View File

@@ -15,24 +15,19 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { browser } from 'protractor';
import {
ApiService,
BreadcrumbPage,
BreadcrumbDropdownPage,
ContentNodeSelectorDialogPage,
LoginPage,
PaginationPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page';
import { FolderModel } from '../../models/ACS/folder.model';
describe('Document List Component - Actions', () => {
@@ -40,17 +35,12 @@ describe('Document List Component - Actions', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const contentListPage = contentServicesPage.getDocumentList();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const paginationPage = new PaginationPage();
const breadCrumbDropdownPage = new BreadcrumbDropdownPage();
const breadCrumbPage = new BreadcrumbPage();
const viewerPage = new ViewerPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
describe('Document List Component - Check Actions', () => {
let uploadedFolder, secondUploadedFolder;
@@ -89,7 +79,7 @@ describe('Document List Component - Actions', () => {
await loginPage.login(acsUser.email, acsUser.password);
await browser.sleep(10000);
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
@@ -98,6 +88,7 @@ describe('Document List Component - Actions', () => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
describe('File Actions', () => {
@@ -110,7 +101,7 @@ describe('Document List Component - Actions', () => {
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
@@ -135,7 +126,7 @@ describe('Document List Component - Actions', () => {
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
});
@@ -151,7 +142,7 @@ describe('Document List Component - Actions', () => {
});
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[0]);
await contentServicesPage.deleteContent(fileNames[0]);
@@ -159,7 +150,7 @@ describe('Document List Component - Actions', () => {
});
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.getDocumentList().selectRow(fileNames[1]);
await contentServicesPage.getDocumentList().selectRow(fileNames[2]);
@@ -169,7 +160,7 @@ describe('Document List Component - Actions', () => {
});
it('[C280565] Should be able to delete a file using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
@@ -177,7 +168,7 @@ describe('Document List Component - Actions', () => {
});
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.getDocumentList().selectRow(fileNames[3]);
await contentServicesPage.getDocumentList().selectRow(fileNames[4]);
@@ -216,7 +207,7 @@ describe('Document List Component - Actions', () => {
await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
await contentServicesPage.openFolder(secondUploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
@@ -256,140 +247,4 @@ describe('Document List Component - Actions', () => {
});
});
describe('Folder Actions - Copy and Move', () => {
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() });
let folder1, folder2, folder3, folder4, folder5, folder6;
let folders;
const contentServicesUser = new UserModel();
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(contentServicesUser);
await apiService.getInstance().login(contentServicesUser.email, contentServicesUser.password);
folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-');
folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-');
folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-');
folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-');
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
});
beforeEach(async () => {
await loginPage.login(contentServicesUser.email, contentServicesUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
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);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await breadCrumbDropdownPage.clickParentFolder();
await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
await breadCrumbDropdownPage.choosePath(contentServicesUser.email);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.email);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
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);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await paginationPage.clickOnNextPage();
await contentServicesPage.getDocumentList().waitForTableBody();
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
});
});

View File

@@ -222,7 +222,7 @@ describe('Document List Component', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
@@ -241,7 +241,7 @@ describe('Document List Component', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
@@ -345,7 +345,6 @@ describe('Document List Component', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => {

View File

@@ -97,7 +97,7 @@ describe('Document List Component', () => {
}
});
await browser.driver.sleep(12000);
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
@@ -119,6 +119,7 @@ describe('Document List Component', () => {
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
it('[C260128] Move - Same name file', async () => {
@@ -142,11 +143,11 @@ describe('Document List Component', () => {
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(destinationFolder.entry.name);
await contentServicesPage.openFolder(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(sourceFolder.entry.name);
await contentServicesPage.openFolder(sourceFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
});

View File

@@ -0,0 +1,185 @@
/*!
* @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 { browser, by, element } from 'protractor';
import {
ApiService,
BreadcrumbPage,
BreadcrumbDropdownPage,
ContentNodeSelectorDialogPage,
LoginPage,
PaginationPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page';
import { FolderModel } from '../../models/ACS/folder.model';
describe('Document List Component - Actions', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const contentListPage = contentServicesPage.getDocumentList();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const paginationPage = new PaginationPage();
const breadCrumbDropdownPage = new BreadcrumbDropdownPage();
const breadCrumbPage = new BreadcrumbPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
describe('Folder Actions - Copy and Move', () => {
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() });
let folder1, folder2, folder3, folder4, folder5, folder6;
let folders;
const contentServicesUser = new UserModel();
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(contentServicesUser);
await apiService.getInstance().login(contentServicesUser.email, contentServicesUser.password);
folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-');
folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-');
folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-');
folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-');
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
});
beforeEach(async () => {
await loginPage.login(contentServicesUser.email, contentServicesUser.password);
await contentServicesPage.goToDocumentList();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
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);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await contentServicesPage.openFolder('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await breadCrumbDropdownPage.clickParentFolder();
await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
await breadCrumbDropdownPage.choosePath(contentServicesUser.email);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.email);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
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);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await paginationPage.clickOnNextPage();
await contentServicesPage.getDocumentList().waitForTableBody();
await contentServicesPage.openFolder('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
});
});

View File

@@ -157,7 +157,7 @@ describe('Document List Component', () => {
it('[C280130] Should be able to go back to List View', async () => {
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
});

View File

@@ -105,7 +105,6 @@ describe('Document List - Pagination', () => {
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
it('[C260062] Should use default pagination settings', async () => {
@@ -136,7 +135,6 @@ describe('Document List - Pagination', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await navigationBarPage.clickLogoutButton();
@@ -153,25 +151,31 @@ describe('Document List - Pagination', () => {
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
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(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
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(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
@@ -336,7 +340,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.goToDocumentList();
await browser.refresh();
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.openFolder(newFolderModel.name);
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.clickOnCloseButton();

View File

@@ -61,7 +61,7 @@ describe('Document List Component - Properties', () => {
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.disableDropFilesInAFolder();
@@ -69,13 +69,13 @@ describe('Document List Component - Properties', () => {
await DropActions.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
});
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.enableDropFilesInAFolder();
@@ -84,7 +84,7 @@ describe('Document List Component - Properties', () => {
await DropActions.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
});
});

View File

@@ -48,7 +48,6 @@ describe('Document List - Selection', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.createNewFolder(folderModel.name);
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);

View File

@@ -163,11 +163,11 @@ describe('Permissions Component', () => {
await uploadActions.uploadFile(fileModel.location, 'RoleCoordinator' + fileModel.name, roleCoordinatorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleCollaborator' + fileModel.name, roleCollaboratorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleEditor' + fileModel.name, roleEditorFolder.entry.id);
});
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
@@ -175,13 +175,17 @@ describe('Permissions Component', () => {
});
describe('Inherit and assigning permissions', () => {
beforeEach(async () => {
await apiService.getInstance().login(fileOwnerUser.email, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
await loginPage.login(fileOwnerUser.email, fileOwnerUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.addPermissionsDialog.checkPermissionContainerIsDisplayed();
@@ -193,17 +197,19 @@ describe('Permissions Component', () => {
await uploadActions.deleteFileOrFolder(file.entry.id);
} catch (error) {
}
});
await navigationBarPage.clickLogoutButton();
});
it('[C268974] Inherit Permission', async () => {
await permissionsPage.addPermissionsDialog.checkPermissionInheritedButtonIsDisplayed();
await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Permission Inherited');
await permissionsPage.addPermissionsDialog.checkPermissionsDatatableIsDisplayed();
await permissionsPage.addPermissionsDialog.clickPermissionInheritedButton();
await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Inherit Permission');
await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Inherit Permission');
await permissionsPage.addPermissionsDialog.checkNoPermissionsIsDisplayed();
await permissionsPage.addPermissionsDialog.clickPermissionInheritedButton();
await expect(await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.addPermissionsDialog.getPermissionInheritedButtonText('Permission Inherited');
await permissionsPage.addPermissionsDialog.checkPermissionsDatatableIsDisplayed();
});
@@ -238,9 +244,10 @@ describe('Permissions Component', () => {
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDisplayed('EVERYONE');
});
});
});
describe('Changing and duplicate Permissions', () => {
beforeEach(async () => {
await apiService.getInstance().login(fileOwnerUser.email, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
@@ -261,6 +268,7 @@ describe('Permissions Component', () => {
afterEach(async () => {
await uploadActions.deleteFileOrFolder(file.entry.id);
await navigationBarPage.clickLogoutButton();
});
it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', async () => {
@@ -268,19 +276,24 @@ describe('Permissions Component', () => {
await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email);
const roleDropdownOptions = permissionsPage.addPermissionsDialog.getRoleDropdownOptions();
await expect(await roleDropdownOptions.count()).toBe(5);
await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe('Contributor');
await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe('Collaborator');
await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe('Coordinator');
await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe('Editor');
await expect(await BrowserActions.getText(roleDropdownOptions.get(4))).toBe('Consumer');
await permissionsPage.addPermissionsDialog.selectOption('Collaborator');
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Collaborator');
await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email);
await permissionsPage.addPermissionsDialog.selectOption('Coordinator');
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Coordinator');
await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email);
await permissionsPage.addPermissionsDialog.selectOption('Editor');
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Editor');
await permissionsPage.addPermissionsDialog.clickRoleDropdownByUserOrGroupName(filePermissionUser.email);
await permissionsPage.addPermissionsDialog.selectOption('Consumer');
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.email)).toEqual('Consumer');
@@ -302,9 +315,14 @@ describe('Permissions Component', () => {
await permissionsPage.addPermissionsDialog.clickDeletePermissionButton();
await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDeleted(filePermissionUser.email);
});
});
});
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => {
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C276993] Role Consumer', async () => {
await loginPage.login(filePermissionUser.email, filePermissionUser.password);
await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
@@ -428,5 +446,5 @@ describe('Permissions Component', () => {
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions');
});
});
});
});

View File

@@ -165,6 +165,8 @@ describe('Permissions Component', () => {
await loginPage.login(folderOwnerUser.email, folderOwnerUser.password);
await BrowserActions.getUrl(browser.baseUrl + '/files/' + publicSite.entry.guid);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
it('[C277002] Should display the Role Site dropdown', async () => {

View File

@@ -62,7 +62,7 @@ describe('Share file', () => {
return sharedLinkEntry.entry.nodeId === nodeIdSharedFile;
});
return sharedLink !== null;
return !!sharedLink;
};
const apiCall = async () => {
@@ -162,6 +162,7 @@ describe('Share file', () => {
});
describe('Shared link preview', () => {
beforeEach(async () => {
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.clickContentServicesButton();
@@ -204,6 +205,7 @@ describe('Share file', () => {
const sharedLink = await shareDialog.getShareLink();
await shareDialog.clickCloseButton();
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});

View File

@@ -120,6 +120,7 @@ describe('Unshare file', () => {
describe('with permission', () => {
afterAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await uploadActions.deleteFileOrFolder(nodeId);
});
@@ -160,7 +161,7 @@ describe('Unshare file', () => {
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, browser.baseUrl ));
await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, browser.baseUrl));
await errorPage.checkErrorCode();
});
});
@@ -173,7 +174,7 @@ describe('Unshare file', () => {
it('[C286555] Should NOT be able to unshare file without permission', async () => {
await navBar.goToSite(testSite);
await contentListPage.doubleClickRow('documentLibrary');
await contentServicesPage.openFolder('documentLibrary');
await contentListPage.selectRow(nodeBody.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();

View File

@@ -60,9 +60,7 @@ describe('Social component', () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(componentOwner);
await usersActions.createUser(componentVisitor);
await usersActions.createUser(secondComponentVisitor);
await apiService.getInstance().login(componentOwner.email, componentOwner.password);
@@ -88,6 +86,7 @@ describe('Social component', () => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await uploadActions.deleteFileOrFolder(emptyFile.entry.email);
});

View File

@@ -79,7 +79,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentListPage.doubleClickRow(folderName);
await contentServicesPage.openFolder(folderName);
await contentListPage.waitForTableBody();
});

View File

@@ -69,19 +69,16 @@ describe('Tag component', () => {
await apiService.getInstance().core.tagsApi.addTag(nodeId, tags);
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.clickTagButton();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
await loginPage.login(acsUser.email, acsUser.password);
});
it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => {
await navigationBarPage.clickTagButton();
await expect(await tagPage.getNodeId()).toEqual('');
await expect(await tagPage.getNewTagPlaceholder()).toEqual('New Tag');
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
@@ -164,14 +161,4 @@ describe('Tag component', () => {
await tagPage.checkShowLessButtonIsNotDisplayed();
});
it('[C260378] Should be possible to add multiple tags', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[2]);
await browser.sleep(5000); // wait CS return tags
await tagPage.checkTagListIsOrderedAscending();
await tagPage.checkTagListByNodeIdIsOrderedAscending();
await tagPage.checkTagListContentServicesIsOrderedAscending();
});
});

View File

@@ -63,17 +63,20 @@ describe('Trashcan - Pagination', () => {
const fileNames = StringUtil.generateFilesNames(10, noOfFiles + 9, pagination.base, pagination.extension);
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
acsUser = await usersActions.createUser();
await apiService.getInstance().login(acsUser.email, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-');
const emptyFiles: any = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
for (const entry of emptyFiles.list.entries) {
await apiService.getInstance().node.deleteNode(entry.entry.id).then(() => {}, async () => {
await apiService.getInstance().node.deleteNode(entry.entry.id);
});
}
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterAll(async () => {
@@ -82,7 +85,7 @@ describe('Trashcan - Pagination', () => {
afterEach(async () => {
await browser.refresh();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C272811] Should be able to set Items per page to 20', async () => {

View File

@@ -134,6 +134,9 @@ describe('Upload component - Excluded Files', () => {
await uploadToggles.enableFolderUpload();
await contentServicesPage.uploadFolder(folderUpload.location);
await contentServicesPage.checkContentIsDisplayed(folderUpload.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();

View File

@@ -17,7 +17,7 @@
import {
ApiService,
BrowserActions, BrowserVisibility,
BrowserActions,
LoginPage,
UploadActions,
UserModel,
@@ -29,7 +29,6 @@ import { UploadTogglesPage } from '../../core/pages/dialog/upload-toggles.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { VersionManagePage } from '../../core/pages/version-manager.page';
import { FolderModel } from '../../models/ACS/folder.model';
describe('Upload component', () => {
@@ -68,30 +67,6 @@ describe('Upload component', () => {
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
const parentFolder = new FolderModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_location
});
const fileInsideParentFolder = new FolderModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_location
});
const subFolder = new FolderModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_location
});
const fileInsideSubFolder = new FolderModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_location
});
const adfBigFolder = new FolderModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.ADF_FOLDER.folder_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.ADF_FOLDER.folder_location
});
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
acsUser = await usersActions.createUser();
@@ -209,46 +184,4 @@ describe('Upload component', () => {
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291893] Should enable folder upload in selected node', async () => {
await contentServicesPage.checkUploadButton();
await expect(await uploadToggles.checkFolderUploadToggleIsNotEnabled()).toBe(true);
await uploadToggles.enableFolderUpload();
await expect(await uploadToggles.checkFolderUploadToggleIsEnabled()).toBe(true);
await contentServicesPage.uploadFolder(parentFolder.location);
await uploadDialog.fileIsUploaded(fileInsideParentFolder.name);
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.openFolder(parentFolder.name);
await expect(await uploadToggles.checkFolderUploadToggleIsNotEnabled()).toBe(true);
await uploadToggles.enableFolderUpload();
await expect(await uploadToggles.checkFolderUploadToggleIsEnabled()).toBe(true);
await contentServicesPage.uploadFolder(subFolder.location);
await uploadDialog.fileIsUploaded(fileInsideSubFolder.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.enableFolderUpload();
await browser.executeScript(` setInterval(() => {
if(document.querySelector('[data-automation-id="adf"]')){
document.querySelector("#adf-upload-dialog-cancel-all").click();
document.querySelector("#adf-upload-dialog-cancel").click();
}
}, 2000)`);
await contentServicesPage.uploadFolder(adfBigFolder.location);
await uploadDialog.fileIsUploaded('a_png_noBackground_file.PNG');
await uploadDialog.fileIsCancelled('a_png_noBackground_file.PNG');
await BrowserVisibility.waitUntilElementHasText(uploadDialog.title, 'Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.openFolder(adfBigFolder.name);
await browser.sleep(2000); // We need to wai when we upload too many files we have to wait the revert
await expect(contentServicesPage.numberOfResultsDisplayed()).toBe(0);
});
});

View File

@@ -181,10 +181,11 @@ describe('Upload component', () => {
it('[C260174] Should be possible to set a max size', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('400');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
@@ -194,8 +195,6 @@ describe('Upload component', () => {
await uploadToggles.addMaxSize('399');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);