mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ESLint: cleanup await expect
from protractor tests (#9630)
This commit is contained in:
@@ -15,14 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
@@ -66,7 +59,6 @@ describe('Comment', () => {
|
||||
});
|
||||
|
||||
describe('component', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
@@ -100,9 +92,9 @@ describe('Comment', () => {
|
||||
await commentsPage.checkCommentInputIsDisplayed();
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.test);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
expect(await commentsPage.getMessage(0)).toEqual(comments.test);
|
||||
expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
it('[C276948] Should be able to add a comment on a file', async () => {
|
||||
@@ -116,9 +108,9 @@ describe('Comment', () => {
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
expect(await commentsPage.getMessage(0)).toEqual(comments.first);
|
||||
expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
it('[C280021] Should be able to add a multiline comment on a file', async () => {
|
||||
@@ -132,17 +124,17 @@ describe('Comment', () => {
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
|
||||
expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
|
||||
await commentsPage.addComment(comments.second);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (2)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
expect(await commentsPage.getMessage(0)).toEqual(comments.second);
|
||||
expect(await commentsPage.getUserName(0)).toEqual(userFullName);
|
||||
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -169,16 +169,16 @@ describe('Content Services Viewer', () => {
|
||||
const initialHeight = await viewerPage.getCanvasHeight();
|
||||
|
||||
await viewerPage.clickZoomInButton();
|
||||
await expect(+(await viewerPage.getCanvasWidth())).toBeGreaterThan(+initialWidth);
|
||||
await expect(+(await viewerPage.getCanvasHeight())).toBeGreaterThan(+initialHeight);
|
||||
expect(+(await viewerPage.getCanvasWidth())).toBeGreaterThan(+initialWidth);
|
||||
expect(+(await viewerPage.getCanvasHeight())).toBeGreaterThan(+initialHeight);
|
||||
|
||||
await viewerPage.clickActualSize();
|
||||
await expect(+(await viewerPage.getCanvasWidth())).toEqual(+initialWidth);
|
||||
await expect(+(await viewerPage.getCanvasHeight())).toEqual(+initialHeight);
|
||||
expect(+(await viewerPage.getCanvasWidth())).toEqual(+initialWidth);
|
||||
expect(+(await viewerPage.getCanvasHeight())).toEqual(+initialHeight);
|
||||
|
||||
await viewerPage.clickZoomOutButton();
|
||||
await expect(+(await viewerPage.getCanvasWidth())).toBeLessThan(+initialWidth);
|
||||
await expect(+(await viewerPage.getCanvasHeight())).toBeLessThan(+initialHeight);
|
||||
expect(+(await viewerPage.getCanvasWidth())).toBeLessThan(+initialWidth);
|
||||
expect(+(await viewerPage.getCanvasHeight())).toBeLessThan(+initialHeight);
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
@@ -298,7 +298,7 @@ describe('Content Services Viewer', () => {
|
||||
|
||||
await viewerPage.checkZoomInButtonIsNotDisplayed();
|
||||
await viewerPage.checkUnknownFormatIsDisplayed();
|
||||
await expect(await viewerPage.getUnknownFormatMessage()).toBe("Couldn't load preview. Unknown format.");
|
||||
expect(await viewerPage.getUnknownFormatMessage()).toBe(`Couldn't load preview. Unknown format.`);
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
@@ -397,6 +397,12 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Upload a new version of a file
|
||||
*
|
||||
* @param originalFileName The name of the original file
|
||||
* @param newVersionLocation The location of the new version
|
||||
*/
|
||||
async function uploadNewVersion(originalFileName: string, newVersionLocation: string): Promise<void> {
|
||||
await contentServicesPage.doubleClickRow(originalFileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
@@ -410,14 +416,25 @@ describe('Content Services Viewer', () => {
|
||||
await browser.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preview an unsupported file
|
||||
*
|
||||
* @param unsupportedFileName The name of the unsupported file
|
||||
*/
|
||||
async function previewUnsupportedFile(unsupportedFileName: string): Promise<void> {
|
||||
await contentServicesPage.doubleClickRow(unsupportedFileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.checkUnknownFormatIsDisplayed();
|
||||
await expect(await viewerPage.getUnknownFormatMessage()).toBe("Couldn't load preview. Unknown format.");
|
||||
expect(await viewerPage.getUnknownFormatMessage()).toBe(`Couldn't load preview. Unknown format.`);
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the name of the file in the viewer
|
||||
*
|
||||
* @param fileName The name of the file to be changed
|
||||
* @param newName The new name of the file
|
||||
*/
|
||||
async function changeFileNameInViewer(fileName: string, newName: string): Promise<void> {
|
||||
await contentServicesPage.doubleClickRow(fileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
@@ -114,12 +114,12 @@ 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 files and folders', async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await contentServicesPage.checkContentIsDisplayed(folderName);
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
|
||||
await expect(await contentServicesPage.getDocumentListRowNumber()).toBe(4);
|
||||
expect(await contentServicesPage.getDocumentListRowNumber()).toBe(4);
|
||||
});
|
||||
|
||||
it('[C279927] Should display default columns', async () => {
|
||||
@@ -182,27 +182,27 @@ describe('Document List Component', () => {
|
||||
});
|
||||
|
||||
it('[C260112] Should be able to sort by name (Ascending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272770] Should be able to sort by name (Descending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272771] Should be able to sort by author (Ascending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272772] Should be able to sort by author (Descending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272773] Should be able to sort by date (Ascending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272774] Should be able to sort by date (Descending)', async () => {
|
||||
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
|
||||
expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ArrayUtil,
|
||||
FileBrowserUtil,
|
||||
LocalStorageUtil,
|
||||
@@ -95,11 +96,11 @@ describe('Document List - Pagination', () => {
|
||||
|
||||
it('[C260062] Should use default pagination settings', async () => {
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
@@ -109,11 +110,11 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('20');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
@@ -121,7 +122,7 @@ describe('Document List - Pagination', () => {
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
@@ -133,45 +134,45 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('5');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${5 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${5 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||
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('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${5 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${5 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
|
||||
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('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${5 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${5 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
|
||||
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('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${5 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${5 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(5);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
});
|
||||
@@ -182,24 +183,24 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('10');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${10 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${10 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
|
||||
await paginationPage.clickOnNextPage();
|
||||
currentPage++;
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${10 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${10 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(10);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
|
||||
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('10');
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
currentPage = 1;
|
||||
@@ -211,25 +212,25 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('15');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
|
||||
currentPage++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - 15);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${nrOfFiles} of ${nrOfFiles}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - 15);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
});
|
||||
|
||||
it('[C91320] Pagination should preserve sorting', async () => {
|
||||
@@ -238,35 +239,35 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('20');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
|
||||
expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
|
||||
|
||||
await contentServicesPage.sortByName('DESC');
|
||||
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
|
||||
await paginationPage.selectItemsPerPage('5');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
|
||||
await paginationPage.selectItemsPerPage('10');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
|
||||
});
|
||||
|
||||
it('[C260107] Should not display pagination bar when a folder is empty', async () => {
|
||||
await paginationPage.selectItemsPerPage('5');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
await contentServicesPage.checkPaginationIsNotDisplayed();
|
||||
@@ -279,45 +280,45 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('15');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${15 * currentPage} of ${secondSetNumber}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(15);
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
|
||||
|
||||
currentPage++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 15);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('15');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${secondSetNumber} of ${secondSetNumber}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 15);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
|
||||
|
||||
currentPage = 1;
|
||||
await paginationPage.selectItemsPerPage('20');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${20 * currentPage} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(20);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${20 * currentPage} of ${secondSetNumber}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(20);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
|
||||
|
||||
currentPage++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 21-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 20);
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('20');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 21-${secondSetNumber} of ${secondSetNumber}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - 20);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
|
||||
expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C216321] Should be able to modify the supported page size value', async () => {
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21]));
|
||||
await contentServicesPage.goToDocumentList();
|
||||
@@ -333,7 +334,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '21']);
|
||||
expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '21']);
|
||||
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
@@ -341,12 +342,12 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage('21');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('21');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('21');
|
||||
await browser.refresh();
|
||||
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-21 of ${numberOfFilesAfterUpload}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(21);
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-21 of ${numberOfFilesAfterUpload}`);
|
||||
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(21);
|
||||
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
|
||||
await browser.refresh();
|
||||
@@ -355,7 +356,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
});
|
||||
|
||||
it('[C272767] Should propagate the option chosen regarding displaying items per page to files/folders inside a folder', async () => {
|
||||
@@ -363,22 +364,24 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
const nodeIdSubFolder6 = await contentServicesPage.getAttributeValueForElement('subfolder6', 'Node id');
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
@@ -387,9 +390,9 @@ describe('Document List - Pagination', () => {
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of 2');
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
|
||||
expect(await paginationPage.getTotalPages()).toEqual('of 2');
|
||||
|
||||
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
|
||||
});
|
||||
@@ -399,13 +402,14 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
@@ -413,13 +417,13 @@ describe('Document List - Pagination', () => {
|
||||
await browser.refresh();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-5 of ${numberOfSubFolders}`);
|
||||
|
||||
await contentServicesPage.chooseSelectionMode('Single');
|
||||
|
||||
await contentServicesPage.selectFolder('subfolder1');
|
||||
await paginationPage.clickOnNextPage();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
await contentServicesPage.selectFolderWithCommandKey('subfolder6');
|
||||
await contentServicesPage.clickDownloadButton();
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
ModelActions,
|
||||
@@ -46,7 +47,7 @@ describe('content type', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const randomString = StringUtil.generateRandomString();
|
||||
|
||||
const model: CustomModel = {
|
||||
const model: CustomModel = {
|
||||
name: `test-${randomString}`,
|
||||
namespaceUri: `http://www.customModel.com/model/${randomString}/1.0`,
|
||||
namespacePrefix: `e2e-${randomString}`,
|
||||
@@ -55,7 +56,12 @@ describe('content type', () => {
|
||||
status: 'DRAFT'
|
||||
};
|
||||
const type: CustomType = { name: `test-type-${randomString}`, parentName: 'cm:content', title: `Test type - ${randomString}` };
|
||||
const property = { name: `test-property-${randomString}`, title: `Test property - ${randomString}`, dataType: 'd:text', defaultValue: randomString };
|
||||
const property = {
|
||||
name: `test-property-${randomString}`,
|
||||
title: `Test property - ${randomString}`,
|
||||
dataType: 'd:text',
|
||||
defaultValue: randomString
|
||||
};
|
||||
const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
const docxFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||
@@ -63,12 +69,12 @@ describe('content type', () => {
|
||||
});
|
||||
let acsUser: UserModel;
|
||||
|
||||
beforeAll( async () => {
|
||||
beforeAll(async () => {
|
||||
try {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await modelActions.createModel(model);
|
||||
await modelActions.createType(model.name, type);
|
||||
await modelActions.addPropertyToType(model.name, type.name, [property]);
|
||||
await modelActions.createType(model.name, type);
|
||||
await modelActions.addPropertyToType(model.name, type.name, [property]);
|
||||
await modelActions.activateCustomModel(model.name);
|
||||
await modelActions.isCustomTypeSearchable(type.title);
|
||||
|
||||
@@ -79,7 +85,6 @@ describe('content type', () => {
|
||||
pdfFile.id = filePdfNode.entry.id;
|
||||
const docsNode = await uploadActions.uploadFile(docxFileModel.location, docxFileModel.name, '-my-');
|
||||
docxFileModel.id = docsNode.entry.id;
|
||||
|
||||
} catch (e) {
|
||||
fail('Failed to setup custom types :: ' + JSON.stringify(e, null, 2));
|
||||
}
|
||||
@@ -98,17 +103,17 @@ describe('content type', () => {
|
||||
}
|
||||
});
|
||||
|
||||
beforeEach( async () => {
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterEach( async () => {
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C593560] Should the user be able to select a new content type and save it only after the confirmation dialog', async () => {
|
||||
it('[C593560] Should the user be able to select a new content type and save it only after the confirmation dialog', async () => {
|
||||
await BrowserActions.getUrl(browser.baseUrl + `/files(overlay:files/${pdfFile.id}/view)`);
|
||||
await viewerPage.checkFileIsLoaded(pdfFile.name);
|
||||
await viewerPage.clickInfoButton();
|
||||
@@ -116,19 +121,20 @@ describe('content type', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
const defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
await expect(defaultType).toBe(true, 'Content type not found');
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
const defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
expect(defaultType).toBe(true);
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
|
||||
await expect(await metadataViewPage.changeContentType(type.title)).toBe(true, 'Failed to update node type.');
|
||||
expect(await metadataViewPage.changeContentType(type.title)).toBe(true, 'Failed to update node type.');
|
||||
await metadataViewPage.clickSaveGeneralMetadata();
|
||||
await metadataViewPage.checkConfirmDialogDisplayed();
|
||||
await metadataViewPage.applyNodeProperties();
|
||||
|
||||
await expect(await metadataViewPage.checkPropertyDisplayed(`properties.${model.namespacePrefix}:${property.name}`))
|
||||
.toContain(property.defaultValue, 'Custom property not found');
|
||||
expect(await metadataViewPage.checkPropertyDisplayed(`properties.${model.namespacePrefix}:${property.name}`)).toContain(
|
||||
property.defaultValue
|
||||
);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
@@ -141,15 +147,16 @@ describe('content type', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
const customType = (await metadataViewPage.hasContentType(type.title)) || (await metadataViewPage.hasContentType(`${model.namespacePrefix}:${type.name}`));
|
||||
await expect(customType).toBe(true, 'Custom type not found');
|
||||
await expect(await metadataViewPage.getPropertyText(`properties.${model.namespacePrefix}:${property.name}`)).toContain(property.defaultValue);
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
const customType =
|
||||
(await metadataViewPage.hasContentType(type.title)) || (await metadataViewPage.hasContentType(`${model.namespacePrefix}:${type.name}`));
|
||||
expect(customType).toBe(true);
|
||||
expect(await metadataViewPage.getPropertyText(`properties.${model.namespacePrefix}:${property.name}`)).toContain(property.defaultValue);
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
|
||||
it('[C593559] Should the user be able to select a new content type and not save it when press cancel in the confirmation dialog', async () => {
|
||||
it('[C593559] Should the user be able to select a new content type and not save it when press cancel in the confirmation dialog', async () => {
|
||||
await BrowserActions.getUrl(browser.baseUrl + `/files(overlay:files/${docxFileModel.id}/view)`);
|
||||
await viewerPage.checkFileIsLoaded(docxFileModel.name);
|
||||
await viewerPage.clickInfoButton();
|
||||
@@ -157,13 +164,13 @@ describe('content type', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
let defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
await expect(defaultType).toBe(true, 'Content type not found');
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
let defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
expect(defaultType).toBe(true);
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
|
||||
await expect(await metadataViewPage.changeContentType(type.title)).toBe(true, 'Failed to update node type.');
|
||||
expect(await metadataViewPage.changeContentType(type.title)).toBe(true);
|
||||
await metadataViewPage.clickSaveGeneralMetadata();
|
||||
|
||||
await metadataViewPage.checkConfirmDialogDisplayed();
|
||||
@@ -180,9 +187,9 @@ describe('content type', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
await expect(defaultType).toBe(true, 'Content type not found');
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
defaultType = (await metadataViewPage.hasContentType('Content')) || (await metadataViewPage.hasContentType('cm:content'));
|
||||
expect(defaultType).toBe(true);
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
});
|
||||
|
@@ -109,7 +109,7 @@ describe('permissions', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
|
||||
await metadataViewPage.clickMetadataGroup('EXIF');
|
||||
|
||||
@@ -127,7 +127,7 @@ describe('permissions', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
expect(await viewerPage.getActiveTab()).toEqual('Properties');
|
||||
|
||||
await metadataViewPage.clickMetadataGroup('EXIF');
|
||||
|
||||
|
@@ -15,14 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
CheckboxPage,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, CheckboxPage, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
|
||||
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
@@ -30,7 +23,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
|
||||
describe('CardView Component - properties', () => {
|
||||
|
||||
const METADATA = {
|
||||
DATA_FORMAT: 'mmm dd yyyy',
|
||||
TITLE: 'Details',
|
||||
@@ -71,7 +63,7 @@ describe('CardView Component - properties', () => {
|
||||
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await viewerPage.clickCloseButton();
|
||||
@@ -84,8 +76,7 @@ describe('CardView Component - properties', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
await metadataViewPage.clickMetadataGroup('EXIF');
|
||||
|
||||
@@ -114,7 +105,6 @@ describe('CardView Component - properties', () => {
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
|
||||
await metadataViewPage.checkMetadataGroupIsExpand('properties');
|
||||
await metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
|
||||
|
||||
@@ -129,7 +119,7 @@ describe('CardView Component - properties', () => {
|
||||
|
||||
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
|
||||
await metadataViewPage.checkMetadataGroupIsExpand('properties');
|
||||
});
|
||||
});
|
||||
|
||||
it('[C280559] Should show/hide the default metadata properties when displayDefaultProperties is true/false', async () => {
|
||||
await viewerPage.viewFile(pngFileModel.name);
|
||||
|
@@ -134,9 +134,9 @@ describe('Metadata component', () => {
|
||||
await viewerPage.checkInfoSideBarIsNotDisplayed();
|
||||
await viewerPage.clickInfoButton();
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
});
|
||||
|
||||
it('[C245654] Should be possible edit the basic Metadata Info of a Document', async () => {
|
||||
@@ -145,15 +145,13 @@ describe('Metadata component', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
|
||||
await metadataViewPage.enterPropertyText('properties.cm:name', 'exampleText');
|
||||
await metadataViewPage.clickResetMetadata();
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(
|
||||
browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
);
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
await metadataViewPage.enterPropertyText('properties.cm:name', 'exampleText.png');
|
||||
@@ -161,9 +159,9 @@ describe('Metadata component', () => {
|
||||
await metadataViewPage.enterDescriptionText('example description');
|
||||
await metadataViewPage.clickSaveGeneralMetadata();
|
||||
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual('exampleText.png');
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual('exampleText.png');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
@@ -174,14 +172,12 @@ describe('Metadata component', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual('exampleText.png');
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual('exampleText.png');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
await metadataViewPage.enterPropertyText('properties.cm:name', browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(
|
||||
browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
);
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
await metadataViewPage.clickSaveGeneralMetadata();
|
||||
});
|
||||
|
||||
@@ -190,7 +186,7 @@ describe('Metadata component', () => {
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
await metadataViewPage.clickMetadataGroupEditIcon('EXIF');
|
||||
|
||||
await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
|
||||
@@ -198,9 +194,9 @@ describe('Metadata component', () => {
|
||||
await metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
|
||||
await metadataViewPage.clickSaveMetadata();
|
||||
|
||||
await expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
|
||||
await expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
|
||||
await expect(await metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
|
||||
expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
|
||||
expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
|
||||
expect(await metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -214,13 +210,13 @@ describe('Metadata component', () => {
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
await metadataViewPage.isEditGeneralIconDisplayed();
|
||||
|
||||
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
await metadataViewPage.clickEditIconGeneral();
|
||||
|
||||
await metadataViewPage.enterDescriptionText('check author example description');
|
||||
await metadataViewPage.clickSaveGeneralMetadata();
|
||||
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
|
||||
expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
@@ -233,7 +229,7 @@ describe('Metadata component', () => {
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
await expect(await metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
|
||||
expect(await metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
|
@@ -23,7 +23,6 @@ import { UploadTogglesPage } from '../../core/pages/dialog/upload-toggles.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
|
||||
describe('Upload component', async () => {
|
||||
|
||||
const apiService = createApiService();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const uploadDialog = new UploadDialogPage();
|
||||
@@ -58,14 +57,13 @@ describe('Upload component', async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
const deleteNodesInCurrentPage = async function() {
|
||||
const deleteNodesInCurrentPage = async () => {
|
||||
const nodeList = await contentServicesPage.getElementsDisplayedId();
|
||||
|
||||
for (const node of nodeList) {
|
||||
try {
|
||||
await uploadActions.deleteFileOrFolder(node);
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -74,18 +72,20 @@ describe('Upload component', async () => {
|
||||
|
||||
await contentServicesPage.uploadFile(mediumFile.location);
|
||||
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(mediumFile.name);
|
||||
});
|
||||
|
||||
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', async () => {
|
||||
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
|
||||
await browser.executeScript(
|
||||
' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)'
|
||||
);
|
||||
|
||||
await contentServicesPage.uploadFile(largeFile.location);
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
|
||||
@@ -94,12 +94,14 @@ describe('Upload component', async () => {
|
||||
it('[C272793] Should be able to cancel multiple files upload', async () => {
|
||||
await uploadToggles.enableMultipleFileUpload();
|
||||
|
||||
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
|
||||
await browser.executeScript(
|
||||
' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)'
|
||||
);
|
||||
|
||||
await contentServicesPage.uploadMultipleFile([mediumFile.location, largeFile.location]);
|
||||
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(mediumFile.name);
|
||||
|
@@ -24,7 +24,6 @@ import { browser } from 'protractor';
|
||||
import { VersionManagePage } from '../pages/version-manager.page';
|
||||
|
||||
describe('Upload component', () => {
|
||||
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const uploadDialog = new UploadDialogPage();
|
||||
const uploadToggles = new UploadTogglesPage();
|
||||
@@ -90,17 +89,17 @@ describe('Upload component', () => {
|
||||
|
||||
await uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
await uploadDialog.checkCloseButtonIsDisplayed();
|
||||
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
await uploadDialog.minimizeUploadDialog();
|
||||
await uploadDialog.dialogIsMinimized();
|
||||
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
await uploadDialog.maximizeUploadDialog();
|
||||
await uploadDialog.dialogIsDisplayed();
|
||||
await uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
await uploadDialog.checkCloseButtonIsDisplayed();
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
@@ -112,7 +111,7 @@ describe('Upload component', () => {
|
||||
|
||||
await uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
await uploadDialog.checkCloseButtonIsDisplayed();
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
|
||||
await uploadDialog.checkCloseButtonIsDisplayed();
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
@@ -144,7 +143,7 @@ describe('Upload component', () => {
|
||||
await contentServicesPage.uploadMultipleFile(filesLocation);
|
||||
await contentServicesPage.checkContentsAreDisplayed(filesName);
|
||||
await uploadDialog.filesAreUploaded(filesName);
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await uploadToggles.disableMultipleFileUpload();
|
||||
|
@@ -190,7 +190,7 @@ describe('Upload component', () => {
|
||||
await uploadToggles.enableMaxSize();
|
||||
await uploadToggles.addMaxSize('0');
|
||||
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
|
||||
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
|
||||
// expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
|
||||
|
||||
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
|
||||
await contentServicesPage.uploadFile(emptyFile.location);
|
||||
@@ -250,6 +250,6 @@ describe('Upload component', () => {
|
||||
await contentServicesPage.uploadFile(pdfFileModel.location);
|
||||
|
||||
await uploadDialog.displayTooltip();
|
||||
await expect(await uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
|
||||
expect(await uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
|
||||
});
|
||||
});
|
||||
|
@@ -25,7 +25,6 @@ import CONSTANTS = require('../../util/constants');
|
||||
import { SiteEntry, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Upload - User permission', () => {
|
||||
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const uploadDialog = new UploadDialogPage();
|
||||
const loginPage = new LoginPage();
|
||||
@@ -84,7 +83,6 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
describe('Consumer permissions', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
@@ -99,7 +97,7 @@ describe('Upload - User permission', () => {
|
||||
await uploadDialog.fileIsError(emptyFile.name);
|
||||
await uploadDialog.displayTooltip();
|
||||
|
||||
await expect(await uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
|
||||
expect(await uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
|
||||
});
|
||||
|
||||
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', async () => {
|
||||
@@ -118,7 +116,7 @@ describe('Upload - User permission', () => {
|
||||
await contentServicesPage.uploadFile(emptyFile.location);
|
||||
|
||||
const message = await new SnackbarPage().getSnackBarMessage();
|
||||
expect(message).toEqual('You don\'t have the create permission to upload the content');
|
||||
expect(message).toEqual(`You don't have the create permission to upload the content`);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
BrowserActions,
|
||||
BrowserVisibility,
|
||||
FileBrowserUtil,
|
||||
@@ -33,7 +34,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { VersionManagePage } from '../pages/version-manager.page';
|
||||
|
||||
describe('Version component actions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
@@ -54,7 +54,6 @@ describe('Version component actions', () => {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_location
|
||||
});
|
||||
let uploadActions;
|
||||
|
||||
const bigFileToCancel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_name,
|
||||
@@ -62,7 +61,7 @@ describe('Version component actions', () => {
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
uploadActions = new UploadActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
await apiService.loginWithProfile('admin');
|
||||
acsUser = await usersActions.createUser();
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
@@ -72,7 +71,7 @@ describe('Version component actions', () => {
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await contentServicesPage.versionManagerContent(txtFileModel.name);
|
||||
@@ -84,14 +83,14 @@ describe('Version component actions', () => {
|
||||
|
||||
it('[C280003] Should not be possible delete a file version if there is only one version', async () => {
|
||||
await versionManagePage.clickActionButton('1.0');
|
||||
await expect(await element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
|
||||
expect(await element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
|
||||
await versionManagePage.closeActionsMenu();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
|
||||
});
|
||||
|
||||
it('[C280004] Should not be possible restore the version if there is only one version', async () => {
|
||||
await versionManagePage.clickActionButton('1.0');
|
||||
await expect(await element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
|
||||
expect(await element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
|
||||
await versionManagePage.closeActionsMenu();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
|
||||
});
|
||||
@@ -169,11 +168,13 @@ describe('Version component actions', () => {
|
||||
|
||||
await versionManagePage.showNewVersionButton.click();
|
||||
|
||||
await browser.executeScript(' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
|
||||
await browser.executeScript(
|
||||
' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)'
|
||||
);
|
||||
await versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
|
||||
await versionManagePage.closeVersionDialog();
|
||||
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
|
||||
await browser.refresh();
|
||||
|
||||
|
@@ -16,15 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import {
|
||||
createApiService,
|
||||
LoginPage,
|
||||
SnackbarPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, SnackbarPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { VersionManagePage } from '../pages/version-manager.page';
|
||||
import { UploadDialogPage } from '../pages/upload-dialog.page';
|
||||
@@ -34,7 +26,6 @@ import CONSTANTS = require('../../util/constants');
|
||||
import { NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Version component permissions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
@@ -115,9 +106,9 @@ describe('Version component permissions', () => {
|
||||
Object.assign(lockFileModel, lockFileUploaded.entry);
|
||||
|
||||
await nodesApi.lockNode(lockFileModel.id, {
|
||||
type: 'FULL',
|
||||
lifetime: 'PERSISTENT'
|
||||
});
|
||||
type: 'FULL',
|
||||
lifetime: 'PERSISTENT'
|
||||
});
|
||||
|
||||
await apiService.login(fileCreatorUser.username, fileCreatorUser.password);
|
||||
|
||||
@@ -161,8 +152,8 @@ describe('Version component permissions', () => {
|
||||
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
await versionManagePage.deleteFileVersion('1.1');
|
||||
await versionManagePage.confirmAccept.click();
|
||||
@@ -176,7 +167,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
it('[C277204] Should be disabled the option for locked file', async () => {
|
||||
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
|
||||
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
|
||||
expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -200,7 +191,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', async () => {
|
||||
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
|
||||
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage version is enabled');
|
||||
expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -234,8 +225,8 @@ describe('Version component permissions', () => {
|
||||
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
await versionManagePage.deleteFileVersion('1.1');
|
||||
await versionManagePage.confirmAccept.click();
|
||||
@@ -256,7 +247,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
it('[C277202] Should be disabled the option for a locked file', async () => {
|
||||
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
|
||||
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
|
||||
expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -290,8 +281,8 @@ describe('Version component permissions', () => {
|
||||
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
await versionManagePage.deleteFileVersion('1.1');
|
||||
await versionManagePage.confirmAccept.click();
|
||||
@@ -310,12 +301,12 @@ describe('Version component permissions', () => {
|
||||
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
await versionManagePage.clickActionButton('1.1');
|
||||
|
||||
await expect(await element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
|
||||
expect(await element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
|
||||
|
||||
await versionManagePage.closeActionsMenu();
|
||||
|
||||
@@ -324,7 +315,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
it('[C277203] Should a user with Collaborator permission not be able to upload a new version for a locked file', async () => {
|
||||
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
|
||||
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
|
||||
expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -16,20 +16,13 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { createApiService,
|
||||
BrowserVisibility,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions, ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, BrowserVisibility, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { VersionManagePage } from '../pages/version-manager.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Version Properties', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
@@ -111,9 +104,8 @@ describe('Version Properties', () => {
|
||||
await versionManagePage.commentText.typeText('Example comment text');
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
|
||||
expect(await versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
|
||||
await versionManagePage.disableComments();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-item-comment-1.1"]`)));
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -23,7 +23,6 @@ import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Version component', () => {
|
||||
|
||||
let txtUploadedFile;
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
@@ -79,14 +78,14 @@ describe('Version component', () => {
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
await contentServicesPage.versionManagerContent(txtFileModel.name);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C272768] Should be visible the first file version when you upload a file', async () => {
|
||||
await versionManagePage.showNewVersionButton.waitVisible();
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.0');
|
||||
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it('[C279995] Should show/hide the new upload file options when click on add New version/cancel button', async () => {
|
||||
@@ -114,12 +113,12 @@ describe('Version component', () => {
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.0');
|
||||
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.1');
|
||||
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it('[C269084] Should be possible add a comment when add a new version', async () => {
|
||||
@@ -128,9 +127,9 @@ describe('Version component', () => {
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('1.2');
|
||||
await expect(await versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
|
||||
await expect(await versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
|
||||
await expect(await versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
|
||||
expect(await versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
|
||||
expect(await versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
|
||||
expect(await versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
|
||||
});
|
||||
|
||||
it('[C275719] Should be possible preview the file when you add a new version', async () => {
|
||||
@@ -140,7 +139,7 @@ describe('Version component', () => {
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('2.0');
|
||||
await expect(await versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
|
||||
expect(await versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
|
||||
|
||||
await versionManagePage.showNewVersionButton.click();
|
||||
await versionManagePage.minorRadio.click();
|
||||
@@ -148,6 +147,6 @@ describe('Version component', () => {
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
|
||||
|
||||
await versionManagePage.checkFileVersionExist('2.1');
|
||||
await expect(await versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
|
||||
expect(await versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user