Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ export class NodeActions {
lockNode(alfrescoJsApi, nodeId: string, allowOwner?: string) {
return alfrescoJsApi.nodes.lockNode(nodeId, {
'type': allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL',
'lifetime': 'PERSISTENT'
type: allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL',
lifetime: 'PERSISTENT'
});
}
+14 -20
View File
@@ -20,11 +20,11 @@ import path = require('path');
import { browser } from 'protractor';
import remote = require('selenium-webdriver/remote');
const JS_BIND_INPUT = function (target) {
const JS_BIND_INPUT = function(target) {
const input = document.createElement('input');
input.type = 'file';
input.style.display = 'none';
input.addEventListener('change', function (event) {
input.addEventListener('change', function(event) {
target.scrollIntoView(true);
const rect = target.getBoundingClientRect();
@@ -32,7 +32,7 @@ const JS_BIND_INPUT = function (target) {
const y = rect.top + (rect.height >> 1);
const data = { files: input.files };
['dragenter', 'dragover', 'drop'].forEach(function (name) {
['dragenter', 'dragover', 'drop'].forEach(function(name) {
const mouseEvent: any = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
mouseEvent.dataTransfer = data;
@@ -46,13 +46,13 @@ const JS_BIND_INPUT = function (target) {
return input;
};
const JS_BIND_INPUT_FOLDER = function (target) {
const JS_BIND_INPUT_FOLDER = function(target) {
const input: any = document.createElement('input');
input.type = 'file';
input.style.display = 'none';
input.multiple = true;
input.webkitdirectory = true;
input.addEventListener('change', function (event) {
input.addEventListener('change', function(event) {
target.scrollIntoView(true);
const rect = target.getBoundingClientRect();
@@ -60,7 +60,7 @@ const JS_BIND_INPUT_FOLDER = function (target) {
const y = rect.top + (rect.height >> 1);
const data = { files: input.files };
['dragenter', 'dragover', 'drop'].forEach(function (name) {
['dragenter', 'dragover', 'drop'].forEach(function(name) {
const mouseEvent: any = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
mouseEvent.dataTransfer = data;
@@ -76,31 +76,25 @@ const JS_BIND_INPUT_FOLDER = function (target) {
export class DropActions {
dropFile(dropArea, filePath) {
async dropFile(dropArea, filePath) {
browser.setFileDetector(new remote.FileDetector());
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, filePath));
fs.accessSync(absolutePath, fs.constants.F_OK);
return dropArea.getWebElement().then((element) => {
browser.executeScript(JS_BIND_INPUT, element).then((input: any) => {
input.sendKeys(absolutePath);
});
});
const elem = await dropArea.getWebElement();
const input: any = await browser.executeScript(JS_BIND_INPUT, elem);
return await input.sendKeys(absolutePath);
}
dropFolder(dropArea, folderPath) {
async dropFolder(dropArea, folderPath) {
browser.setFileDetector(new remote.FileDetector());
const absolutePath = path.resolve(path.join(browser.params.testConfig.main.rootPath, folderPath));
fs.accessSync(absolutePath, fs.constants.F_OK);
return dropArea.getWebElement().then((element) => {
browser.executeScript(JS_BIND_INPUT_FOLDER, element).then((input: any) => {
input.sendKeys(absolutePath);
});
});
const elem = await dropArea.getWebElement();
const input: any = await browser.executeScript(JS_BIND_INPUT_FOLDER, elem);
return await input.sendKeys(absolutePath);
}
}
+2 -2
View File
@@ -35,7 +35,7 @@ export class UsersActions {
}
async createApsUser(alfrescoJsApi, tenantId) {
const user = new User({ tenantId: tenantId });
const user = new User({ tenantId });
await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
@@ -54,7 +54,7 @@ export class UsersActions {
}
async createApsUserWithName(alfrescoJsApi, tenantId, email, firstName, lastName) {
const user = new User({ tenantId: tenantId , email: email, firstName: firstName, lastName: lastName});
const user = new User({ tenantId , email, firstName, lastName});
await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
@@ -29,18 +29,18 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Comment Component', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const viewerPage = new ViewerPage();
const commentsPage = new CommentsPage();
const loginPage: LoginPage = new LoginPage();
const contentServicesPage: ContentServicesPage = new ContentServicesPage();
const viewerPage: ViewerPage = new ViewerPage();
const commentsPage: CommentsPage = new CommentsPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const acsUser: AcsUserModel = new AcsUserModel();
let userFullName, nodeId;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -60,18 +60,17 @@ describe('Comment Component', () => {
test: 'Test'
};
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
@@ -82,96 +81,95 @@ describe('Comment Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
await this.alfrescoJsApi.core.commentsApi.addComment(nodeId, { content: comments.test });
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
commentsPage.checkCommentsTabIsSelected();
commentsPage.checkCommentInputIsDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.test);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('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)/);
});
it('[C276948] Should be able to add a comment on a file', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnCommentsTab();
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();
commentsPage.addComment(comments.first);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.first);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('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)/);
});
it('[C280021] Should be able to add a multiline comment on a file', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnCommentsTab();
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();
commentsPage.addComment(comments.multiline);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.multiline);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('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)/);
commentsPage.addComment(comments.second);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
expect(commentsPage.getMessage(0)).toEqual(comments.second);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('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)/);
});
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnCommentsTab();
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();
commentsPage.addComment(comments.codeType);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual('First name: Last name:');
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
describe('Consumer Permissions', () => {
let site, pngUploadedFile;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
site = await this.alfrescoJsApi.core.sitesApi.createSite({
@@ -186,31 +184,29 @@ describe('Comment Component', () => {
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
done();
});
afterAll((done) => {
uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
done();
});
it('[C290147] Should NOT be able to add comments to a site file with Consumer permissions', () => {
navigationBarPage.goToSite(site);
contentServicesPage.checkAcsContainer();
it('[C290147] Should NOT be able to add comments to a site file with Consumer permissions', async () => {
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pngUploadedFile.entry.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.viewFile(pngUploadedFile.entry.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
commentsPage.checkCommentsTabIsSelected();
commentsPage.checkCommentInputIsNotDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsNotDisplayed();
});
});
});
@@ -24,7 +24,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { browser, Key } from 'protractor';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Create folder directive', function () {
describe('Create folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -34,7 +34,7 @@ describe('Create folder directive', function () {
const acsUser = new AcsUserModel();
const navigationBarPage = new NavigationBarPage();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -46,106 +46,105 @@ describe('Create folder directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
beforeEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
done();
});
it('[C260154] Should not create the folder if cancel button is clicked', () => {
it('[C260154] Should not create the folder if cancel button is clicked', async () => {
const folderName = 'cancelFolder';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folderName);
createFolderDialog.clickOnCancelButton();
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.clickOnCancelButton();
contentServicesPage.checkContentIsNotDisplayed(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C260155] Should enable the Create button only when a folder name is present', () => {
it('[C260155] Should enable the Create button only when a folder name is present', async () => {
const folderName = 'NotEnableFolder';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName(folderName);
await createFolderDialog.addFolderName(folderName);
createFolderDialog.checkCreateUpdateBtnIsEnabled();
await createFolderDialog.checkCreateUpdateBtnIsEnabled();
});
it('[C260156] Should not be possible create two folder with the same name', () => {
it('[C260156] Should not be possible create two folder with the same name', async () => {
const folderName = 'duplicate';
contentServicesPage.createNewFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.createNewFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260157] Should be possible create a folder under a folder with the same name', () => {
it('[C260157] Should be possible create a folder under a folder with the same name', async () => {
const folderName = 'sameSubFolder';
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.doubleClickRow(folderName);
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260158] Should be possible add a folder description when create a new folder', () => {
it('[C260158] Should be possible add a folder description when create a new folder', async () => {
const folderName = 'folderDescription';
const description = 'this is the description';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folderName);
createFolderDialog.addFolderDescription(description);
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.addFolderDescription(description);
createFolderDialog.clickOnCreateUpdateButton();
await createFolderDialog.clickOnCreateUpdateButton();
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.metadataContent(folderName);
await contentServicesPage.metadataContent(folderName);
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
});
it('[C260159] Should not be possible create a folder with banned character', () => {
browser.refresh();
contentServicesPage.clickOnCreateNewFolder();
it('[C260159] Should not be possible create a folder with banned character', async () => {
await browser.refresh();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName('*');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('<');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('>');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('\\');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('/');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('?');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName(':');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('|');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('*');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('<');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('>');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('\\');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('/');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('?');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName(':');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('|');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
});
});
@@ -26,7 +26,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { StringUtil } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Create library directive', function () {
describe('Create library directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -44,7 +44,7 @@ describe('Create library directive', function () {
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -57,222 +57,221 @@ describe('Create library directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
createSite = await this.alfrescoJsApi.core.sitesApi.createSite({
'title': StringUtil.generateRandomString(20).toLowerCase(),
'visibility': 'PUBLIC'
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PUBLIC'
});
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach((done) => {
contentServicesPage.goToDocumentList();
contentServicesPage.openCreateLibraryDialog();
done();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.openCreateLibraryDialog();
});
afterEach(() => {
BrowserActions.closeMenuAndDialogs();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C290158] Should display the Create Library defaults', () => {
expect(createLibraryDialog.getTitle()).toMatch('Create Library');
expect(createLibraryDialog.isNameDisplayed()).toBe(true, 'Name input field is not displayed');
expect(createLibraryDialog.isLibraryIdDisplayed()).toBe(true, 'Library ID field is not displayed');
expect(createLibraryDialog.isDescriptionDisplayed()).toBe(true, 'Library description is not displayed');
expect(createLibraryDialog.isPublicDisplayed()).toBe(true, 'Public radio button is not displayed');
expect(createLibraryDialog.isPrivateDisplayed()).toBe(true, 'Private radio button is not displayed');
expect(createLibraryDialog.isModeratedDisplayed()).toBe(true, 'Moderated radio button is not displayed');
expect(createLibraryDialog.isCreateEnabled()).toBe(false, 'Create button is not disabled');
expect(createLibraryDialog.isCancelEnabled()).toBe(true, 'Cancel button is disabled');
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public');
it('[C290158] Should display the Create Library defaults', async () => {
await expect(await createLibraryDialog.getTitle()).toMatch('Create Library');
await expect(await createLibraryDialog.isNameDisplayed()).toBe(true, 'Name input field is not displayed');
await expect(await createLibraryDialog.isLibraryIdDisplayed()).toBe(true, 'Library ID field is not displayed');
await expect(await createLibraryDialog.isDescriptionDisplayed()).toBe(true, 'Library description is not displayed');
await expect(await createLibraryDialog.isPublicDisplayed()).toBe(true, 'Public radio button is not displayed');
await expect(await createLibraryDialog.isPrivateDisplayed()).toBe(true, 'Private radio button is not displayed');
await expect(await createLibraryDialog.isModeratedDisplayed()).toBe(true, 'Moderated radio button is not displayed');
await expect(await createLibraryDialog.isCreateEnabled()).toBe(false, 'Create button is not disabled');
await expect(await createLibraryDialog.isCancelEnabled()).toBe(true, 'Cancel button is disabled');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public');
});
it('[C290159] Should close the dialog when clicking Cancel button', () => {
it('[C290159] Should close the dialog when clicking Cancel button', async () => {
const libraryName = 'cancelLibrary';
createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.clickCancel();
await createLibraryDialog.clickCancel();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.waitForDialogToClose();
});
it('[C290160] Should create a public library', () => {
it('[C290160] Should create a public library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPublic();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPublic();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.');
});
it('[C290173] Should create a private library', () => {
it('[C290173] Should create a private library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPrivate();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPrivate();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.');
});
it('[C290174, C290175] Should create a moderated library with a given Library ID', () => {
it('[C290174, C290175] Should create a moderated library with a given Library ID', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryId = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectModerated();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectModerated();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.');
});
it('[C290163] Should disable Create button when a mandatory field is not filled in', () => {
it('[C290163] Should disable Create button when a mandatory field is not filled in', async () => {
const inputValue = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(inputValue);
createLibraryDialog.clearLibraryId();
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
createLibraryDialog.clearLibraryName();
await createLibraryDialog.typeLibraryName(inputValue);
await createLibraryDialog.clearLibraryId();
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.clearLibraryName();
createLibraryDialog.typeLibraryId(inputValue);
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
createLibraryDialog.clearLibraryId();
await createLibraryDialog.typeLibraryId(inputValue);
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.clearLibraryId();
createLibraryDialog.typeLibraryDescription(inputValue);
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.typeLibraryDescription(inputValue);
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
});
it('[C290164] Should auto-fill in the Library Id built from library name', () => {
it('[C290164] Should auto-fill in the Library Id built from library name', async () => {
const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*'];
const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link'];
for (let _i = 0; _i < 3; _i++) {
createLibraryDialog.typeLibraryName(name[_i]);
expect(createLibraryDialog.getLibraryIdText()).toMatch(libraryId[_i]);
createLibraryDialog.clearLibraryName();
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryName(name[i]);
await expect(await createLibraryDialog.getLibraryIdText()).toMatch(libraryId[i]);
await createLibraryDialog.clearLibraryName();
}
});
it('[C290176] Should not accept special characters for Library Id', () => {
it('[C290176] Should not accept special characters for Library Id', async () => {
const name = 'My Library';
const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>'];
createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryName(name);
for (let _i = 0; _i < 3; _i++) {
createLibraryDialog.typeLibraryId(libraryId[_i]);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch('Use numbers and letters only');
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryId(libraryId[i]);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Use numbers and letters only');
}
});
it('[C291985] Should not accept less than one character name for Library name', () => {
it('[C291985] Should not accept less than 2 characters for Library name', async () => {
const name = 'x';
const libraryId = 'My New Library';
const libraryId = 'my-library-id';
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch('Title must be at least 2 characters long');
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Title must be at least 2 characters long');
});
it('[C291793] Should display error for Name field filled in with spaces only', () => {
it('[C291793] Should display error for Name field filled in with spaces only', async () => {
const name = ' ';
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch("Library name can't contain only spaces");
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch("Library name can't contain only spaces");
});
it('[C290177] Should not accept a duplicate Library Id', () => {
it('[C290177] Should not accept a duplicate Library Id', async () => {
const name = 'My Library';
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
contentServicesPage.openCreateLibraryDialog();
await contentServicesPage.openCreateLibraryDialog();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch("This Library ID isn't available. Try a different Library ID.");
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch("This Library ID isn't available. Try a different Library ID.");
});
it('[C290178] Should accept the same library name but different Library Ids', () => {
it('[C290178] Should accept the same library name but different Library Ids', async () => {
const name = createSite.entry.title;
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name.toUpperCase());
createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryName(name.toUpperCase());
await createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.waitForLibraryNameHint();
expect(createLibraryDialog.getLibraryNameHint()).toMatch('Library name already in use', 'The library name hint is wrong');
await createLibraryDialog.waitForLibraryNameHint();
await expect(await createLibraryDialog.getLibraryNameHint()).toMatch('Library name already in use', 'The library name hint is wrong');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create library dialog remained open');
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', () => {
it('[C290179] Should not accept more than the expected characters for input fields', async () => {
const name = StringUtil.generateRandomString(257);
const libraryId = StringUtil.generateRandomString(73);
const libraryDescription = StringUtil.generateRandomString(513);
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPublic();
await createLibraryDialog.selectPublic();
expect(createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title');
expect(createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name');
expect(createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description');
await expect(await createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title');
await expect(await createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name');
await expect(await createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description');
});
});
@@ -35,28 +35,28 @@ describe('Version component actions', () => {
const acsUser = new AcsUserModel();
const txtFileComma = new FileModel({
'name': 'comma,name',
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
name: 'comma,name',
location: resources.Files.ADF_DOCUMENTS.TXT.file_location
});
const txtFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
name: resources.Files.ADF_DOCUMENTS.TXT.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT.file_location
});
const file0BytesModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const folderInfo = new FolderModel({
'name': 'myFolder',
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
name: 'myFolder',
location: resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
const folderSecond = new FolderModel({
'name': 'myrSecondFolder',
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
name: 'myrSecondFolder',
location: resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
this.alfrescoJsApi = new AlfrescoApi({
@@ -65,7 +65,7 @@ describe('Version component actions', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -82,10 +82,9 @@ describe('Version component actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
afterAll(async () => {
@@ -93,48 +92,48 @@ describe('Version component actions', () => {
});
afterEach(async () => {
BrowserVisibility.waitUntilDialogIsClose();
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C260083] Download files - Different size values', () => {
contentListPage.selectRow(txtFileModel.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(txtFileModel.name);
BrowserVisibility.waitUntilDialogIsClose();
it('[C260083] Download files - Different size values', async () => {
await contentListPage.selectRow(txtFileModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileModel.name);
await BrowserVisibility.waitUntilDialogIsClose();
contentListPage.selectRow(file0BytesModel.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
await contentListPage.selectRow(file0BytesModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
});
it('[C260084] Download folder', () => {
contentListPage.selectRow(folderInfo.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
it('[C260084] Download folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
});
it('[C261032] File and Folder', () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.checkAcsContainer();
contentListPage.dataTablePage().checkAllRows();
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded('archive.zip');
it('[C261032] File and Folder', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.checkAcsContainer();
await contentListPage.dataTablePage().checkAllRows();
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded('archive.zip');
});
it('[C261033] Folder and Folder', () => {
contentListPage.selectRow(folderInfo.name);
contentListPage.selectRow(folderSecond.name);
it('[C261033] Folder and Folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentListPage.selectRow(folderSecond.name);
contentServicesPage.clickDownloadButton();
await contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded('archive.zip');
BrowserVisibility.waitUntilDialogIsClose();
await FileBrowserUtil.isFileDownloaded('archive.zip');
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C277757] Download file - Comma in file name', () => {
contentListPage.selectRow(txtFileComma.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(txtFileComma.name);
it('[C277757] Download file - Comma in file name', async () => {
await contentListPage.selectRow(txtFileComma.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileComma.name);
});
});
@@ -25,7 +25,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { FileModel } from '../../models/ACS/fileModel';
import resources = require('../../util/resources');
describe('Edit folder directive', function () {
describe('Edit folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -41,15 +41,15 @@ describe('Edit folder directive', function () {
});
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const updateFolderName = StringUtil.generateRandomString(5);
let editFolder, anotherFolder, filePdfNode, subFolder;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.core.peopleApi.addPerson(anotherAcsUser);
@@ -74,171 +74,173 @@ describe('Edit folder directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(editFolder.entry.id);
await uploadActions.deleteFileOrFolder(anotherFolder.entry.id);
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
done();
});
beforeEach(async (done) => {
navigationBarPage.clickHomeButton();
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C260161] Update folder - Cancel button', async () => {
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
expect(editFolderDialog.getDialogTitle()).toBe('Edit folder');
expect(editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.checkCancelBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await expect(await editFolderDialog.getDialogTitle()).toBe('Edit folder');
await expect(await editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.checkCancelBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260162] Update folder - Introducing letters', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName(editFolder.entry.name + 'a');
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(editFolder.entry.name + 'a');
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
});
it('[C260163] Update folder name with an existing one', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName(anotherFolder.entry.name);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCreateUpdateButton();
editFolderDialog.checkFolderDialogIsDisplayed();
notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(anotherFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsDisplayed();
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260164] Edit Folder - Unsupported characters', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.addFolderName('a*"<>\\/?:|');
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await editFolderDialog.addFolderName('a*"<>\\/?:|');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.addFolderName('a.a');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName('a.');
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await editFolderDialog.addFolderName('a.');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.getFolderNameField().clear();
editFolderDialog.getFolderNameField().sendKeys(protractor.Key.SPACE);
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE);
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.addFolderName(editFolder.entry.name);
editFolderDialog.addFolderDescription('a*"<>\\/?:|');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(editFolder.entry.name);
await editFolderDialog.addFolderDescription('a*"<>\\/?:|');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderDescription('a.');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderDescription('a.a');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
await editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260166] Enable/Disable edit folder icon - when file selected', async () => {
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when multiple folders selected', async () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkAllRowsButtonIsDisplayed().checkAllRows();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRowsButtonIsDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when single folder selected', async () => {
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
});
it('[C260165] Update folder name with non-existing one', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.addFolderName(updateFolderName);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCreateUpdateButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.addFolderName(updateFolderName);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
});
describe('Edit Folder - no permission', () => {
beforeEach(async (done) => {
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + editFolder.entry.id);
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + editFolder.entry.id);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260167] Edit folder without permission', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
});
@@ -27,7 +27,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { CustomSources } from '../../pages/adf/demo-shell/customSourcesPage';
import { TrashcanPage } from '../../pages/adf/trashcanPage';
describe('Favorite directive', function () {
describe('Favorite directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -43,14 +43,14 @@ describe('Favorite directive', function () {
hostEcm: browser.params.testConfig.adf_acs.host
});
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let testFolder1, testFolder2, testFolder3, testFolder4, testFile;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
@@ -62,161 +62,161 @@ describe('Favorite directive', function () {
testFile = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
await contentServicesPage.goToDocumentList();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(testFolder1.entry.id);
await uploadActions.deleteFileOrFolder(testFolder2.entry.id);
await uploadActions.deleteFileOrFolder(testFolder3.entry.id);
await uploadActions.deleteFileOrFolder(testFolder4.entry.id);
done();
});
beforeEach(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260247] Should be able to mark a file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
});
it('[C260249] Should be able to mark a folder as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name);
});
it('[C260251] Should retain the restored file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
contentListPage.rightClickOnRow(testFile.entry.name);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentListPage.rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
expect(trashcanPage.numberOfResultsDisplayed()).toBe(1);
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
trashcanPage.clickRestore();
trashcanPage.checkTrashcanIsEmpty();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.checkTrashcanIsEmpty();
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.checkIsMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
});
it('[C260252] Should retain the moved file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
contentServicesPage.doubleClickRow(testFolder1.entry.name);
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.doubleClickRow(testFolder1.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
});
it('[C217216] Should be able to mark and unmark multiple folders as favorite', async () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().checkAllRows();
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4);
contentServicesPage.getContentList().dataTablePage().uncheckAllRows();
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4);
await contentServicesPage.getDocumentList().dataTablePage().uncheckAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await contentServicesPage.checkIsMarkedFavorite();
});
});
@@ -24,10 +24,10 @@ import { FileModel } from '../../models/ACS/fileModel';
import resources = require('../../util/resources');
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { TrashcanPage } from '../../pages/adf/trashcanPage';
import { LoginPage, NotificationHistoryPage, StringUtil, UploadActions } from '@alfresco/adf-testing';
import { LoginPage, NotificationHistoryPage, StringUtil, UploadActions, BrowserActions } from '@alfresco/adf-testing';
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
describe('Restore content directive', function () {
describe('Restore content directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -44,18 +44,18 @@ describe('Restore content directive', function () {
});
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const folderName = StringUtil.generateRandomString(5);
@@ -64,7 +64,7 @@ describe('Restore content directive', function () {
let folderWithContent, folderWithFolder, subFolder, subFile, testFile, restoreFile, publicSite, siteFolder,
siteFile;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.core.peopleApi.addPerson(anotherAcsUser);
@@ -79,171 +79,163 @@ describe('Restore content directive', function () {
restoreFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(folderWithContent.entry.id);
await uploadActions.deleteFileOrFolder(folderWithFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
});
beforeEach(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
describe('Restore same name folders', function () {
describe('Restore same name folders', () => {
beforeAll(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
done();
beforeAll(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
});
it('[C260227] Should validate when restoring Folders with same name', async () => {
await uploadActions.createFolder(folderName, '-my-');
navigationBarPage.clickContentServicesButton();
browser.refresh();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
await navigationBarPage.clickContentServicesButton();
await browser.refresh();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
trashcanPage.getDocumentList().dataTablePage().checkAllRows();
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.checkContentIsDisplayed(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkAllRows();
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(folderName);
notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + folderName + ' item already exists');
await notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + folderName + ' item already exists');
});
});
it('[C260238] Should restore a file', async () => {
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.deleteContent(testFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.deleteContent(testFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
});
it('[C260239] Should restore folder with content', async () => {
contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
contentServicesPage.deleteContent(folderWithContent.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.deleteContent(folderWithContent.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
contentServicesPage.getContentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name);
contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
await notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored');
});
it('[C260240] Should validate restore when the original location no longer exists', async () => {
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.deleteContent(subFolder.entry.name);
contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
breadCrumbPage.chooseBreadCrumb(acsUser.id);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.deleteContent(folderWithFolder.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.deleteContent(subFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
await breadCrumbPage.chooseBreadCrumb(acsUser.id);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.deleteContent(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationIsPresent('Can\'t restore ' + subFolder.entry.name + ' item, the original location no longer exists');
notificationHistoryPage.checkNotificationIsPresent('Restore successful');
notificationHistoryPage.clickMarkAsRead();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains(`Can't restore ${subFolder.entry.name} item, the original location no longer exists`);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains('Restore successful');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
});
it('[C260241] Should display restore icon both for file and folder', async () => {
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.checkContentIsDisplayed(restoreFile.entry.name);
contentServicesPage.deleteContent(folderName);
contentServicesPage.deleteContent(restoreFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderName);
contentServicesPage.checkContentIsNotDisplayed(restoreFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(restoreFile.entry.name);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.deleteContent(restoreFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await contentServicesPage.checkContentIsNotDisplayed(restoreFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.checkRestoreButtonIsNotDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
trashcanPage.checkRestoreButtonIsDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsNotSelected(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
await trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsNotSelected(folderName);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(restoreFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(restoreFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
});
describe('Restore deleted library', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const publicSiteName = `00${StringUtil.generateRandomString(5)}`;
const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName };
@@ -251,25 +243,31 @@ describe('Restore content directive', function () {
siteFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), publicSite.entry.guid);
siteFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, siteFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
done();
});
afterAll(async () => {
try {
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
} catch (error) {
}
});
it('[C260241] Should restore the deleted library along with contents inside', async () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
trashcanPage.clickRestore();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
await trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.selectSite(publicSite.entry.title);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
contentServicesPage.doubleClickRow(siteFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.selectSite(publicSite.entry.title);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
await contentServicesPage.doubleClickRow(siteFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
@@ -278,7 +276,7 @@ describe('Restore content directive', function () {
let parentFolder, folderWithin, pdfFile, pngFile, mainFile, mainFolder;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(anotherAcsUser.id, anotherAcsUser.password);
await uploadActions.createFolder(folderName, '-my-');
parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
@@ -289,45 +287,43 @@ describe('Restore content directive', function () {
mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFile.entry.id);
done();
});
it('[C216431] Should restore hierarchy of folders', async () => {
contentServicesPage.deleteContent(parentFolder.entry.name);
contentServicesPage.deleteContent(mainFolder.entry.name);
contentServicesPage.deleteContent(mainFile.entry.name);
await contentServicesPage.deleteContent(parentFolder.entry.name);
await contentServicesPage.deleteContent(mainFolder.entry.name);
await contentServicesPage.deleteContent(mainFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.checkRestoreButtonIsNotDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
trashcanPage.clickRestore();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
await trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
contentServicesPage.doubleClickRow(folderWithin.entry.name);
contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
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.checkContentIsDisplayed(folderWithin.entry.name);
await contentServicesPage.doubleClickRow(folderWithin.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});
});
@@ -16,7 +16,13 @@
*/
import { browser, by, element } from 'protractor';
import { LoginPage, PaginationPage, UploadActions, StringUtil, ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
import {
LoginPage,
PaginationPage,
UploadActions,
StringUtil,
ContentNodeSelectorDialogPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -56,12 +62,12 @@ describe('Document List Component - Actions', () => {
const nrOfFiles = 5;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const files = {
@@ -69,7 +75,7 @@ describe('Document List Component - Actions', () => {
extension: '.txt'
};
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -85,150 +91,150 @@ describe('Document List Component - Actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.driver.sleep(12000);
done();
await browser.sleep(10000);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async(done) => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
done();
});
describe('File Actions', () => {
it('[C213257] Should be able to copy a file', () => {
contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
it('[C213257] Should be able to copy a file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C260131] Copy - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
it('[C260131] Copy - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C297491] Should be able to move a file', () => {
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
it('[C297491] Should be able to move a file', async () => {
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
});
it('[C260127] Move - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
it('[C260127] Move - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C280561] Should be able to delete a file via dropdown menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(fileNames[0]);
contentServicesPage.deleteContent(fileNames[0]);
contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
await contentServicesPage.checkContentIsDisplayed(fileNames[0]);
await contentServicesPage.deleteContent(fileNames[0]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
});
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.selectRow(fileNames[1]);
contentListPage.selectRow(fileNames[2]);
contentServicesPage.deleteContent(fileNames[1]);
contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().selectRow(fileNames[1]);
await contentServicesPage.getDocumentList().selectRow(fileNames[2]);
await contentServicesPage.deleteContent(fileNames[1]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
});
it('[C280565] Should be able to delete a file using context menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.rightClickOnRow(fileNames[2]);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
it('[C280565] Should be able to delete a file using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
});
it('[C280567] Only one file is deleted when multiple files are selected using context menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.selectRow(fileNames[3]);
contentListPage.selectRow(fileNames[4]);
contentListPage.rightClickOnRow(fileNames[3]);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
contentServicesPage.checkContentIsDisplayed(fileNames[4]);
await contentServicesPage.getDocumentList().selectRow(fileNames[3]);
await contentServicesPage.getDocumentList().selectRow(fileNames[4]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[3]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
await contentServicesPage.checkContentIsDisplayed(fileNames[4]);
});
it('[C280566] Should be able to open context menu with right click', () => {
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.checkContextActionIsVisible('Download');
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.checkContextActionIsVisible('Delete');
contentServicesPage.checkContextActionIsVisible('Info');
contentServicesPage.checkContextActionIsVisible('Manage versions');
contentServicesPage.checkContextActionIsVisible('Permission');
contentServicesPage.checkContextActionIsVisible('Lock');
contentServicesPage.closeActionContext();
it('[C280566] Should be able to open context menu with right click', async () => {
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Manage versions');
await contentServicesPage.checkContextActionIsVisible('Permission');
await contentServicesPage.checkContextActionIsVisible('Lock');
await contentServicesPage.closeActionContext();
});
});
describe('Folder Actions', () => {
it('[C260138] Should be able to copy a folder', () => {
contentServicesPage.copyContent(folderName);
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(folderName);
it('[C260138] Should be able to copy a folder', async () => {
await contentServicesPage.copyContent(folderName);
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260123] Should be able to delete a folder using context menu', () => {
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
it('[C260123] Should be able to delete a folder using context menu', async () => {
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C280568] Should be able to open context menu with right click', () => {
contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
it('[C280568] Should be able to open context menu with right click', async () => {
await contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
contentListPage.rightClickOnRow(secondUploadedFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Download');
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.checkContextActionIsVisible('Delete');
contentServicesPage.checkContextActionIsVisible('Info');
contentServicesPage.checkContextActionIsVisible('Permission');
await contentServicesPage.getDocumentList().rightClickOnRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Permission');
});
});
@@ -236,19 +242,19 @@ 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()});
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 AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
@@ -260,118 +266,117 @@ describe('Document List Component - Actions', () => {
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
done();
});
beforeEach(async (done) => {
loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage('5');
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();
done();
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFileOrFolder(folder.entry.id);
});
done();
});
it('[C260132] Move action on folder with - Load more', () => {
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
contentServicesPage.doubleClickRow('F' + folderModel6.name);
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
breadCrumbDropdownPage.clickParentFolder();
breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
breadCrumbDropdownPage.choosePath(contentServicesUser.id);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
it('[C305051] Copy action on folder with - Load more', () => {
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);
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
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);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
paginationPage.clickOnNextPage();
contentListPage.waitForTableBody();
contentServicesPage.doubleClickRow('F' + folderModel6.name);
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.id);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
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);
});
@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let acsUser = null;
let testFileNode, pdfBFileNode;
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,32 +56,32 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Custom Column', () => {
let folderName;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const timeAgoFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const mediumFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
let pdfUploadedNode, docxUploadedNode, timeAgoUploadedNode, mediumDateUploadedNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
@@ -96,10 +96,10 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
docxUploadedNode = await uploadActions.uploadFile(docxFileModel.location, docxFileModel.name, '-my-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (pdfUploadedNode) {
@@ -114,71 +114,71 @@ describe('Document List Component', () => {
if (mediumDateUploadedNode) {
await uploadActions.deleteFileOrFolder(mediumDateUploadedNode.entry.id);
}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
it('[C279926] Should only display the user\'s files and folders', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
expect(contentServicesPage.getDocumentListRowNumber()).toBe(4);
it('[C279926] Should only display the user\'s 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);
});
it('[C279927] Should display default columns', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkColumnNameHeader();
contentServicesPage.checkColumnSizeHeader();
contentServicesPage.checkColumnCreatedByHeader();
contentServicesPage.checkColumnCreatedHeader();
it('[C279927] Should display default columns', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkColumnNameHeader();
await contentServicesPage.checkColumnSizeHeader();
await contentServicesPage.checkColumnCreatedByHeader();
await contentServicesPage.checkColumnCreatedHeader();
});
it('[C279928] Should be able to display date with timeAgo', async (done) => {
it('[C279928] Should be able to display date with timeAgo', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
timeAgoUploadedNode = await uploadActions.uploadFile(timeAgoFileModel.location, timeAgoFileModel.name, '-my-');
contentServicesPage.goToDocumentList();
const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
expect(dateValue).toMatch(/(ago|few)/);
done();
await contentServicesPage.goToDocumentList();
const dateValue = await contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
await expect(dateValue).toMatch(/(ago|few)/);
});
it('[C279929] Should be able to display the date with date type', async (done) => {
it('[C279929] Should be able to display the date with date type', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
mediumDateUploadedNode = await uploadActions.uploadFile(mediumFileModel.location, mediumFileModel.name, '-my-');
const createdDate = moment(mediumDateUploadedNode.createdAt).format('ll');
contentServicesPage.goToDocumentList();
contentServicesPage.enableMediumTimeFormat();
const dateValue = contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
expect(dateValue).toContain(createdDate);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableMediumTimeFormat();
const dateValue = await contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
await expect(dateValue).toContain(createdDate);
});
});
describe('Column Sorting', () => {
const fakeFileA = new FileModel({
'name': 'A',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'A',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileB = new FileModel({
'name': 'B',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'B',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileC = new FileModel({
'name': 'C',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'C',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
let fileANode, fileBNode, fileCNode;
beforeAll(async (done) => {
beforeAll(async () => {
const user = new AcsUserModel();
@@ -192,12 +192,11 @@ describe('Document List Component', () => {
fileCNode = await uploadActions.uploadFile(fakeFileC.location, fakeFileC.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(user);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (fileANode) {
await uploadActions.deleteFileOrFolder(fileANode.entry.id);
@@ -208,53 +207,53 @@ describe('Document List Component', () => {
if (fileCNode) {
await uploadActions.deleteFileOrFolder(fileCNode.entry.id);
}
done();
});
it('[C260112] Should be able to sort by name (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
it('[C260112] Should be able to sort by name (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
});
it('[C272770] Should be able to sort by name (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
it('[C272770] Should be able to sort by name (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
});
it('[C272771] Should be able to sort by author (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
it('[C272771] Should be able to sort by author (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
});
it('[C272772] Should be able to sort by author (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
it('[C272772] Should be able to sort by author (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
});
it('[C272773] Should be able to sort by date (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
it('[C272773] Should be able to sort by date (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
});
it('[C272774] Should be able to sort by date (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
it('[C272774] Should be able to sort by date (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
});
});
it('[C279959] Should display empty folder state for new folders', async (done) => {
it('[C279959] Should display empty folder state for new folders', async () => {
acsUser = new AcsUserModel();
const folderName = 'BANANA';
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.createNewFolder(folderName);
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
it('[C272775] Should be able to upload a file in new folder', async (done) => {
it('[C272775] Should be able to upload a file in new folder', async () => {
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
acsUser = new AcsUserModel();
/* cspell:disable-next-line */
@@ -264,30 +263,30 @@ describe('Document List Component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.uploadFile(testFile.location);
contentServicesPage.checkContentIsDisplayed(testFile.name);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
it('[C261997] Should be able to clean Recent Files history', async (done) => {
it('[C261997] Should be able to clean Recent Files history', async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.clickOnContentServices();
contentServicesPage.checkRecentFileToBeShowed();
await contentServicesPage.clickOnContentServices();
await contentServicesPage.checkRecentFileToBeShowed();
const icon = await contentServicesPage.getRecentFileIcon();
expect(icon).toBe('history');
contentServicesPage.expandRecentFiles();
contentServicesPage.checkEmptyRecentFileIsDisplayed();
contentServicesPage.closeRecentFiles();
done();
await expect(icon).toBe('history');
await contentServicesPage.expandRecentFiles();
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
await contentServicesPage.closeRecentFiles();
});
it('[C279970] Should display Islocked field for folders', async (done) => {
it('[C279970] Should display Islocked field for folders', async () => {
acsUser = new AcsUserModel();
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
@@ -297,22 +296,22 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderNameA, '-my-');
uploadedFolderExtra = await uploadActions.createFolder(folderNameB, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderNameA);
contentServicesPage.checkContentIsDisplayed(folderNameB);
contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderNameA);
await contentServicesPage.checkContentIsDisplayed(folderNameB);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
});
it('[C269086] Should display Islocked field for files', async (done) => {
it('[C269086] Should display Islocked field for files', async () => {
const testFileA = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const testFileB = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -321,19 +320,19 @@ describe('Document List Component', () => {
testFileNode = await uploadActions.uploadFile(testFileA.location, testFileA.name, '-my-');
pdfBFileNode = await uploadActions.uploadFile(testFileB.location, testFileB.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(testFileA.name);
contentServicesPage.checkContentIsDisplayed(testFileB.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(testFileA.name);
await contentServicesPage.checkContentIsDisplayed(testFileB.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
});
describe('Once uploaded 20 folders', () => {
let folderCreated;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderCreated = [];
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -346,22 +345,19 @@ describe('Document List Component', () => {
folder = await uploadActions.createFolder(folderName, '-my-');
folderCreated.push(folder);
}
done();
});
afterAll(async (done) => {
Promise.all(folderCreated.map((folder) =>
uploadActions.deleteFileOrFolder(folder.entry.id)
)).then(() => {
done();
});
afterAll(async () => {
for (let i = 0; i <= folderCreated.length; i++) {
await uploadActions.deleteFileOrFolder(folderCreated[i].entry.id);
}
});
it('[C277093] Should sort files with Items per page set to default', async (done) => {
it('[C277093] Should sort files with Items per page set to default', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkListIsSortedByNameColumn('asc');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
});
@@ -369,14 +365,14 @@ describe('Document List Component', () => {
describe('Column Template', () => {
const file0BytesModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
let file;
const viewer = new ViewerPage();
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -384,16 +380,16 @@ describe('Document List Component', () => {
file = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList()
.waitForTableBody();
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
it('[C291843] Should be able to navigate using nodes hyperlink when activated', () => {
contentServicesPage.clickHyperlinkNavigationToggle()
.checkFileHyperlinkIsEnabled(file.entry.name)
.clickFileHyperlink(file.entry.name);
viewer.checkFileIsLoaded();
it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => {
await contentServicesPage.clickHyperlinkNavigationToggle();
await contentServicesPage.checkFileHyperlinkIsEnabled(file.entry.name);
await contentServicesPage.clickFileHyperlink(file.entry.name);
await viewer.checkFileIsLoaded();
});
});
});
@@ -50,16 +50,16 @@ describe('Document List Component', () => {
let folderName, sameNameFolder;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
anotherAcsUser = new AcsUserModel();
folderName = StringUtil.generateRandomString(5);
@@ -90,131 +90,129 @@ describe('Document List Component', () => {
}
});
browser.driver.sleep(12000);
done();
await browser.driver.sleep(12000);
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
} catch (error) {
// tslint:disable-next-line:no-console
console.log('Error delete file or folder' + error);
}
done();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
});
describe('Document List Component - Actions Move and Copy', () => {
beforeEach(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
});
it('[C260128] Move - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
});
it('[C260134] Move - folder with subfolder and file within it', () => {
contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(sourceFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
it('[C260128] Move - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260135] Move - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260134] Move - folder with subfolder and file within it', async () => {
await contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(sourceFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
});
it('[C260129] Copy - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260135] Move - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260136] Copy - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260129] Copy - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260136] Copy - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
});
describe('Document List actionns - Move, Copy on no permission folder', () => {
beforeAll((done) => {
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + sourceFolder.entry.id);
contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
done();
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
await BrowserActions.getUrl(`${browser.params.testConfig.adf.url}/files/${sourceFolder.entry.id}`);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260133] Move - no permission folder', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Move');
expect(contentServicesPage.checkContentActionIsEnabled('Move')).toBe(false);
contentServicesPage.closeActionContext();
it('[C260133] Move - no permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await expect(await contentServicesPage.isContextActionEnabled('Move')).toBe(false);
await contentServicesPage.closeActionContext();
});
it('[C260140] Copy - No permission folder', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Copy');
expect(contentServicesPage.checkContentActionIsEnabled('Copy')).toBe(true);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
expect(contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
it('[C260140] Copy - No permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await expect(await contentServicesPage.isContextActionEnabled('Copy')).toBe(true);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
});
});
@@ -34,7 +34,6 @@ describe('Document List Component', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let acsUser = null;
const navBar = new NavigationBarPage();
const navigationBarPage = new NavigationBarPage();
describe('Gallery View', () => {
@@ -50,23 +49,23 @@ describe('Document List Component', () => {
let funnyUser;
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode, filePDFSubNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
funnyUser = await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -79,7 +78,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
@@ -87,92 +85,94 @@ describe('Document List Component', () => {
});
beforeEach(async () => {
navBar.clickHomeButton();
contentServicesPage.goToDocumentList();
contentServicesPage.clickGridViewButton();
contentServicesPage.checkCardViewContainerIsDisplayed();
await navigationBarPage.clickHomeButton();
await contentServicesPage.goToDocumentList();
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkCardViewContainerIsDisplayed();
});
it('[C280016] Should be able to choose Gallery View', () => {
expect(contentServicesPage.getCardElementShowedInPage()).toBe(4);
it('[C280016] Should be able to choose Gallery View', async () => {
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(4);
});
it('[C280023] Gallery Card should show details', () => {
expect(contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
expect(contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
expect(contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
contentServicesPage.checkMenuIsShowedForElementIndex(0);
contentServicesPage.checkMenuIsShowedForElementIndex(1);
contentServicesPage.checkMenuIsShowedForElementIndex(2);
contentServicesPage.checkMenuIsShowedForElementIndex(3);
it('[C280023] Gallery Card should show details', async () => {
await expect(await contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
await contentServicesPage.checkMenuIsShowedForElementIndex(0);
await contentServicesPage.checkMenuIsShowedForElementIndex(1);
await contentServicesPage.checkMenuIsShowedForElementIndex(2);
await contentServicesPage.checkMenuIsShowedForElementIndex(3);
});
it('[C280069] Gallery Card should show attributes', () => {
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
it('[C280069] Gallery Card should show attributes', async () => {
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
});
it('[C280129] Should keep Gallery View when accessing a folder', () => {
contentServicesPage.navigateToCardFolder(folderName);
it('[C280129] Should keep Gallery View when accessing a folder', async () => {
await contentServicesPage.navigateToCardFolder(folderName);
expect(contentServicesPage.getCardElementShowedInPage()).toBe(1);
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(1);
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280130] Should be able to go back to List View', () => {
contentServicesPage.clickGridViewButton();
contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkRowIsDisplayed(pdfFile.name);
it('[C280130] Should be able to go back to List View', async () => {
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
});
it('[C261993] Should be able to sort Gallery Cards by display name', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
contentServicesPage.checkListIsSortedByNameColumn('asc');
it('[C261993] Should be able to sort Gallery Cards by display name', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
it('[C261994] Should be able to sort Gallery Cards by size', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
contentServicesPage.checkListIsSortedBySizeColumn('asc');
it('[C261994] Should be able to sort Gallery Cards by size', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
await contentServicesPage.checkListIsSortedBySizeColumn('asc');
});
it('[C261995] Should be able to sort Gallery Cards by author', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
contentServicesPage.checkListIsSortedByAuthorColumn('asc');
it('[C261995] Should be able to sort Gallery Cards by author', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
await contentServicesPage.checkListIsSortedByAuthorColumn('asc');
});
it('[C261996] Should be able to sort Gallery Cards by created date', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
contentServicesPage.checkListIsSortedByCreatedColumn('asc');
it('[C261996] Should be able to sort Gallery Cards by created date', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
await contentServicesPage.checkListIsSortedByCreatedColumn('asc');
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (filePdfNode) {
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
@@ -189,7 +189,7 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
});
@@ -24,7 +24,7 @@ import { Util } from '../../util/util';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Document List - Pagination', function () {
describe('Document List - Pagination', () => {
const pagination = {
base: 'newFile',
secondSetBase: 'secondSet',
@@ -49,21 +49,21 @@ describe('Document List - Pagination', function () {
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ 'name': 'newFolder' });
const newFolderModel = new FolderModel({ name: 'newFolder' });
let fileNames = [];
const nrOfFiles = 20;
let currentPage = 1;
let secondSetOfFiles = [];
const secondSetNumber = 25;
const folderTwoModel = new FolderModel({ 'name': 'folderTwo' });
const folderThreeModel = new FolderModel({ 'name': 'folderThree' });
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const folderThreeModel = new FolderModel({ name: 'folderThree' });
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
secondSetOfFiles = Util.generateSequenceFiles(10, secondSetNumber + 9, pagination.secondSetBase, pagination.extension);
@@ -80,270 +80,256 @@ describe('Document List - Pagination', function () {
await uploadActions.createEmptyFiles(secondSetOfFiles, folderThreeUploadedModel.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach((done) => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
done();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
});
it('[C260062] Should use default pagination settings', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C274713] Should be able to set Items per page to 20', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C274713] Should be able to set Items per page to 20', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260069] Should be able to set Items per page to 5', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
paginationPage.clickOnNextPage();
it('[C260069] Should be able to set Items per page to 5', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
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(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
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(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
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);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260067] Should be able to set Items per page to 10', () => {
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
currentPage = 1;
});
it('[C260065] Should be able to set Items per page to 15', () => {
it('[C260065] Should be able to set Items per page to 15', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C91320] Pagination should preserve sorting', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
contentServicesPage.sortByName('DESC');
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await contentServicesPage.sortByName('DESC');
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
});
it('[C260107] Should not display pagination bar when a folder is empty', () => {
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.createNewFolder(folderTwoModel.name).checkContentIsDisplayed(folderTwoModel.name);
contentServicesPage.doubleClickRow(folderTwoModel.name);
contentServicesPage.checkPaginationIsNotDisplayed();
it('[C260107] Should not display pagination bar when a folder is empty', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.createNewFolder(folderTwoModel.name);
await contentServicesPage.checkContentIsDisplayed(folderTwoModel.name);
await contentServicesPage.doubleClickRow(folderTwoModel.name);
await contentServicesPage.checkPaginationIsNotDisplayed();
});
it('[C260071] Should be able to change pagination when having 25 files', () => {
it('[C260071] Should be able to change pagination when having 25 files', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(folderThreeModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(folderThreeModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
currentPage = 1;
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
});
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
});
@@ -40,9 +40,9 @@ describe('Document List Component', () => {
});
});
describe('Permission Message', async () => {
describe('Permission Message', () => {
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
@@ -55,36 +55,35 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
navBar.openLanguageMenu();
navBar.chooseLanguage('English');
done();
await navBar.openLanguageMenu();
await navBar.chooseLanguage('English');
});
it('[C217334] Should display a message when accessing file without permissions', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
it('[C217334] Should display a message when accessing file without permissions', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
it('[C279924] Should display custom message when accessing a file without permissions', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.enableCustomPermissionMessage();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
it('[C279924] Should display custom message when accessing a file without permissions', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableCustomPermissionMessage();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
});
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', () => {
navBar.openLanguageMenu();
navBar.chooseLanguage('Italiano');
browser.sleep(2000);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', async () => {
await navBar.openLanguageMenu();
await navBar.chooseLanguage('Italiano');
await browser.sleep(2000);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
});
});
@@ -29,7 +29,7 @@ describe('Document List Component - Properties', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const navigationBar = new NavigationBarPage();
let subFolder, parentFolder;
this.alfrescoJsApi = new AlfrescoApi({
@@ -40,13 +40,13 @@ describe('Document List Component - Properties', () => {
let acsUser = null;
const pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
describe('Allow drop files property', async () => {
describe('Allow drop files property', () => {
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -61,46 +61,44 @@ describe('Document List Component - Properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
done();
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.disableDropFilesInAFolder();
await contentServicesPage.disableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
});
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.enableDropFilesInAFolder();
await contentServicesPage.enableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
});
});
});
@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let testFileNode, pdfBFileNode;
const navigationBarPage = new NavigationBarPage();
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,29 +56,29 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Thumbnails and tooltips', () => {
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -90,10 +90,9 @@ describe('Document List Component', () => {
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
folderNode = await uploadActions.createFolder(folderName, '-my-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -109,52 +108,52 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
});
it('[C260108] Should display tooltip for file\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
it('[C260108] Should display tooltip for file\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
});
it('[C260109] Should display tooltip for folder\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
it('[C260109] Should display tooltip for folder\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName);
});
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
it('[C260119] Should have a specific thumbnail for folders', async () => {
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
done();
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
});
it('[C280066] Should have a specific thumbnail PDF files', async (done) => {
it('[C280066] Should have a specific thumbnail PDF files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280067] Should have a specific thumbnail DOCX files', async (done) => {
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
});
it('[C280068] Should have a specific thumbnail files', async (done) => {
it('[C280068] Should have a specific thumbnail files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
});
it('[C274701] Should be able to enable thumbnails', async (done) => {
contentServicesPage.enableThumbnails();
contentServicesPage.checkAcsContainer();
it('[C274701] Should be able to enable thumbnails', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
done();
await expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
});
});
+93 -101
View File
@@ -41,18 +41,18 @@ describe('Lock File', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const pngFileToLock = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
name: resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
let nodeId, site, documentLibrary, lockedFileNodeId;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(adminUser);
@@ -73,36 +73,32 @@ describe('Lock File', () => {
id: managerUser.id,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
done();
});
describe('Lock file interaction with the UI', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const pngLockedUploadedFile = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
lockedFileNodeId = pngLockedUploadedFile.entry.id;
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
try {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(adminUser);
await navigationBarPage.openContentServicesFolder(documentLibrary);
contentServices.waitForTableBody();
await contentServices.waitForTableBody();
} catch (error) {
}
done();
});
afterEach(async (done) => {
afterEach(async () => {
try {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
@@ -111,10 +107,10 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
@@ -125,57 +121,57 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286604] Should be able to open Lock file option by clicking the lock image', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286604] Should be able to open Lock file option by clicking the lock image', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.checkCancelButtonIsDisplayed();
lockFilePage.checkSaveButtonIsDisplayed();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.checkCancelButtonIsDisplayed();
await lockFilePage.checkSaveButtonIsDisplayed();
});
it('[C286625] Should be able to click Cancel to cancel lock file operation', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286625] Should be able to click Cancel to cancel lock file operation', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickCancelButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickCancelButton();
contentServices.checkUnlockedIcon(pngFileModel.name);
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
it('[C286603] Should be able to click on Lock file checkbox and lock a file', () => {
contentServices.lockContent(pngFileToLock.name);
it('[C286603] Should be able to click on Lock file checkbox and lock a file', async () => {
await contentServices.lockContent(pngFileToLock.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkLockedIcon(pngFileToLock.name);
await contentServices.checkLockedIcon(pngFileToLock.name);
});
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkLockedIcon(pngFileModel.name);
contentServices.lockContent(pngFileModel.name);
await contentServices.checkLockedIcon(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkUnlockedIcon(pngFileModel.name);
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
});
describe('Locked file without owner permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
@@ -184,10 +180,9 @@ describe('Lock File', () => {
await navigationBarPage.openContentServicesFolder(documentLibrary);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
try {
@@ -196,67 +191,66 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286610] Should not be able to delete a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.deleteNode(nodeId);
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286611] Should not be able to rename a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286612] Should not be able to move a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286613] Should not be able to update a new version on a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
@@ -266,27 +260,27 @@ describe('Lock File', () => {
let pngFileToBeLocked;
beforeAll(async (done) => {
beforeAll(async () => {
try {
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
lockedFileNodeId = pngFileToBeLocked.entry.id;
} catch (error) {
}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
try {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(adminUser);
navigationBarPage.openContentServicesFolder(documentLibrary);
await navigationBarPage.openContentServicesFolder(documentLibrary);
} catch (error) {
}
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
try {
@@ -294,71 +288,69 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
const response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
expect(response.entry.name).toEqual('My new name');
await expect(response.entry.name).toEqual('My new name');
} catch (error) {
}
});
it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
const response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
await expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
} catch (error) {
}
});
it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
const movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId);
expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
await expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
} catch (error) {
}
});
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', () => {
contentServices.lockContent(pngFileToLock.name);
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => {
await contentServices.lockContent(pngFileToLock.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
contentServices.deleteContent(pngFileToBeLocked.entry.name);
contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
await contentServices.deleteContent(pngFileToBeLocked.entry.name);
await contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
});
});
@@ -43,12 +43,12 @@ describe('Aspect oriented config', () => {
const acsUser = new AcsUserModel();
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let uploadActions;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -81,19 +81,18 @@ describe('Aspect oriented config', () => {
aspects.entry.aspectNames.push(defaultModel.concat(':', defaultEmptyPropertiesAspect));
await this.alfrescoJsApi.core.nodesApi.updateNode(uploadedFile.entry.id, {'aspectNames': aspects.entry.aspectNames});
await this.alfrescoJsApi.core.nodesApi.updateNode(uploadedFile.entry.id, { aspectNames: aspects.entry.aspectNames });
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async (done) => {
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
done();
afterEach(async () => {
await viewerPage.clickCloseButton();
await contentServicesPage.checkAcsContainer();
});
it('[C261117] Should be possible restrict the display properties of one an aspect', async () => {
@@ -118,23 +117,23 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('IMAGE');
metadataViewPage.checkPropertyIsVisible('properties.exif:pixelXDimension', 'textitem');
metadataViewPage.checkPropertyIsVisible('properties.exif:pixelYDimension', 'textitem');
metadataViewPage.checkPropertyIsNotVisible('properties.exif:isoSpeedRatings', 'textitem');
await metadataViewPage.clickMetadataGroup('IMAGE');
await metadataViewPage.checkPropertyIsVisible('properties.exif:pixelXDimension', 'textitem');
await metadataViewPage.checkPropertyIsVisible('properties.exif:pixelYDimension', 'textitem');
await metadataViewPage.checkPropertyIsNotVisible('properties.exif:isoSpeedRatings', 'textitem');
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.checkPropertyIsVisible('properties.exif:isoSpeedRatings', 'textitem');
await metadataViewPage.checkPropertyIsVisible('properties.exif:isoSpeedRatings', 'textitem');
});
it('[C260185] Should ignore not existing aspect when present in the configuration', async () => {
@@ -149,37 +148,37 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
metadataViewPage.checkMetadataGroupIsNotPresent('exists');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsNotPresent('exists');
});
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided', async () => {
await LocalStorageUtil.setConfigField('content-metadata', '{}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C260182] Should show all the aspects if the default configuration contains the star symbol', async () => {
@@ -190,19 +189,18 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C268899] Should be possible use a Translation key as Title of a metadata group', async () => {
@@ -232,21 +230,21 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE1-TRANSLATION-KEY');
metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE2-TRANSLATION-KEY');
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE1-TRANSLATION-KEY');
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE2-TRANSLATION-KEY');
expect(metadataViewPage.getMetadataGroupTitle('GROUP-TITLE1-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION ONE');
expect(metadataViewPage.getMetadataGroupTitle('GROUP-TITLE2-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION TWO');
await expect(await metadataViewPage.getMetadataGroupTitle('GROUP-TITLE1-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION ONE');
await expect(await metadataViewPage.getMetadataGroupTitle('GROUP-TITLE2-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION TWO');
});
@@ -261,23 +259,22 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
check(metadataViewPage.presetSwitch);
await check(metadataViewPage.presetSwitch);
metadataViewPage.enterPresetText('custom-preset');
await metadataViewPage.enterPresetText('custom-preset');
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C299186] The aspect without properties is not displayed', async () => {
@@ -290,17 +287,17 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotPresent(emptyAspectName);
await metadataViewPage.checkMetadataGroupIsNotPresent(emptyAspectName);
});
it('[C299187] The aspect with empty properties is displayed when edit', async () => {
@@ -313,20 +310,20 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotPresent(aspectName);
await metadataViewPage.checkMetadataGroupIsNotPresent(aspectName);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.checkMetadataGroupIsPresent(aspectName);
await metadataViewPage.checkMetadataGroupIsPresent(aspectName);
});
});
@@ -52,8 +52,8 @@ describe('permissions', () => {
let site;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -61,7 +61,7 @@ describe('permissions', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -91,7 +91,6 @@ describe('permissions', () => {
await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);
done();
});
afterAll(async () => {
@@ -102,52 +101,52 @@ describe('permissions', () => {
it('[C274692] Should not be possible edit metadata properties when the user is a consumer user', async () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsNotDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsNotDisplayed();
});
it('[C279971] Should be possible edit metadata properties when the user is a collaborator user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
});
it('[C279972] Should be possible edit metadata properties when the user is a contributor user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
});
});
@@ -51,8 +51,8 @@ describe('CardView Component - properties', () => {
const acsUser = new AcsUserModel();
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -60,7 +60,7 @@ describe('CardView Component - properties', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -74,139 +74,133 @@ describe('CardView Component - properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(() => {
viewerPage.clickCloseButton();
});
it('[C246516] Should show/hide the empty metadata when the property displayEmpty is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsNotVisible('properties.exif:model', 'textitem');
check(metadataViewPage.displayEmptySwitch);
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
});
it('[C260179] Should not be possible edit the basic property when readOnly is true', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
check(metadataViewPage.readonlySwitch);
metadataViewPage.editIconIsNotDisplayed();
});
it('[C268965] Should multi property allow expand multi accordion at the same time when set', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
metadataViewPage.clickMetadataGroup('properties');
metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('properties');
metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
check(metadataViewPage.multiSwitch);
metadataViewPage.clickMetadataGroup('properties');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('properties');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
it('[C280559] Should show/hide the default metadata properties when displayDefaultProperties is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
uncheck(metadataViewPage.defaultPropertiesSwitch);
metadataViewPage.checkMetadataGroupIsNotPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
check(metadataViewPage.defaultPropertiesSwitch);
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsExpand('properties');
afterEach(async () => {
await viewerPage.clickCloseButton();
});
it('[C280560] Should show/hide the more properties button when displayDefaultProperties is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C246516] Should show/hide the empty metadata when the property displayEmpty is true/false', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
metadataViewPage.informationButtonIsDisplayed();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.clickOnInformationButton();
metadataViewPage.informationButtonIsNotDisplayed();
await metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsNotVisible('properties.exif:model', 'textitem');
await check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
});
it('[C307975] Should be able to choose which aspect to show expanded in the info-drawer', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C260179] Should not be possible edit the basic property when readOnly is true', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
metadataViewPage.typeAspectName('EXIF');
metadataViewPage.clickApplyAspect();
await check(metadataViewPage.readonlySwitch);
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.editIconIsNotDisplayed();
});
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
it('[C268965] Should multi property allow expand multi accordion at the same time when set', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.typeAspectName('nonexistent');
metadataViewPage.clickApplyAspect();
metadataViewPage.checkMetadataGroupIsNotPresent('nonexistent');
await metadataViewPage.clickOnInformationButton();
metadataViewPage.typeAspectName('Properties');
metadataViewPage.clickApplyAspect();
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsExpand('properties');
await metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await metadataViewPage.clickMetadataGroup('properties');
await metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
await metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await check(metadataViewPage.multiSwitch);
await metadataViewPage.clickMetadataGroup('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);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.checkMetadataGroupIsNotPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await check(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
});
it('[C280560] Should show/hide the more properties button when displayDefaultProperties is true/false', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.informationButtonIsNotDisplayed();
});
it('[C307975] Should be able to choose which aspect to show expanded in the info-drawer', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.typeAspectName('EXIF');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
await metadataViewPage.typeAspectName('nonexistent');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsNotPresent('nonexistent');
await metadataViewPage.typeAspectName('Properties');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
});
});
@@ -56,8 +56,8 @@ describe('Metadata component', () => {
const folderName = 'Metadata Folder';
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
@@ -67,21 +67,14 @@ describe('Metadata component', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
Object.assign(pngFileModel, pngUploadedFile.entry);
pngFileModel.update(pngUploadedFile.entry);
done();
});
afterAll(async () => {
@@ -92,9 +85,8 @@ describe('Metadata component', () => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
@@ -104,194 +96,193 @@ describe('Metadata component', () => {
}));
});
beforeEach(async (done) => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkFileIsLoaded();
done();
beforeEach(async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkFileIsLoaded();
});
afterEach(() => {
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
afterEach(async () => {
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
});
it('[C245652] Should be possible to display a file\'s properties', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C245652] Should be possible to display a file\'s properties', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
expect(metadataViewPage.getTitle()).toEqual(METADATA.TITLE);
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
expect(metadataViewPage.getExpandedAspectName()).toEqual(METADATA.DEFAULT_ASPECT);
expect(metadataViewPage.getName()).toEqual(pngFileModel.name);
expect(metadataViewPage.getCreator()).toEqual(pngFileModel.getCreatedByUser().displayName);
expect(metadataViewPage.getCreatedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
expect(metadataViewPage.getModifier()).toEqual(pngFileModel.getCreatedByUser().displayName);
expect(metadataViewPage.getModifiedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
expect(metadataViewPage.getMimetypeName()).toEqual(pngFileModel.getContent().mimeTypeName);
expect(metadataViewPage.getSize()).toEqual(pngFileModel.getContent().getSizeInBytes());
await expect(await metadataViewPage.getTitle()).toEqual(METADATA.TITLE);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await metadataViewPage.getExpandedAspectName()).toEqual(METADATA.DEFAULT_ASPECT);
await expect(await metadataViewPage.getName()).toEqual(pngFileModel.name);
await expect(await metadataViewPage.getCreator()).toEqual(pngFileModel.getCreatedByUser().displayName);
await expect(await metadataViewPage.getCreatedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
await expect(await metadataViewPage.getModifier()).toEqual(pngFileModel.getCreatedByUser().displayName);
await expect(await metadataViewPage.getModifiedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
await expect(await metadataViewPage.getMimetypeName()).toEqual(pngFileModel.getContent().mimeTypeName);
await expect(await metadataViewPage.getSize()).toEqual(pngFileModel.getContent().getSizeInBytes());
metadataViewPage.editIconIsDisplayed();
metadataViewPage.informationButtonIsDisplayed();
expect(metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON);
expect(metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.informationButtonIsDisplayed();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP);
});
it('[C272769] Should be possible to display more details when clicking on More Information button', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
expect(metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON);
expect(metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN);
it('[C272769] Should be possible to display more details when clicking on More Information button', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN);
});
it('[C270952] Should be possible to open/close properties using info icon', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab().informationButtonIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsNotDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
metadataViewPage.clickOnPropertiesTab();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
expect(metadataViewPage.getEditIconTooltip()).toEqual(METADATA.EDIT_BUTTON_TOOLTIP);
it('[C270952] Should be possible to open/close properties using info icon', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsNotDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
await metadataViewPage.clickOnPropertiesTab();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await metadataViewPage.getEditIconTooltip()).toEqual(METADATA.EDIT_BUTTON_TOOLTIP);
});
it('[C245654] Should be possible edit the basic Metadata Info of a Document', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
it('[C245654] Should be possible edit the basic Metadata Info of a Document', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('name');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('name');
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
expect(metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.updatePropertyIconIsDisplayed('name');
metadataViewPage.clearPropertyIconIsDisplayed('name');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.updatePropertyIconIsDisplayed('name');
await metadataViewPage.clearPropertyIconIsDisplayed('name');
metadataViewPage.enterPropertyText('name', 'exampleText');
metadataViewPage.clickClearPropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.enterPropertyText('name', 'exampleText');
await metadataViewPage.clickClearPropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'exampleText.png');
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'exampleText.png');
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('example description');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('example description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
viewerPage.viewFile('exampleText.png');
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile('exampleText.png');
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', resources.Files.ADF_DOCUMENTS.PNG.file_name);
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.editIconClick();
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
});
it('[C260181] Should be possible edit all the metadata aspect', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
it('[C260181] Should be possible edit all the metadata aspect', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('properties.exif:software');
metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
expect(metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
await metadataViewPage.clickEditPropertyIcons('properties.exif:software');
await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
await expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
expect(metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
await metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
await metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
await expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
expect(metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
await metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
await metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
await expect(await metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
});
});
describe('Folder metadata', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await uploadActions.createFolder(folderName, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
it('[C261157] Should be possible use the metadata component When the node is a Folder', () => {
contentServicesPage.metadataContent(folderName);
it('[C261157] Should be possible use the metadata component When the node is a Folder', async () => {
await contentServicesPage.metadataContent(folderName);
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
expect(metadataViewPage.getPropertyText('createdByUser.displayName')).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
BrowserActions.closeMenuAndDialogs();
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
await expect(await metadataViewPage.getPropertyText('createdByUser.displayName')).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await BrowserActions.closeMenuAndDialogs();
});
it('[C261158] Should be possible edit the metadata When the node is a Folder', () => {
contentServicesPage.metadataContent(folderName);
it('[C261158] Should be possible edit the metadata When the node is a Folder', async () => {
await contentServicesPage.metadataContent(folderName);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'newnameFolder');
metadataViewPage.clickClearPropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'newnameFolder');
await metadataViewPage.clickClearPropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'newnameFolder');
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'newnameFolder');
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', folderName);
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', folderName);
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
});
});
@@ -299,36 +290,36 @@ describe('Metadata component', () => {
it('[C279960] Should show the last username modifier when modify a File', async () => {
await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
BrowserActions.getUrl(browser.params.testConfig.adf.url + `/(overlay:files/${pngFileModel.id}/view)`);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + `/(overlay:files/${pngFileModel.id}/view)`);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('check author example description');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('check author example description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkFileIsLoaded();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkFileIsLoaded();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
expect(metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
await expect(await metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
});
});
@@ -25,12 +25,12 @@ import { NavigationBarPage } from '../pages/adf/navigationBarPage';
describe('Notifications Component', () => {
const loginPage = new LoginPage();
const notificationHistoryPage = new NotificationPage();
const notificationPage = new NotificationPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -45,78 +45,76 @@ describe('Notifications Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
notificationHistoryPage.goToNotificationsPage();
await notificationPage.goToNotificationsPage();
notificationHistoryPage.enterDurationField(3000);
done();
await notificationPage.enterDurationField(3000);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach( () => {
browser.executeScript(`document.querySelector('button[data-automation-id="notification-custom-dismiss-button"]').click();`);
notificationHistoryPage.enterDurationField(3000);
afterEach(async () => {
await browser.executeScript(`document.querySelector('button[data-automation-id="notification-custom-dismiss-button"]').click();`);
await notificationPage.enterDurationField(3000);
});
it('[C279977] Should show notification when the message is not empty and button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
it('[C279977] Should show notification when the message is not empty and button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
});
it('[C279979] Should not show notification when the message is empty and button is clicked', () => {
notificationHistoryPage.clearMessage();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
it('[C279979] Should not show notification when the message is empty and button is clicked', async () => {
await notificationPage.clearMessage();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
});
it('[C279978] Should show notification with action when the message is not empty and button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickActionToggle();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationHistoryPage.clickActionButton();
notificationHistoryPage.checkActionEvent();
notificationHistoryPage.clickActionToggle();
it('[C279978] Should show notification with action when the message is not empty and button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickActionToggle();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
await notificationPage.clickActionButton();
await notificationPage.checkActionEvent();
await notificationPage.clickActionToggle();
});
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayed();
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayed();
});
it('[C279987] Should show custom notification during a limited time when a duration is added', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.enterDurationField(1000);
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayed();
browser.sleep(1500);
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
it('[C279987] Should show custom notification during a limited time when a duration is added', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.enterDurationField(1000);
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayed();
await browser.sleep(1500);
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
});
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickActionToggle();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.clickActionButton();
notificationHistoryPage.checkActionEvent();
notificationHistoryPage.clickActionToggle();
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickActionToggle();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
await notificationPage.clickNotificationButton();
await notificationPage.clickActionButton();
await notificationPage.checkActionEvent();
await notificationPage.clickActionToggle();
});
it('[C280001] Should meet configuration when a custom notification is set', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.enterDurationField(1000);
notificationHistoryPage.selectHorizontalPosition('Right');
notificationHistoryPage.selectVerticalPosition('Top');
notificationHistoryPage.selectDirection('Left to right');
notificationHistoryPage.clickNotificationButton();
expect(notificationHistoryPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
it('[C280001] Should meet configuration when a custom notification is set', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.enterDurationField(1000);
await notificationPage.selectHorizontalPosition('Right');
await notificationPage.selectVerticalPosition('Top');
await notificationPage.selectDirection('Left to right');
await notificationPage.clickNotificationButton();
await expect(await notificationPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
});
});
@@ -29,7 +29,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
describe('Permissions Component', function () {
describe('Permissions Component', () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -44,22 +44,22 @@ describe('Permissions Component', function () {
const contentList = contentServicesPage.getDocumentList();
const viewerPage = new ViewerPage();
const metadataViewPage = new MetadataViewPage();
const notificationPage = new NotificationHistoryPage();
const notificationHistoryPage = new NotificationHistoryPage();
const uploadDialog = new UploadDialog();
let fileOwnerUser, filePermissionUser, file;
const fileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const groupBody = {
@@ -67,11 +67,11 @@ describe('Permissions Component', function () {
displayName: StringUtil.generateRandomString()
};
const roleConsumerFolderModel = new FolderModel({ 'name': 'roleConsumer' + StringUtil.generateRandomString() });
const roleCoordinatorFolderModel = new FolderModel({ 'name': 'roleCoordinator' + StringUtil.generateRandomString() });
const roleCollaboratorFolderModel = new FolderModel({ 'name': 'roleCollaborator' + StringUtil.generateRandomString() });
const roleContributorFolderModel = new FolderModel({ 'name': 'roleContributor' + StringUtil.generateRandomString() });
const roleEditorFolderModel = new FolderModel({ 'name': 'roleEditor' + StringUtil.generateRandomString() });
const roleConsumerFolderModel = new FolderModel({ name: 'roleConsumer' + StringUtil.generateRandomString() });
const roleCoordinatorFolderModel = new FolderModel({ name: 'roleCoordinator' + StringUtil.generateRandomString() });
const roleCollaboratorFolderModel = new FolderModel({ name: 'roleCollaborator' + StringUtil.generateRandomString() });
const roleContributorFolderModel = new FolderModel({ name: 'roleContributor' + StringUtil.generateRandomString() });
const roleEditorFolderModel = new FolderModel({ name: 'roleEditor' + StringUtil.generateRandomString() });
let roleConsumerFolder, roleCoordinatorFolder, roleContributorFolder, roleCollaboratorFolder, roleEditorFolder;
let folders;
@@ -81,7 +81,7 @@ describe('Permissions Component', function () {
const duplicateUserPermissionMessage = 'One or more of the permissions you have set is already present : authority -> ' + filePermissionUser.getId() + ' / role -> Contributor';
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(fileOwnerUser);
@@ -161,189 +161,150 @@ describe('Permissions Component', function () {
await uploadActions.uploadFile(fileModel.location, 'RoleCollaborator' + fileModel.name, roleCollaboratorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleEditor' + fileModel.name, roleEditorFolder.entry.id);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFileOrFolder(folder.entry.id);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
done();
});
describe('Inherit and assigning permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(fileOwnerUser.id, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow(fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionContainerIsDisplayed();
done();
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionContainerIsDisplayed();
});
afterEach(async (done) => {
await uploadActions.deleteFileOrFolder(file.entry.id);
done();
});
it('[C268974] Inherit Permission', () => {
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
permissionsPage.checkPermissionsDatatableIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Inherit Permission');
permissionsPage.checkNoPermissionsIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
permissionsPage.checkPermissionsDatatableIsDisplayed();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
try {
await uploadActions.deleteFileOrFolder(file.entry.id);
} catch (error) {
}
});
it('[C286272] Should be able to see results when searching for a user', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup('a');
permissionsPage.checkResultListIsDisplayed();
it('[C268974] Inherit Permission', async () => {
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.checkPermissionsDatatableIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Inherit Permission');
await permissionsPage.checkNoPermissionsIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.checkPermissionsDatatableIsDisplayed();
});
it('[C276979] Should be able to give permissions to a group of people', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup('GROUP_' + groupBody.id);
permissionsPage.clickUserOrGroup('GROUP_' + groupBody.id);
permissionsPage.checkUserOrGroupIsAdded('GROUP_' + groupBody.id);
it('[C286272] Should be able to see results when searching for a user', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup('a');
await permissionsPage.checkResultListIsDisplayed();
});
it('[C277100] Should display EVERYONE group in the search result set', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.checkResultListIsDisplayed();
permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
permissionsPage.searchUserOrGroup('somerandomtext');
permissionsPage.checkResultListIsDisplayed();
permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
it('[C276979] Should be able to give permissions to a group of people', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup('GROUP_' + groupBody.id);
await permissionsPage.clickUserOrGroup('GROUP_' + groupBody.id);
await permissionsPage.checkUserOrGroupIsAdded('GROUP_' + groupBody.id);
});
it('[C277100] Should display EVERYONE group in the search result set', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.checkResultListIsDisplayed();
await permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
await permissionsPage.searchUserOrGroup('somerandomtext');
await permissionsPage.checkResultListIsDisplayed();
await permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
});
});
describe('Changing and duplicate Permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(fileOwnerUser.id, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow(fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
permissionsPage.checkUserOrGroupIsAdded(filePermissionUser.getId());
done();
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
await permissionsPage.checkUserOrGroupIsAdded(filePermissionUser.getId());
});
afterEach(async (done) => {
afterEach(async () => {
await uploadActions.deleteFileOrFolder(file.entry.id);
done();
});
it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
expect(permissionsPage.getRoleDropdownOptions().count()).toBe(5);
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe('Contributor');
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe('Collaborator');
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe('Coordinator');
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe('Editor');
expect(permissionsPage.getRoleDropdownOptions().get(4).getText()).toBe('Consumer');
permissionsPage.selectOption('Collaborator');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Collaborator');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Coordinator');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Coordinator');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Editor');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Editor');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Consumer');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Consumer');
it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
const roleDropdownOptions = permissionsPage.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.selectOption('Collaborator');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Collaborator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Coordinator');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Coordinator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Editor');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Editor');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Consumer');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Consumer');
});
it('[C276980] Should not be able to duplicate User or Group to the locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
expect(permissionsPage.getAssignPermissionErrorText()).toBe(duplicateUserPermissionMessage);
it('[C276980] Should not be able to duplicate User or Group to the locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
await notificationHistoryPage.checkNotifyContains(duplicateUserPermissionMessage);
});
it('[C276982] Should be able to remove User or Group from the locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickDeletePermissionButton();
permissionsPage.checkUserOrGroupIsDeleted(filePermissionUser.getId());
it('[C276982] Should be able to remove User or Group from the locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickDeletePermissionButton();
await permissionsPage.checkUserOrGroupIsDeleted(filePermissionUser.getId());
});
});
@@ -351,231 +312,133 @@ describe('Permissions Component', function () {
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => {
it('[C276993] Role Consumer', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
contentList.doubleClickRow('RoleConsumer' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleConsumer' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
notificationPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(fileModel.location);
notificationPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
await contentList.doubleClickRow('RoleConsumer' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleConsumer' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(fileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276996] Role Contributor', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleContributorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleContributor' + fileModel.name);
contentList.doubleClickRow('RoleContributor' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleContributor' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleContributor' + fileModel.name);
notificationPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await navigationBarPage.openContentServicesFolder(roleContributorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleContributor' + fileModel.name);
await contentList.doubleClickRow('RoleContributor' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleContributor' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleContributor' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277000] Role Editor', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleEditorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleEditor' + fileModel.name);
contentList.doubleClickRow('RoleEditor' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleEditor' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleEditor' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle1');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(fileModel.location);
notificationPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
await navigationBarPage.openContentServicesFolder(roleEditorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleEditor' + fileModel.name);
await contentList.doubleClickRow('RoleEditor' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleEditor' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleEditor' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle1');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(fileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C277003] Role Collaborator', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleCollaboratorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleCollaborator' + fileModel.name);
contentList.doubleClickRow('RoleCollaborator' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleCollaborator' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleCollaborator' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle2');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle2');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
});
await navigationBarPage.openContentServicesFolder(roleCollaboratorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleCollaborator' + fileModel.name);
await contentList.doubleClickRow('RoleCollaborator' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleCollaborator' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleCollaborator' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle2');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle2');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277004] Role Coordinator', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleCoordinatorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
contentList.doubleClickRow('RoleCoordinator' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.metadataContent('RoleCoordinator' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
browser.controlFlow().execute(async () => {
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle3');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle3');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
contentServicesPage.deleteContent('RoleCoordinator' + fileModel.name);
contentServicesPage.checkContentIsNotDisplayed('RoleCoordinator' + fileModel.name);
});
await navigationBarPage.openContentServicesFolder(roleCoordinatorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
await contentList.doubleClickRow('RoleCoordinator' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.metadataContent('RoleCoordinator' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle3');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle3');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
await contentServicesPage.deleteContent('RoleCoordinator' + fileModel.name);
await contentServicesPage.checkContentIsNotDisplayed('RoleCoordinator' + fileModel.name);
});
it('[C279881] No Permission User', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow('RoleConsumer' + fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
notificationPage.checkNotifyContains('You are not allowed to change permissions');
permissionsPage.clickAddPermissionButton();
notificationPage.checkNotifyContains('You are not allowed to change permissions');
await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow('RoleConsumer' + fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions');
await permissionsPage.clickAddPermissionButton();
await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions');
});
});
@@ -29,7 +29,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Permissions Component', function () {
describe('Permissions Component', () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -53,18 +53,18 @@ describe('Permissions Component', function () {
let publicSite, privateSite, folderName;
const fileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let siteFolder, privateSiteFile;
@@ -76,7 +76,7 @@ describe('Permissions Component', function () {
contributorUser = new AcsUserModel();
managerUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(folderOwnerUser);
@@ -87,7 +87,7 @@ describe('Permissions Component', function () {
await this.alfrescoJsApi.core.peopleApi.addPerson(managerUser);
await this.alfrescoJsApi.login(folderOwnerUser.id, folderOwnerUser.password);
browser.sleep(15000);
await browser.sleep(15000);
const publicSiteName = `PUBLIC_TEST_SITE_${StringUtil.generateRandomString(5)}`;
@@ -144,121 +144,125 @@ describe('Permissions Component', function () {
await uploadActions.uploadFile(fileModel.location, 'Site' + fileModel.name, siteFolder.entry.id);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
done();
});
describe('Role Site Dropdown', function () {
describe('Role Site Dropdown', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(folderOwnerUser);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + publicSite.entry.guid);
done();
});
it('[C277002] Should display the Role Site dropdown', async () => {
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentList.rightClickOnRow(folderName);
await contentList.rightClickOnRow(folderName);
contentServicesPage.pressContextMenuActionNamed('Permission');
await contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.searchUserOrGroup(consumerUser.getId());
permissionsPage.clickUserOrGroup(consumerUser.getFirstName());
permissionsPage.checkUserOrGroupIsAdded(consumerUser.getId());
await browser.sleep(5000);
expect(permissionsPage.getRoleCellValue(consumerUser.getId())).toEqual('SiteCollaborator');
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());
await permissionsPage.searchUserOrGroup(consumerUser.getId());
expect(permissionsPage.getRoleDropdownOptions().count()).toBe(4);
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe(CONSTANTS.CS_USER_ROLES.COLLABORATOR);
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONSUMER);
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONTRIBUTOR);
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe(CONSTANTS.CS_USER_ROLES.MANAGER);
await permissionsPage.clickUserOrGroup(consumerUser.getFirstName());
await permissionsPage.checkUserOrGroupIsAdded(consumerUser.getId());
await expect(await permissionsPage.getRoleCellValue(consumerUser.getId())).toEqual('SiteCollaborator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());
const roleDropdownOptions = permissionsPage.getRoleDropdownOptions();
await expect(await roleDropdownOptions.count()).toBe(4);
await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe(CONSTANTS.CS_USER_ROLES.COLLABORATOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe(CONSTANTS.CS_USER_ROLES.CONSUMER);
await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe(CONSTANTS.CS_USER_ROLES.CONTRIBUTOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe(CONSTANTS.CS_USER_ROLES.MANAGER);
});
});
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', function () {
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', () => {
it('[C276994] Role SiteConsumer', async () => {
await loginPage.loginToContentServicesUsingUserModel(siteConsumerUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
await contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentServicesPage.metadataContent('Site' + fileModel.name);
notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(fileModel.location);
await contentServicesPage.uploadFile(fileModel.location);
notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276997] Role SiteContributor', async () => {
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
await contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentServicesPage.metadataContent('Site' + fileModel.name);
notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
@@ -266,86 +270,81 @@ describe('Permissions Component', function () {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
await contentList.checkActionMenuIsNotDisplayed();
contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('Site' + fileModel.name);
contentServicesPage.metadataContent('Site' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle');
await metadataViewPage.clickCloseButton();
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
});
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277006] Role SiteManager', async () => {
await loginPage.loginToContentServicesUsingUserModel(managerUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentList.waitForTableBody();
await contentServicesPage.metadataContent('Site' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
browser.controlFlow().execute(async () => {
await metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('newDescription');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('newDescription');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentServicesPage.deleteContent('Site' + fileModel.name);
contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name);
});
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.deleteContent('Site' + fileModel.name);
await contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name);
});
});
@@ -48,13 +48,13 @@ describe('Share file', () => {
const acsUser = new AcsUserModel();
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let nodeId;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
@@ -67,147 +67,144 @@ describe('Share file', () => {
await navigationBarPage.clickContentServicesButton();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
describe('Shared link dialog', () => {
beforeAll(() => {
contentListPage.selectRow(pngFileModel.name);
beforeAll(async () => {
await contentListPage.selectRow(pngFileModel.name);
});
afterEach(() => {
BrowserActions.closeMenuAndDialogs();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C286549] Should check automatically toggle button in Share dialog', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
it('[C286549] Should check automatically toggle button in Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
});
it('[C286544] Should display notification when clicking URL copy button', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
it('[C286544] Should display notification when clicking URL copy button', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
});
it('[C286543] Should be possible to close Share dialog', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
it('[C286543] Should be possible to close Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.calendarTodayDayIsDisabled();
it('[C286578] Should disable today option in expiration day calendar', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.calendarTodayDayIsDisabled();
});
it('[C286548] Should be possible to set expiry date for link', async () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.setDefaultDay();
shareDialog.setDefaultHour();
shareDialog.setDefaultMinutes();
shareDialog.dateTimePickerDialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.setDefaultDay();
await shareDialog.setDefaultHour();
await shareDialog.setDefaultMinutes();
await shareDialog.dateTimePickerDialogIsClosed();
const value = await shareDialog.getExpirationDate();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.expirationDateInputHasValue(value);
BrowserActions.closeMenuAndDialogs();
await shareDialog.clickCloseButton();
await shareDialog.dialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.expirationDateInputHasValue(value);
await BrowserActions.closeMenuAndDialogs();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.calendarTodayDayIsDisabled();
it('[C286578] Should disable today option in expiration day calendar', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.calendarTodayDayIsDisabled();
});
it('[C310329] Should be possible to set expiry date only for link', async () => {
await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date'));
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.setDefaultDay();
shareDialog.dateTimePickerDialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.setDefaultDay();
await shareDialog.dateTimePickerDialogIsClosed();
const value = await shareDialog.getExpirationDate();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.expirationDateInputHasValue(value);
BrowserActions.closeMenuAndDialogs();
await shareDialog.clickCloseButton();
await shareDialog.dialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.expirationDateInputHasValue(value);
await BrowserActions.closeMenuAndDialogs();
});
});
describe('Shared link preview', () => {
afterEach((done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
afterEach(async() => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
});
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
it('[C286565] Should open file when logged user access shared link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickCloseButton();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await shareDialog.clickCloseButton();
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const secondSharedLink = await shareDialog.getShareLink();
expect(sharedLink).toEqual(secondSharedLink);
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await expect(sharedLink).toEqual(secondSharedLink);
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C286539] Should open file when non-logged user access shared link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickCloseButton();
navigationBarPage.clickLogoutButton();
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await shareDialog.clickCloseButton();
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
});
});
@@ -16,7 +16,14 @@
*/
import CONSTANTS = require('../../util/constants');
import { StringUtil, BrowserActions, NotificationHistoryPage, LoginPage, ErrorPage, UploadActions } from '@alfresco/adf-testing';
import {
StringUtil,
BrowserActions,
NotificationHistoryPage,
LoginPage,
ErrorPage,
UploadActions
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
@@ -48,11 +55,11 @@ describe('Unshare file', () => {
let nodeId;
let testSite;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
const site = {
title: siteName,
visibility: 'PRIVATE',
@@ -98,88 +105,88 @@ describe('Unshare file', () => {
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navBar.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
await navBar.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async (done) => {
afterEach(async () => {
await browser.refresh();
done();
});
describe('with permission', () => {
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
it('[C286550] Should display unshare confirmation dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
it('[C286550] Should display unshare confirmation dialog', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
});
it('[C286551] Should be able to cancel unshare action', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogCancelButton();
shareDialog.shareToggleButtonIsChecked();
it('[C286551] Should be able to cancel unshare action', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogCancelButton();
await shareDialog.shareToggleButtonIsChecked();
});
it('[C286552] Should be able to confirm unshare action', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.dialogIsClosed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
});
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.dialogIsClosed();
BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.host));
errorPage.checkErrorCode();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.host));
await errorPage.checkErrorCode();
});
});
describe('without permission', () => {
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.sitesApi.deleteSite(siteName, { permanent: true });
done();
});
it('[C286555] Should NOT be able to unshare file without permission', () => {
navBar.goToSite(testSite);
contentListPage.doubleClickRow('documentLibrary');
contentListPage.selectRow(nodeBody.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`);
it('[C286555] Should NOT be able to unshare file without permission', async () => {
await navBar.goToSite(testSite);
await contentListPage.doubleClickRow('documentLibrary');
await contentListPage.selectRow(nodeBody.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`);
});
});
});
@@ -52,7 +52,7 @@ describe('Social component', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(componentOwner);
@@ -81,13 +81,12 @@ describe('Social component', () => {
}
});
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await uploadActions.deleteFileOrFolder(emptyFile.entry.id);
done();
});
describe('User interaction on their own components', () => {
@@ -97,21 +96,21 @@ describe('Social component', () => {
await navigationBarPage.clickSocialButton();
});
it('[C203006] Should be able to like and unlike their components but not rate them,', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toBe('0');
expect(ratePage.isNotStarRated(4));
expect(ratePage.getUnratedStarColor(4)).toBe(averageStarColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toBe('0');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
it('[C203006] Should be able to like and unlike their components but not rate them,', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toBe('0');
await expect(await ratePage.isNotStarRated(4));
await expect(await ratePage.getUnratedStarColor(4)).toBe(averageStarColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toBe('0');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
});
@@ -123,32 +122,32 @@ describe('Social component', () => {
await navigationBarPage.clickSocialButton();
});
it('[C260324] Should be able to like and unlike a component', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(likePage.getLikeCounter()).toEqual('0');
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toBe('0');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
it('[C260324] Should be able to like and unlike a component', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await likePage.getLikeCounter()).toEqual('0');
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toBe('0');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
it('[C310198] Should be able to rate and unRate a component', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(ratePage.getRatingCounter()).toBe('0');
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toBe('1');
expect(ratePage.isStarRated(4));
expect(ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
ratePage.removeRating(4);
expect(ratePage.getRatingCounter()).toBe('0');
expect(ratePage.isNotStarRated(4));
it('[C310198] Should be able to rate and unRate a component', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await ratePage.getRatingCounter()).toBe('0');
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toBe('1');
await expect(await ratePage.isStarRated(4));
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await ratePage.removeRating(4);
await expect(await ratePage.getRatingCounter()).toBe('0');
await expect(await ratePage.isNotStarRated(4));
});
});
@@ -161,48 +160,48 @@ describe('Social component', () => {
});
it('[C310197] Should be able to like, unLike, display total likes', async () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await loginPage.loginToContentServicesUsingUserModel(secondComponentVisitor);
navigationBarPage.clickSocialButton();
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toEqual('2');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toEqual('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await navigationBarPage.clickSocialButton();
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toEqual('2');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toEqual('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
it('[C260327] Should be able to rate, unRate, display total ratings, display average rating', async () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.isStarRated(4));
expect(ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.isStarRated(4));
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await loginPage.loginToContentServicesUsingUserModel(secondComponentVisitor);
navigationBarPage.clickSocialButton();
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.getAverageStarColor(4)).toBe(averageStarColor);
ratePage.rateComponent(0);
expect(ratePage.getRatingCounter()).toEqual('2');
expect(ratePage.isStarRated(2));
ratePage.removeRating(0);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.getAverageStarColor(4)).toBe(averageStarColor);
await navigationBarPage.clickSocialButton();
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
await ratePage.rateComponent(0);
await expect(await ratePage.getRatingCounter()).toEqual('2');
await expect(await ratePage.isStarRated(2));
await ratePage.removeRating(0);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
});
});
});
@@ -18,13 +18,20 @@
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ApiService, LoginSSOPage, UploadActions, IdentityService, SettingsPage, StringUtil, UserModel } from '@alfresco/adf-testing';
import {
ApiService,
LoginSSOPage,
UploadActions,
IdentityService,
SettingsPage,
StringUtil,
UserModel,
FileBrowserUtil
} from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/fileModel';
import { ViewerPage } from '../../pages/adf/viewerPage';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import * as path from 'path';
import { Util } from '../../util/util';
describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList, implicitFlow true', () => {
@@ -65,15 +72,13 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
}
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const downloadedPngFile = path.join(__dirname, 'downloads', pngFileModel.name);
const downloadedMultipleFiles = path.join(__dirname, 'downloads', 'archive.zip');
const folderName = StringUtil.generateRandomString(5);
const acsUser = new UserModel();
let identityService: IdentityService;
describe('SSO in ADF using ACS and AIS, implicit flow set', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.hostSso, 'ECM');
await apiService.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -100,12 +105,11 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
contentListPage.doubleClickRow(folderName);
await contentListPage.doubleClickRow(folderName);
await contentListPage.waitForTableBody();
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(folder.entry.id);
@@ -113,62 +117,55 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
} catch (error) {
}
await this.alfrescoJsApi.logout();
browser.executeScript('window.sessionStorage.clear();');
browser.executeScript('window.localStorage.clear();');
done();
await browser.executeScript('window.sessionStorage.clear();');
await browser.executeScript('window.localStorage.clear();');
});
afterEach(async (done) => {
browser.refresh();
contentListPage.waitForTableBody();
done();
afterEach(async () => {
await browser.refresh();
await contentListPage.waitForTableBody();
});
it('[C291936] Should be able to download a file', async (done) => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickDownloadButton();
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
done();
it('[C291936] Should be able to download a file', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickDownloadButton();
await expect(await FileBrowserUtil.isFileDownloaded(pngFileModel.name)).toBe(true, `${pngFileModel.name} not downloaded`);
});
it('[C291938] Should be able to open a document', async (done) => {
contentServicesPage.doubleClickRow(firstPdfFileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.checkFileNameIsDisplayed(firstPdfFileModel.name);
viewerPage.clickCloseButton();
contentListPage.waitForTableBody();
done();
it('[C291938] Should be able to open a document', async () => {
await contentServicesPage.doubleClickRow(firstPdfFileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(firstPdfFileModel.name);
await viewerPage.clickCloseButton();
await contentListPage.waitForTableBody();
});
it('[C291942] Should be able to open an image', async (done) => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
viewerPage.clickCloseButton();
contentListPage.waitForTableBody();
done();
it('[C291942] Should be able to open an image', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await viewerPage.clickCloseButton();
await contentListPage.waitForTableBody();
});
it('[C291941] Should be able to download multiple files', async (done) => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.checkAcsContainer();
contentListPage.dataTablePage().checkAllRows();
contentListPage.dataTablePage().checkRowIsChecked('Display name', pngFileModel.name);
contentListPage.dataTablePage().checkRowIsChecked('Display name', firstPdfFileModel.name);
contentServicesPage.clickDownloadButton();
expect(Util.fileExists(downloadedMultipleFiles, 30)).toBe(true);
done();
it('[C291941] Should be able to download multiple files', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.checkAcsContainer();
await contentListPage.dataTablePage().checkAllRows();
await contentListPage.dataTablePage().checkRowIsChecked('Display name', pngFileModel.name);
await contentListPage.dataTablePage().checkRowIsChecked('Display name', firstPdfFileModel.name);
await contentServicesPage.clickDownloadButton();
await expect(await FileBrowserUtil.isFileDownloaded('archive.zip')).toBe(true, `archive.zip not downloaded`);
});
it('[C291940] Should be able to view thumbnails when enabled', async (done) => {
contentServicesPage.enableThumbnails();
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();
it('[C291940] Should be able to view thumbnails when enabled', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
const filePdfIconUrl = await contentServicesPage.getRowIconImageUrl(firstPdfFileModel.name);
expect(filePdfIconUrl).toContain(`/versions/1/nodes/${pdfUploadedFile.entry.id}/renditions`);
await expect(filePdfIconUrl).toContain(`/versions/1/nodes/${pdfUploadedFile.entry.id}/renditions`);
const filePngIconUrl = await contentServicesPage.getRowIconImageUrl(pngFileModel.name);
expect(filePngIconUrl).toContain(`/versions/1/nodes/${pngUploadedFile.entry.id}/renditions`);
done();
await expect(filePngIconUrl).toContain(`/versions/1/nodes/${pngUploadedFile.entry.id}/renditions`);
});
});
});
+71 -72
View File
@@ -36,8 +36,8 @@ describe('Tag component', () => {
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
const deleteFile = new FileModel({ 'name': StringUtil.generateRandomString() });
const pdfFileModel = new FileModel({ name: resources.Files.ADF_DOCUMENTS.PDF.file_name });
const deleteFile = new FileModel({ name: StringUtil.generateRandomString() });
const sameTag = StringUtil.generateRandomString().toLowerCase();
const tagList = [
@@ -56,7 +56,7 @@ describe('Tag component', () => {
const nonLatinTag = StringUtil.generateRandomStringNonLatin();
let pdfUploadedFile, nodeId;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -77,122 +77,121 @@ describe('Tag component', () => {
await this.alfrescoJsApi.core.tagsApi.addTag(nodeId, tags);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
done();
});
it('[C260374] Should NOT be possible to add a new tag without Node ID', () => {
navigationBarPage.clickTagButton();
it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => {
await navigationBarPage.clickTagButton();
expect(tagPage.getNodeId()).toEqual('');
expect(tagPage.getNewTagPlaceholder()).toEqual('New Tag');
expect(tagPage.addTagButtonIsEnabled()).toEqual(false);
tagPage.checkTagListIsEmpty();
tagPage.checkTagListByNodeIdIsEmpty();
expect(tagPage.addNewTagInput('a').addTagButtonIsEnabled()).toEqual(false);
expect(tagPage.getNewTagInput()).toEqual('a');
await expect(await tagPage.getNodeId()).toEqual('');
await expect(await tagPage.getNewTagPlaceholder()).toEqual('New Tag');
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
await tagPage.checkTagListIsEmpty();
await tagPage.checkTagListByNodeIdIsEmpty();
await tagPage.addNewTagInput('a');
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
await expect(await tagPage.getNewTagInput()).toEqual('a');
});
it('[C268151] Should be possible to add a new tag to a Node', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[0]);
it('[C268151] Should be possible to add a new tag to a Node', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[0]);
tagPage.checkTagIsDisplayedInTagList(tagList[0]);
tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
await tagPage.checkTagIsDisplayedInTagList(tagList[0]);
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
});
it('[C260377] Should NOT be possible to add a tag that already exists', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(sameTag);
tagPage.checkTagIsDisplayedInTagList(sameTag);
tagPage.addTag(sameTag);
expect(tagPage.getErrorMessage()).toEqual('Tag already exists');
it('[C260377] Should NOT be possible to add a tag that already exists', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(sameTag);
await tagPage.checkTagIsDisplayedInTagList(sameTag);
await tagPage.addTag(sameTag);
await expect(await tagPage.getErrorMessage()).toEqual('Tag already exists');
});
it('[C91326] Should be possible to create a tag with different characters', () => {
tagPage.insertNodeId(pdfFileModel.id);
it('[C91326] Should be possible to create a tag with different characters', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(uppercaseTag + digitsTag + nonLatinTag);
await tagPage.addTag(uppercaseTag + digitsTag + nonLatinTag);
browser.driver.sleep(5000); // wait CS return tags
await browser.sleep(5000); // wait CS return tags
tagPage.checkTagIsDisplayedInTagList(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
tagPage.checkTagIsDisplayedInTagListByNodeId(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
await tagPage.checkTagIsDisplayedInTagList(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
await tagPage.checkTagIsDisplayedInTagListByNodeId(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
tagPage.checkTagIsNotDisplayedInTagList(uppercaseTag + digitsTag + nonLatinTag);
await tagPage.checkTagIsNotDisplayedInTagList(uppercaseTag + digitsTag + nonLatinTag);
});
it('[C260375] Should be possible to delete a tag', () => {
it('[C260375] Should be possible to delete a tag', async () => {
const deleteTag = StringUtil.generateRandomString().toUpperCase();
tagPage.insertNodeId(deleteFile.id);
await tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
await tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagListByNodeId(deleteTag.toLowerCase());
await tagPage.deleteTagFromTagListByNodeId(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.insertNodeId(deleteFile.id);
await tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
await tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagList(deleteTag.toLowerCase());
await tagPage.deleteTagFromTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
});
it('[C286290] Should be able to hide the delete option from a tag component', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[3]);
it('[C286290] Should be able to hide the delete option from a tag component', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[3]);
tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[3]);
tagPage.checkDeleteTagFromTagListByNodeIdIsDisplayed(tagList[3]);
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[3]);
await tagPage.checkDeleteTagFromTagListByNodeIdIsDisplayed(tagList[3]);
tagPage.clickShowDeleteButtonSwitch();
await tagPage.clickShowDeleteButtonSwitch();
tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
await tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
});
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', () => {
tagPage.insertNodeId(pdfFileModel.id);
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
tagPage.checkShowMoreButtonIsDisplayed();
tagPage.checkShowLessButtonIsNotDisplayed();
await tagPage.checkShowMoreButtonIsDisplayed();
await tagPage.checkShowLessButtonIsNotDisplayed();
expect(tagPage.checkTagsOnList()).toEqual(10);
await expect(await tagPage.checkTagsOnList()).toEqual(10);
tagPage.clickShowMoreButton();
tagPage.checkShowLessButtonIsDisplayed();
await tagPage.clickShowMoreButton();
await tagPage.checkShowLessButtonIsDisplayed();
tagPage.clickShowLessButton();
tagPage.checkShowLessButtonIsNotDisplayed();
await tagPage.clickShowLessButton();
await tagPage.checkShowLessButtonIsNotDisplayed();
});
it('[C260378] Should be possible to add multiple tags', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[2]);
it('[C260378] Should be possible to add multiple tags', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[2]);
browser.driver.sleep(5000); // wait CS return tags
await browser.sleep(5000); // wait CS return tags
tagPage.checkTagListIsOrderedAscending();
tagPage.checkTagListByNodeIdIsOrderedAscending();
tagPage.checkTagListContentServicesIsOrderedAscending();
await tagPage.checkTagListIsOrderedAscending();
await tagPage.checkTagListByNodeIdIsOrderedAscending();
await tagPage.checkTagListContentServicesIsOrderedAscending();
});
});
+53 -66
View File
@@ -54,97 +54,84 @@ describe('Trashcan - Pagination', () => {
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ 'name': 'newFolder' });
const nrOfFiles = 20;
const newFolderModel = new FolderModel({ name: 'newFolder' });
const noOfFiles = 20;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
const fileNames = Util.generateSequenceFiles(10, noOfFiles + 9, pagination.base, pagination.extension);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-');
const emptyFiles = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
await emptyFiles.list.entries.forEach(async (node) => {
await this.alfrescoJsApi.node.deleteNode(node.entry.id).then(() => {
}, () => {
this.alfrescoJsApi.node.deleteNode(node.entry.id);
const emptyFiles: any = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
for (const entry of emptyFiles.list.entries) {
await this.alfrescoJsApi.node.deleteNode(entry.entry.id).then(() => {}, () => {
this.alfrescoJsApi.node.deleteNode(entry.entry.id);
});
});
}
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
done();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
afterEach((done) => {
browser.refresh();
trashcanPage.waitForTableBody();
done();
afterEach(async () => {
await browser.refresh();
await trashcanPage.waitForTableBody();
});
it('[C272811] Should be able to set Items per page to 20', () => {
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C272811] Should be able to set Items per page to 20', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + noOfFiles + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(noOfFiles);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276742] Should be able to set Items per page to 15', () => {
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276742] Should be able to set Items per page to 15', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276743] Should be able to set Items per page to 10', () => {
paginationPage.selectItemsPerPage(itemsPerPage.ten);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276743] Should be able to set Items per page to 10', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276744] Should be able to set Items per page to 5', () => {
paginationPage.selectItemsPerPage(itemsPerPage.five);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276744] Should be able to set Items per page to 5', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
})
;
+37 -40
View File
@@ -45,7 +45,7 @@ describe('Tree View Component', () => {
document: 'MyFile'
};
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -69,78 +69,75 @@ describe('Tree View Component', () => {
nodeType: 'cm:content'
});
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickTreeViewButton();
done();
await navigationBarPage.clickTreeViewButton();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(treeFolder.entry.id);
await uploadActions.deleteFileOrFolder(secondTreeFolder.entry.id);
done();
});
it('[C289972] Should be able to show folders and sub-folders of a node as a tree view', () => {
treeViewPage.checkTreeViewTitleIsDisplayed();
it('[C289972] Should be able to show folders and sub-folders of a node as a tree view', async () => {
await treeViewPage.checkTreeViewTitleIsDisplayed();
expect(treeViewPage.getNodeId()).toEqual(nodeNames.parentFolder);
await expect(await treeViewPage.getNodeId()).toEqual(nodeNames.parentFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.thirdFolder);
await treeViewPage.clickNode(nodeNames.thirdFolder);
treeViewPage.checkClickedNodeName(nodeNames.thirdFolder);
treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.checkNodeIsNotDisplayed(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsNotDisplayed(nodeNames.thirdFolder);
});
it('[C289973] Should be able to change the default nodeId', () => {
treeViewPage.clearNodeIdInput();
it('[C289973] Should be able to change the default nodeId', async () => {
await treeViewPage.clearNodeIdInput();
treeViewPage.checkNoNodeIdMessageIsDisplayed();
treeViewPage.addNodeId(secondTreeFolder.entry.id);
await treeViewPage.checkNoNodeIdMessageIsDisplayed();
await treeViewPage.addNodeId(secondTreeFolder.entry.id);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.addNodeId('ThisIdDoesNotExist');
treeViewPage.checkErrorMessageIsDisplayed();
await treeViewPage.addNodeId('ThisIdDoesNotExist');
await treeViewPage.checkErrorMessageIsDisplayed();
treeViewPage.addNodeId(nodeNames.parentFolder);
await treeViewPage.addNodeId(nodeNames.parentFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
});
it('[C290071] Should not be able to display files', () => {
treeViewPage.addNodeId(secondTreeFolder.entry.id);
it('[C290071] Should not be able to display files', async () => {
await treeViewPage.addNodeId(secondTreeFolder.entry.id);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.thirdFolder);
await treeViewPage.clickNode(nodeNames.thirdFolder);
expect(treeViewPage.getTotalNodes()).toEqual(1);
await expect(await treeViewPage.getTotalNodes()).toEqual(1);
});
});
@@ -26,12 +26,12 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Upload component', () => {
describe('Upload component', async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
@@ -53,7 +53,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,55 +62,57 @@ describe('Upload component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', () => {
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', async () => {
await browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
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)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C272793] Should be able to cancel multiple files upload', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
it('[C272793] Should be able to cancel multiple files upload', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name).checkContentIsNotDisplayed(largeFile.name);
uploadToggles.disableMultipleFileUpload();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await uploadToggles.disableMultipleFileUpload();
});
});
@@ -55,7 +55,7 @@ describe('Upload component - Excluded Files', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -69,42 +69,39 @@ describe('Upload component - Excluded Files', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
afterEach(async (done) => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C279914] Should not allow upload default excluded files using D&D', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
it('[C279914] Should not allow upload default excluded files using D&D', async () => {
await contentServicesPage.checkDragAndDropDIsDisplayed();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
await dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
browser.driver.sleep(5000);
await browser.sleep(5000);
uploadDialog.dialogIsNotDisplayed();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C260122] Should not allow upload default excluded files using Upload button', () => {
contentServicesPage
.uploadFile(iniExcludedFile.location)
.checkContentIsNotDisplayed(iniExcludedFile.name);
it('[C260122] Should not allow upload default excluded files using Upload button', async () => {
await contentServicesPage.uploadFile(iniExcludedFile.location);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', async () => {
@@ -113,11 +110,12 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage
.uploadFile(txtFileModel.location)
.checkContentIsNotDisplayed(txtFileModel.name);
await contentServicesPage
.uploadFile(txtFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(txtFileModel.name);
});
it('[C274688] Should extension type added as excluded and accepted not be uploaded', async () => {
@@ -126,14 +124,14 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.png');
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.png');
contentServicesPage.uploadFile(pngFile.location);
browser.driver.sleep(1000);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.uploadFile(pngFile.location);
await browser.sleep(1000);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
});
});
@@ -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 { BrowserActions, LoginPage, UploadActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
import { FileModel } from '../../models/ACS/fileModel';
import { browser } from 'protractor';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
describe('Upload component', () => {
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
const versionManagePage = new VersionManagePage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const firstPdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const pngFileModelTwo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
});
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
for (const node of nodesPromise) {
const nodeId = await node;
await uploadActions.deleteFileOrFolder(nodeId);
}
}
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await 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');
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');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage .checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(pngFileModel.location);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});
+84 -65
View File
@@ -66,28 +66,28 @@ describe('Upload component', () => {
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async (done) => {
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
@@ -97,80 +97,99 @@ describe('Upload component', () => {
await uploadActions.deleteFileOrFolder(nodeId);
});
}
done();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', () => {
contentServicesPage.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.removeUploadedFile(pdfFileModel.name).fileIsCancelled(pdfFileModel.name);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', () => {
contentServicesPage.uploadFile(pngFileModelTwo.location).checkContentIsDisplayed(pngFileModelTwo.name);
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
uploadDialog.fileIsUploaded(pngFileModelTwo.name);
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name).fileIsUploaded(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name).fileIsNotDisplayedInDialog(pngFileModel.name).fileIsNotDisplayedInDialog(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', () => {
contentServicesPage.checkAcsContainer();
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile(filesLocation).checkContentsAreDisplayed(filesName);
uploadDialog.filesAreUploaded(filesName);
expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
uploadToggles.disableMultipleFileUpload();
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', () => {
contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
contentServicesPage.versionManagerContent(docxFileModel.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(
pngFileModel.location
);
versionManagePage.closeVersionDialog();
uploadDialog.removeUploadedFile(pngFileModel.name);
contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});
@@ -36,9 +36,9 @@ describe('Upload component', () => {
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const navigationBarPage = new NavigationBarPage();
@@ -67,7 +67,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -75,259 +75,255 @@ describe('Upload component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
describe('', () => {
beforeEach(() => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
const nodeList = await contentServicesPage.getElementsDisplayedId();
for (const node of nodeList) {
try {
await uploadActions.deleteFileOrFolder(node);
} catch (error) {
}
}
});
afterEach(async (done) => {
it('[C272788] Should display upload button', async () => {
await expect(await contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
contentServicesPage.getElementsDisplayedId().then((nodeList) => {
nodeList.forEach(async (currentNode) => {
await uploadActions.deleteFileOrFolder(currentNode);
});
});
done();
await contentServicesPage.checkUploadButton();
await contentServicesPage.checkContentIsDisplayed(firstPdfFileModel.name);
});
it('[C272788] Should display upload button', () => {
expect(contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
it('[C272789] Should be able to upload PDF file', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage
.checkUploadButton()
.checkContentIsDisplayed(firstPdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272789] Should be able to upload PDF file', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C272790] Should be able to upload text file', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272790] Should be able to upload text file', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260141] Should be possible to upload PNG file', async () => {
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260141] Should be possible to upload PNG file', () => {
contentServicesPage
.uploadFile(pngFileModel.location)
.checkContentIsDisplayed(pngFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await 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');
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');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
it('[C272794] Should display tooltip for uploading files', async () => {
await uploadToggles.enableMultipleFileUpload();
await uploadToggles.checkMultipleFileUploadToggleIsEnabled();
await expect(await contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
await uploadToggles.disableMultipleFileUpload();
});
it('[C272794] Should display tooltip for uploading files', () => {
uploadToggles.enableMultipleFileUpload();
uploadToggles.checkMultipleFileUploadToggleIsEnabled();
browser.driver.sleep(1000);
expect(contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
uploadToggles.disableMultipleFileUpload();
});
it('[C279920] Should rename a file uploaded twice', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C279920] Should rename a file uploaded twice', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.getVersionName());
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
pdfFileModel.setVersion('');
});
it('[C260172] Should be possible to enable versioning', () => {
uploadToggles.enableVersioning();
uploadToggles.checkVersioningToggleIsEnabled();
it('[C260172] Should be possible to enable versioning', async () => {
await uploadToggles.enableVersioning();
await uploadToggles.checkVersioningToggleIsEnabled();
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog
.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage
.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
pdfFileModel.setVersion('');
uploadToggles.disableVersioning();
await uploadToggles.disableVersioning();
});
it('[C260174] Should be possible to set a max size', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('400');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.deleteContent(fileWithSpecificSize.name);
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadToggles.addMaxSize('399');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
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();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.deleteContent(fileWithSpecificSize.name);
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadToggles.addMaxSize('399');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272796] Should be possible to set max size to 0', () => {
contentServicesPage.goToDocumentList();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('0');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
it('[C272796] Should be possible to set max size to 0', async () => {
await contentServicesPage.goToDocumentList();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
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');
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272797] Should be possible to set max size to 1', () => {
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
browser.driver.sleep(1000);
uploadToggles.addMaxSize('1');
uploadToggles.disableMaxSize();
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
it('[C272797] Should be possible to set max size to 1', async () => {
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await browser.sleep(1000);
await uploadToggles.addMaxSize('1');
await uploadToggles.disableMaxSize();
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
});
it('[C91318] Should Enable/Disable upload button when change the disable property', () => {
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeFalsy();
it('[C91318] Should Enable/Disable upload button when change the disable property', async () => {
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(false, 'Upload button is enabled');
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeTruthy();
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(true, 'Upload button not enabled');
});
});
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
contentServicesPage.uploadFile(docxFileModel.location).checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
const dragAndDrop = new DropActions();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
await dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C291921] Should display tooltip for uploading files on a not found location', async () => {
const folderName = StringUtil.generateRandomString(8);
const folderUploadedModel = await browser.controlFlow().execute(async () => {
return await uploadActions.createFolder(folderName, '-my-');
});
const folderUploadedModel = await uploadActions.createFolder(folderName, '-my-');
await navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
await contentServicesPage.checkUploadButton();
navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
contentServicesPage.checkUploadButton();
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
browser.controlFlow().execute(async () => {
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
});
await contentServicesPage.uploadFile(pdfFileModel.location);
contentServicesPage.uploadFile(pdfFileModel.location);
uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
await uploadDialog.displayTooltip();
await expect(await uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
});
});
@@ -56,14 +56,14 @@ describe('Upload - User permission', () => {
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
beforeAll(() => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
});
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
acsUserTwo = new AcsUserModel();
@@ -95,106 +95,99 @@ describe('Upload - User permission', () => {
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
});
describe('Consumer permissions', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C291921] Should display tooltip for uploading files without permissions', () => {
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
it('[C291921] Should display tooltip for uploading files without permissions', async () => {
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
contentServicesPage.checkDragAndDropDIsDisplayed();
await contentServicesPage.checkDragAndDropDIsDisplayed();
contentServicesPage.dragAndDropFile(emptyFile.location);
await contentServicesPage.dragAndDropFile(emptyFile.location);
uploadDialog.fileIsError(emptyFile.name);
await uploadDialog.fileIsError(emptyFile.name);
uploadDialog.displayTooltip();
await uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
await 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', () => {
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
browser.sleep(3000);
await browser.sleep(3000);
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
});
describe('full permissions', () => {
beforeEach(async (done) => {
navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
beforeEach(async () => {
await navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', () => {
contentServicesPage.uploadFile(emptyFile.location);
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
});
});
describe('multiple users', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C260175] Should two different user upload files in the proper User Home', async () => {
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
contentServicesPage.uploadFile(pngFile.location);
await contentServicesPage.uploadFile(pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.uploadFile(pdfFile.location);
await contentServicesPage.uploadFile(pdfFile.location);
contentServicesPage.checkContentIsDisplayed(pdfFile.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.name);
});
});
@@ -28,10 +28,8 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '@alfresco/adf-testing';
import { Util } from '../../util/util';
import path = require('path');
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { BrowserVisibility } from '@alfresco/adf-testing';
import { BrowserVisibility, FileBrowserUtil, BrowserActions } from '@alfresco/adf-testing';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
describe('Version component actions', () => {
@@ -40,6 +38,7 @@ describe('Version component actions', () => {
const contentServicesPage = new ContentServicesPage();
const versionManagePage = new VersionManagePage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialog();
const acsUser = new AcsUserModel();
@@ -49,8 +48,8 @@ describe('Version component actions', () => {
});
const fileModelVersionTwo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
});
let uploadActions;
@@ -59,122 +58,119 @@ describe('Version component actions', () => {
'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
uploadActions = new UploadActions(this.alfrescoJsApi);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const txtUploadedFile = await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, '-my-');
Object.assign(txtFileModel, txtUploadedFile.entry);
txtFileModel.update(txtUploadedFile.entry);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
beforeEach(async () => {
await contentServicesPage.versionManagerContent(txtFileModel.name);
});
it('[C280003] Should not be possible delete a file version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C280004] Should not be possible restore the version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
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);
await versionManagePage.closeActionsMenu();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
});
it('[C280005] Should be showed all the default action when you have more then one version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.clickActionButton('1.1').checkActionsArePresent('1.1');
versionManagePage.closeActionsMenu();
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);
await versionManagePage.closeActionsMenu();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
});
it('[C269081] Should be possible download all the version of a file', () => {
versionManagePage.downloadFileVersion('1.0');
it('[C280005] Should be showed all the default action when you have more then one version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
expect(Util.fileExists(path.join(__dirname, 'downloads', txtFileModel.name), 20)).toBe(true);
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.downloadFileVersion('1.1');
await versionManagePage.clickActionButton('1.1');
await versionManagePage.checkActionsArePresent('1.1');
expect(Util.fileExists(path.join(__dirname, 'downloads', fileModelVersionTwo.name), 20)).toBe(true);
await versionManagePage.closeActionsMenu();
await versionManagePage.closeVersionDialog();
await uploadDialog.clickOnCloseButton();
});
it('[C272819] Should be possible delete a version when click on delete version action', () => {
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.checkFileVersionExist('1.0');
it('[C269081] Should be possible download all the version of a file', async () => {
await versionManagePage.downloadFileVersion('1.0');
await expect(await FileBrowserUtil.isFileDownloaded(txtFileModel.name)).toBe(true, `${txtFileModel.name} not downloaded`);
await versionManagePage.downloadFileVersion('1.1');
await expect(await FileBrowserUtil.isFileDownloaded(fileModelVersionTwo.name)).toBe(true, `${fileModelVersionTwo.name} not downloaded`);
});
it('[C280006] Should be possible prevent a version to be deleted when click on No on the confirm dialog', () => {
versionManagePage.showNewVersionButton.click();
it('[C272819] Should be possible delete a version when click on delete version action', async () => {
await versionManagePage.deleteFileVersion('1.1');
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionExist('1.0');
});
versionManagePage.deleteFileVersion('1.1');
it('[C280006] Should be possible prevent a version to be deleted when click on No on the confirm dialog', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.clickCancelConfirm();
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.checkFileVersionExist('1.1');
versionManagePage.checkFileVersionExist('1.0');
versionManagePage.closeVersionDialog();
await versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickCancelConfirm();
await versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.checkFileVersionExist('1.0');
await versionManagePage.closeVersionDialog();
});
it('[C280007] Should be possible to restore an old version of your file and the document list updated', async () => {
contentServicesPage.versionManagerContent(fileModelVersionTwo.name);
versionManagePage.restoreFileVersion('1.0');
versionManagePage.checkFileVersionExist('2.0');
versionManagePage.closeVersionDialog();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
await contentServicesPage.versionManagerContent(fileModelVersionTwo.name);
await versionManagePage.restoreFileVersion('1.0');
await versionManagePage.checkFileVersionExist('2.0');
await versionManagePage.closeVersionDialog();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
});
it('[C307033] Should be possible to cancel the upload of a new version', async () => {
await browser.refresh();
contentServicesPage.versionManagerContent(txtFileModel.name);
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 1000)');
await contentServicesPage.versionManagerContent(txtFileModel.name);
await browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 1000)');
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
versionManagePage.closeVersionDialog();
await BrowserActions.click(versionManagePage.showNewVersionButton);
await expect(new UploadDialog().getTitleText()).toEqual('Upload canceled');
await versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
await versionManagePage.closeVersionDialog();
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await browser.refresh();
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
await contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
});
});
@@ -69,7 +69,7 @@ describe('Version component permissions', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
const nodeActions = new NodeActions();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -117,8 +117,6 @@ describe('Version component permissions', () => {
await this.alfrescoJsApi.login(fileCreatorUser.id, fileCreatorUser.password);
await uploadActions.uploadFile(differentCreatorFile.location, differentCreatorFile.name, site.entry.guid);
done();
});
describe('Manager', () => {
@@ -128,7 +126,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(managerUser.id, managerUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -136,70 +134,63 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(managerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
await navigationBarPage.openContentServicesFolder(site.entry.guid);
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277200] should a user with Manager permission be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277200] should a user with Manager permission be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277204] Should be disabled the option for locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
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');
});
});
describe('Consumer', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
});
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
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');
});
});
@@ -210,7 +201,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(contributorUser.id, contributorUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -218,49 +209,45 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', () => {
contentServices.versionManagerContent(sameCreatorFile.name);
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', async () => {
await contentServices.versionManagerContent(sameCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
});
it('[C277202] Should be disabled the option for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
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');
});
});
@@ -270,7 +257,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(collaboratorUser.id, collaboratorUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -278,62 +265,59 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', () => {
contentServices.versionManagerContent(sameCreatorFile.name);
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', async () => {
await contentServices.versionManagerContent(sameCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277199] should a user with Collaborator permission be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277199] should a user with Collaborator permission be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.clickActionButton('1.1');
await versionManagePage.clickActionButton('1.1');
expect(element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
await expect(await element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
await versionManagePage.closeActionsMenu();
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
});
it('[C277203] Should a user with Collaborator permission not be able to upload a new version for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
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');
});
});
@@ -49,7 +49,7 @@ describe('Version Properties', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -65,73 +65,50 @@ describe('Version Properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
it('[C272817] Should NOT be present the download action when allowDownload property is false', async () => {
await versionManagePage.disableDownload();
await versionManagePage.clickActionButton('1.0');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
await versionManagePage.closeDisabledActionsMenu();
});
it('[C272817] Should NOT be present the download action when allowDownload property is false', () => {
versionManagePage.disableDownload();
versionManagePage.clickActionButton('1.0');
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
versionManagePage.closeDisabledActionsMenu();
it('[C279992] Should be present the download action when allowDownload property is true', async () => {
await versionManagePage.enableDownload();
await versionManagePage.clickActionButton('1.0');
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
await versionManagePage.closeActionsMenu();
});
it('[C279992] Should be present the download action when allowDownload property is true', () => {
versionManagePage.enableDownload();
versionManagePage.clickActionButton('1.0');
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
versionManagePage.closeActionsMenu();
it('[C269085] Should show/hide comments when showComments true/false', async () => {
await versionManagePage.enableComments();
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.enterCommentText('Example comment text');
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
await versionManagePage.checkFileVersionExist('1.1');
await 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"]`)));
});
it('[C269085] Should show/hide comments when showComments true/false', () => {
versionManagePage.enableComments();
BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.enterCommentText('Example comment text');
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
versionManagePage.disableComments();
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-item-comment-1.1"]`)));
it('[C277277] Should show/hide actions menu when readOnly is true/false', async () => {
await versionManagePage.disableReadOnly();
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
await versionManagePage.enableReadOnly();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
});
it('[C277277] Should show/hide actions menu when readOnly is true/false', () => {
versionManagePage.disableReadOnly();
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
versionManagePage.enableReadOnly();
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
});
it('[C279994] Should show/hide upload new version button when readOnly is true/false', () => {
versionManagePage.disableReadOnly();
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
versionManagePage.enableReadOnly();
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.showNewVersionButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
it('[C279994] Should show/hide upload new version button when readOnly is true/false', async () => {
await versionManagePage.disableReadOnly();
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
await versionManagePage.enableReadOnly();
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.showNewVersionButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
});
});
@@ -17,7 +17,7 @@
import { browser } from 'protractor';
import { LoginPage, UploadActions, BrowserVisibility } from '@alfresco/adf-testing';
import { LoginPage, UploadActions, BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -67,7 +67,7 @@ describe('Version component', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -81,92 +81,82 @@ describe('Version component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
it('[C272768] Should be visible the first file version when you upload a file', async () => {
await versionManagePage.checkUploadNewVersionsButtonIsDisplayed();
await versionManagePage.checkFileVersionExist('1.0');
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
});
it('[C272768] Should be visible the first file version when you upload a file', () => {
versionManagePage.checkUploadNewVersionsButtonIsDisplayed();
it('[C279995] Should show/hide the new upload file options when click on add New version/cancel button', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.checkFileVersionExist('1.0');
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.majorRadio);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.minorRadio);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.commentText);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.uploadNewVersionButton);
await BrowserActions.click(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.majorRadio);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.minorRadio);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.commentText);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
});
it('[C279995] Should show/hide the new upload file options when click on add New version/cancel button', () => {
versionManagePage.showNewVersionButton.click();
it('[C260244] Should show the version history when select a file with multiple version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
browser.driver.sleep(300);
await versionManagePage.checkFileVersionExist('1.0');
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.majorRadio);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.minorRadio);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.commentText);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.uploadNewVersionButton);
versionManagePage.cancelButton.click();
browser.driver.sleep(300);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.majorRadio);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.minorRadio);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.commentText);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
});
it('[C260244] Should show the version history when select a file with multiple version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
it('[C269084] Should be possible add a comment when add a new version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.enterCommentText('Example comment text');
await versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
versionManagePage.checkFileVersionExist('1.0');
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
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');
});
it('[C269084] Should be possible add a comment when add a new version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.enterCommentText('Example comment text');
versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
it('[C275719] Should be possible preview the file when you add a new version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.clickMajorChange();
versionManagePage.checkFileVersionExist('1.2');
expect(versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
expect(versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
expect(versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
});
await versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
it('[C275719] Should be possible preview the file when you add a new version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.clickMajorChange();
await versionManagePage.checkFileVersionExist('2.0');
await expect(await versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.clickMinorChange();
versionManagePage.checkFileVersionExist('2.0');
expect(versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
await versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
versionManagePage.showNewVersionButton.click();
versionManagePage.clickMinorChange();
versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
versionManagePage.checkFileVersionExist('2.1');
expect(versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
await versionManagePage.checkFileVersionExist('2.1');
await expect(await versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
});
});
+6 -9
View File
@@ -25,19 +25,16 @@ describe('Auth Guard SSO', () => {
const errorPage = new ErrorPage();
it('[C307058] Should be redirected to 403 when user doesn\'t have permissions', async () => {
settingsPage.setProviderEcmSso(browser.params.testConfig.adf_acs.host,
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity,
false, true, browser.params.config.oauth2.clientId);
browser.driver.sleep(5000);
loginSSOPage.clickOnSSOButton();
await loginSSOPage.clickOnSSOButton();
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/cloud/simple-app');
browser.driver.sleep(2000);
expect(errorPage.getErrorCode()).toBe('403');
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/cloud/simple-app');
await browser.sleep(1000);
const error = await errorPage.getErrorCode();
await expect(error).toBe('403');
});
});
+118 -132
View File
@@ -30,255 +30,241 @@ describe('CardView Component', () => {
const cardViewPageComponent = new CardViewComponentPage();
const metadataViewPage = new MetadataViewPage();
beforeAll(async (done) => {
loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
navigationBarPage.clickCardViewButton();
beforeAll(async () => {
await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await navigationBarPage.clickCardViewButton();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(() => {
cardViewPageComponent.clickOnResetButton();
afterEach(async () => {
await cardViewPageComponent.clickOnResetButton();
});
describe('key-value pair ', () => {
it('[C279938] Should the label be present', () => {
it('[C279938] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279898] Should be possible edit key-value pair properties', () => {
cardViewPageComponent.clickOnAddButton();
cardViewPageComponent.setName('testName');
cardViewPageComponent.setValue('testValue');
cardViewPageComponent.clickOnAddButton();
cardViewPageComponent.waitForOutput();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Key-Value Pairs Item] - [{"name":"testName","value":"testValue"}]');
it('[C279898] Should be possible edit key-value pair properties', async () => {
await cardViewPageComponent.clickOnAddButton();
await cardViewPageComponent.setName('testName');
await cardViewPageComponent.setValue('testValue');
await cardViewPageComponent.clickOnAddButton();
await cardViewPageComponent.waitForOutput();
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Key-Value Pairs Item] - [{"name":"testName","value":"testValue"}]');
cardViewPageComponent.deletePairsValues();
await cardViewPageComponent.deletePairsValues();
expect(cardViewPageComponent.getOutputText(1)).toBe('[CardView Key-Value Pairs Item] - []');
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Key-Value Pairs Item] - []');
});
});
describe('SelectBox', () => {
it('[C279939] Should the label be present', () => {
it('[C279939] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-select-label-select"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279899] Should be possible edit selectBox item', () => {
cardViewPageComponent.clickSelectBox();
cardViewPageComponent.selectValueFromComboBox(1);
it('[C279899] Should be possible edit selectBox item', async () => {
await cardViewPageComponent.clickSelectBox();
await cardViewPageComponent.selectValueFromComboBox(1);
expect(cardViewPageComponent.getOutputText(0))
await expect(await cardViewPageComponent.getOutputText(0))
.toBe('[CardView Select Item] - two');
});
});
describe('Text', () => {
it('[C279937] Should the label be present', () => {
it('[C279937] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-name"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279943] Should be present a default value', () => {
expect(cardViewPageComponent.getTextFieldText()).toBe('Spock');
it('[C279943] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getTextFieldText()).toBe('Spock');
});
it('[C279934] Should be possible edit text item', () => {
cardViewPageComponent
.clickOnTextField()
.enterTextField('example')
.clickOnTextSaveIcon();
it('[C279934] Should be possible edit text item', async () => {
await cardViewPageComponent.clickOnTextField();
await cardViewPageComponent.enterTextField('example');
await cardViewPageComponent.clickOnTextSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Text Item] - example');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Text Item] - example');
});
it('[C279944] Should be possible undo text item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnTextField()
.enterTextField('example')
.clickOnTextClearIcon();
it('[C279944] Should be possible undo text item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnTextField();
await cardViewPageComponent.enterTextField('example');
await cardViewPageComponent.clickOnTextClearIcon();
expect(cardViewPageComponent.getTextFieldText()).toBe('Spock');
await expect(await cardViewPageComponent.getTextFieldText()).toBe('Spock');
});
});
describe('Int', () => {
it('[C279940] Should the label be present', () => {
it('[C279940] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279945] Should be present a default value', () => {
expect(cardViewPageComponent.getIntFieldText()).toBe('213');
it('[C279945] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
});
it('[C279946] Should be possible edit int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('99999')
.clickOnIntSaveIcon();
it('[C279946] Should be possible edit int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('99999');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 99999');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 99999');
});
it('[C279947] Should not be possible add string value to the int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('string value')
.clickOnIntSaveIcon();
it('[C279947] Should not be possible add string value to the int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('string value');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279948] Should not be possible add float value to the int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('0.22')
.clickOnIntSaveIcon();
it('[C279948] Should not be possible add float value to the int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('0.22');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279949] Should not be possible have an empty value', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField(' ')
.clickOnIntSaveIcon();
it('[C279949] Should not be possible have an empty value', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField(' ');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279950] Should return an error when the value is > 2147483647', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('214748367')
.clickOnIntSaveIcon();
it('[C279950] Should return an error when the value is > 2147483647', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('214748367');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 214748367');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 214748367');
cardViewPageComponent
.clickOnIntField()
.enterIntField('2147483648')
.clickOnIntSaveIcon();
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('2147483648');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279951] Should be possible undo item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('999')
.clickOnIntClearIcon();
it('[C279951] Should be possible undo item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('999');
await cardViewPageComponent.clickOnIntClearIcon();
expect(cardViewPageComponent.getIntFieldText()).toBe('213');
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
});
});
describe('Float', () => {
it('[C279941] Should the label be present', () => {
it('[C279941] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279952] Should be present a default value', () => {
expect(cardViewPageComponent.getFloatFieldText()).toBe('9.9');
it('[C279952] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
});
it('[C279953] Should be possible edit float item', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('77.33')
.clickOnFloatSaveIcon();
it('[C279953] Should be possible edit float item', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('77.33');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Float Item] - 77.33');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Float Item] - 77.33');
});
it('[C279954] Should not be possible add string value to the float item', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('string value')
.clickOnFloatSaveIcon();
it('[C279954] Should not be possible add string value to the float item', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('string value');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
});
it('[C279955] Should be possible undo item item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('77.33')
.clickOnFloatClearIcon();
it('[C279955] Should be possible undo item item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('77.33');
await cardViewPageComponent.clickOnFloatClearIcon();
expect(cardViewPageComponent.getFloatFieldText()).toBe('9.9');
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
});
it('[C279956] Should not be possible have an empty value', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField(' ')
.clickOnFloatSaveIcon();
it('[C279956] Should not be possible have an empty value', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField(' ');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
});
});
describe('Boolean', () => {
it('[C279942] Should the label be present', () => {
it('[C279942] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279957] Should be possible edit the checkbox value when click on it', () => {
cardViewPageComponent.checkboxClick();
it('[C279957] Should be possible edit the checkbox value when click on it', async () => {
await cardViewPageComponent.checkboxClick();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Boolean Item] - false');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Boolean Item] - false');
cardViewPageComponent.checkboxClick();
await cardViewPageComponent.checkboxClick();
expect(cardViewPageComponent.getOutputText(1)).toBe('[CardView Boolean Item] - true');
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Boolean Item] - true');
});
});
describe('Date and DateTime', () => {
it('[C279961] Should the label be present', () => {
it('[C279961] Should the label be present', async () => {
const labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
BrowserVisibility.waitUntilElementIsPresent(labelDate);
await BrowserVisibility.waitUntilElementIsPresent(labelDate);
const labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
await BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
});
it('[C279962] Should be present a default value', () => {
expect(metadataViewPage.getPropertyText('date', 'date')).toEqual('12/24/83');
expect(metadataViewPage.getPropertyText('datetime', 'datetime')).toEqual('Dec 24, 1983, 10:00');
it('[C279962] Should be present a default value', async () => {
await expect(await metadataViewPage.getPropertyText('date', 'date')).toEqual('12/24/83');
await expect(await metadataViewPage.getPropertyText('datetime', 'datetime')).toEqual('Dec 24, 1983, 10:00');
});
});
it('[C279936] Should not be possible edit any parameter when editable property is false', () => {
cardViewPageComponent.disableEdit();
it('[C279936] Should not be possible edit any parameter when editable property is false', async () => {
await cardViewPageComponent.disableEdit();
const editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
const editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
@@ -286,10 +272,10 @@ describe('CardView Component', () => {
const editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
const editIconData = element(by.css('mat-datetimepicker-toggle'));
BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
});
});
@@ -32,7 +32,7 @@ describe('Datatable component - selection', () => {
const navigationBarPage = new NavigationBarPage();
const dataTableComponent = new DataTableComponentPage();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -46,60 +46,59 @@ describe('Datatable component - selection', () => {
await navigationBarPage.navigateToDatatable();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C213258] Should be possible change the selection modes when change the selectionMode property', () => {
dataTablePage.selectRow('2');
dataTableComponent.checkRowIsSelected('Id', '2');
expect(dataTablePage.getNumberOfSelectedRows()).toEqual(1);
dataTablePage.selectRow('3');
dataTableComponent.checkRowIsSelected('Id', '3');
expect(dataTablePage.getNumberOfSelectedRows()).toEqual(1);
dataTablePage.selectSelectionMode('Multiple');
dataTablePage.selectRow('1');
dataTableComponent.checkRowIsSelected('Id', '1');
dataTablePage.selectRowWithKeyboard('3');
dataTableComponent.checkRowIsSelected('Id', '1');
dataTableComponent.checkRowIsSelected('Id', '3');
dataTablePage.checkRowIsNotSelected('2');
dataTablePage.checkRowIsNotSelected('4');
dataTablePage.selectSelectionMode('None');
dataTablePage.selectRow('1');
dataTablePage.checkNoRowIsSelected();
it('[C213258] Should be possible change the selection modes when change the selectionMode property', async () => {
await dataTablePage.selectRow('2');
await dataTableComponent.checkRowIsSelected('Id', '2');
await expect(await dataTablePage.getNumberOfSelectedRows()).toEqual(1);
await dataTablePage.selectRow('3');
await dataTableComponent.checkRowIsSelected('Id', '3');
await expect(await dataTablePage.getNumberOfSelectedRows()).toEqual(1);
await dataTablePage.selectSelectionMode('Multiple');
await dataTablePage.selectRow('1');
await dataTableComponent.checkRowIsSelected('Id', '1');
await dataTablePage.selectRowWithKeyboard('3');
await dataTableComponent.checkRowIsSelected('Id', '1');
await dataTableComponent.checkRowIsSelected('Id', '3');
await dataTablePage.checkRowIsNotSelected('2');
await dataTablePage.checkRowIsNotSelected('4');
await dataTablePage.selectSelectionMode('None');
await dataTablePage.selectRow('1');
await dataTablePage.checkNoRowIsSelected();
});
it('[C260059] Should be possible select multiple row when multiselect is true', () => {
dataTablePage.clickMultiSelect();
dataTablePage.clickCheckbox('1');
dataTablePage.checkRowIsChecked('1');
dataTablePage.clickCheckbox('3');
dataTablePage.checkRowIsChecked('3');
dataTablePage.checkRowIsNotChecked('2');
dataTablePage.checkRowIsNotChecked('4');
dataTablePage.clickCheckbox('3');
dataTablePage.checkRowIsNotChecked('3');
dataTablePage.checkRowIsChecked('1');
it('[C260059] Should be possible select multiple row when multiselect is true', async () => {
await dataTablePage.clickMultiSelect();
await dataTablePage.clickCheckbox('1');
await dataTablePage.checkRowIsChecked('1');
await dataTablePage.clickCheckbox('3');
await dataTablePage.checkRowIsChecked('3');
await dataTablePage.checkRowIsNotChecked('2');
await dataTablePage.checkRowIsNotChecked('4');
await dataTablePage.clickCheckbox('3');
await dataTablePage.checkRowIsNotChecked('3');
await dataTablePage.checkRowIsChecked('1');
});
it('[C260058] Should be possible select all the rows when multiselect is true', () => {
dataTablePage.checkAllRows();
dataTablePage.checkRowIsChecked('1');
dataTablePage.checkRowIsChecked('2');
dataTablePage.checkRowIsChecked('3');
dataTablePage.checkRowIsChecked('4');
it('[C260058] Should be possible select all the rows when multiselect is true', async () => {
await dataTablePage.checkAllRows();
await dataTablePage.checkRowIsChecked('1');
await dataTablePage.checkRowIsChecked('2');
await dataTablePage.checkRowIsChecked('3');
await dataTablePage.checkRowIsChecked('4');
});
it('[C277262] Should be possible reset the selected row when click on the reset button', () => {
dataTablePage.checkRowIsChecked('1');
dataTablePage.checkRowIsChecked('2');
dataTablePage.checkRowIsChecked('3');
dataTablePage.checkRowIsChecked('4');
dataTablePage.clickReset();
dataTablePage.checkNoRowIsSelected();
it('[C277262] Should be possible reset the selected row when click on the reset button', async () => {
await dataTablePage.checkRowIsChecked('1');
await dataTablePage.checkRowIsChecked('2');
await dataTablePage.checkRowIsChecked('3');
await dataTablePage.checkRowIsChecked('4');
await dataTablePage.clickReset();
await dataTablePage.checkNoRowIsSelected();
});
});
+102 -101
View File
@@ -43,7 +43,7 @@ describe('Datatable component', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -55,7 +55,6 @@ describe('Datatable component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
@@ -64,151 +63,153 @@ describe('Datatable component', () => {
describe('Datatable component', () => {
beforeAll(async (done) => {
navigationBarPage.navigateToDatatable();
done();
beforeAll(async () => {
await navigationBarPage.navigateToDatatable();
await dataTablePage.dataTable.waitForTableBody();
});
beforeEach(async (done) => {
dataTablePage.clickReset();
done();
beforeEach(async () => {
await dataTablePage.clickReset();
});
it('[C91314] Should be possible add new row to the table', () => {
dataTableComponent.numberOfRows().then((result) => {
dataTablePage.addRow();
expect(dataTableComponent.numberOfRows()).toEqual(result + 1);
dataTablePage.addRow();
expect(dataTableComponent.numberOfRows()).toEqual(result + 2);
});
it('[C91314] Should be possible add new row to the table', async () => {
const result = await dataTableComponent.numberOfRows();
await dataTablePage.addRow();
await expect(await dataTableComponent.numberOfRows()).toEqual(result + 1);
await dataTablePage.addRow();
await expect(await dataTableComponent.numberOfRows()).toEqual(result + 2);
});
it('[C260039] Should be possible replace rows', () => {
dataTablePage.replaceRows(1);
it('[C260039] Should be possible replace rows', async () => {
await dataTablePage.replaceRows(1);
});
it('[C260041] Should be possible replace columns', () => {
dataTablePage.replaceColumns();
it('[C260041] Should be possible replace columns', async () => {
await dataTablePage.replaceColumns();
});
it('[C277314] Should filter the table rows when the input filter is passed', () => {
dataTablePage.replaceRows(1);
dataTablePage.replaceColumns();
expect(dataTableComponent.numberOfRows()).toEqual(4);
dataTablePage.insertFilter('Name');
expect(dataTableComponent.numberOfRows()).toEqual(3);
dataTablePage.insertFilter('I');
expect(dataTableComponent.numberOfRows()).toEqual(1);
it('[C277314] Should filter the table rows when the input filter is passed', async () => {
await dataTablePage.replaceRows(1);
await dataTablePage.replaceColumns();
await expect(await dataTableComponent.numberOfRows()).toEqual(4);
await dataTablePage.insertFilter('Name');
await expect(await dataTableComponent.numberOfRows()).toEqual(3);
await dataTablePage.insertFilter('I');
await expect(await dataTableComponent.numberOfRows()).toEqual(1);
});
});
describe('Datatable component - copyContent', () => {
beforeAll(async (done) => {
navigationBarPage.navigateToCopyContentDatatable();
done();
beforeAll(async () => {
await navigationBarPage.navigateToCopyContentDatatable();
await dataTablePage.dataTable.waitForTableBody();
});
it('[C307037] A tooltip is displayed when mouseOver a column with copyContent set to true', () => {
dataTablePage.mouseOverIdColumn('1');
expect(dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
dataTablePage.mouseOverNameColumn('Name 2');
dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
it('[C307037] A tooltip is displayed when mouseOver a column with copyContent set to true', async () => {
await dataTablePage.mouseOverIdColumn('1');
await expect(await dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await dataTablePage.mouseOverNameColumn('Name 2');
await dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
});
it('[C307045] No tooltip is displayed when hover over a column with copyContent set to false', () => {
dataTablePage.mouseOverNameColumn('Name 2');
dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
dataTablePage.clickOnNameColumn('Name 2');
notificationHistoryPage.checkNotifyNotContains('Name 2');
it('[C307045] No tooltip is displayed when hover over a column with copyContent set to false', async () => {
await dataTablePage.mouseOverNameColumn('Name 2');
await dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
await dataTablePage.clickOnNameColumn('Name 2');
await notificationHistoryPage.checkNotifyNotContains('Name 2');
});
it('[C307046] No tooltip is displayed when hover over a column that has default value for copyContent property', () => {
dataTablePage.mouseOverCreatedByColumn('Created One');
dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
dataTablePage.clickOnCreatedByColumn('Created One');
notificationHistoryPage.checkNotifyNotContains('Created One');
it('[C307046] No tooltip is displayed when hover over a column that has default value for copyContent property', async () => {
await dataTablePage.mouseOverCreatedByColumn('Created One');
await dataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
await dataTablePage.clickOnCreatedByColumn('Created One');
await notificationHistoryPage.checkNotifyNotContains('Created One');
});
it('[C307040] A column value with copyContent set to true is copied when clicking on it', () => {
dataTablePage.mouseOverIdColumn('1');
expect(dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
dataTablePage.clickOnIdColumn('1');
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.clickOnIdColumn('2');
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.pasteClipboard();
expect(dataTablePage.getClipboardInputText()).toEqual('2');
it('[C307040] A column value with copyContent set to true is copied when clicking on it', async () => {
await dataTablePage.mouseOverIdColumn('1');
await expect(await dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await dataTablePage.clickOnIdColumn('1');
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await dataTablePage.clickOnIdColumn('2');
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await dataTablePage.pasteClipboard();
await expect(await dataTablePage.getClipboardInputText()).toEqual('2');
});
it('[C307072] A tooltip is displayed when mouseOver a column with copyContent set to true', () => {
copyContentDataTablePage.mouseOverIdColumn('1');
expect(copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
copyContentDataTablePage.mouseOverNameColumn('First');
copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
it('[C307072] A tooltip is displayed when mouseOver a column with copyContent set to true', async () => {
await copyContentDataTablePage.mouseOverIdColumn('1');
await expect(await copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await copyContentDataTablePage.mouseOverNameColumn('First');
await copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
});
it('[C307074] No tooltip is displayed when hover over a column with copyContent set to false', () => {
copyContentDataTablePage.mouseOverNameColumn('Second');
copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
copyContentDataTablePage.clickOnNameColumn('Second');
notificationHistoryPage.checkNotifyNotContains('Second');
it('[C307074] No tooltip is displayed when hover over a column with copyContent set to false', async () => {
await copyContentDataTablePage.mouseOverNameColumn('Second');
await copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
await copyContentDataTablePage.clickOnNameColumn('Second');
await notificationHistoryPage.checkNotifyNotContains('Second');
});
it('[C307075] No tooltip is displayed when hover over a column that has default value for copyContent property', () => {
copyContentDataTablePage.mouseOverCreatedByColumn('Created one');
copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
copyContentDataTablePage.clickOnCreatedByColumn('Created one');
notificationHistoryPage.checkNotifyNotContains('Created One');
it('[C307075] No tooltip is displayed when hover over a column that has default value for copyContent property', async () => {
await copyContentDataTablePage.mouseOverCreatedByColumn('Created one');
await copyContentDataTablePage.dataTable.copyContentTooltipIsNotDisplayed();
await copyContentDataTablePage.clickOnCreatedByColumn('Created one');
await notificationHistoryPage.checkNotifyNotContains('Created One');
});
it('[C307073] A column value with copyContent set to true is copied when clicking on it', () => {
copyContentDataTablePage.mouseOverIdColumn('1');
expect(copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
copyContentDataTablePage.clickOnIdColumn('1');
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.clickOnIdColumn('2');
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.pasteClipboard();
expect(copyContentDataTablePage.getClipboardInputText()).toEqual('2');
it('[C307073] A column value with copyContent set to true is copied when clicking on it', async () => {
await copyContentDataTablePage.mouseOverIdColumn('1');
await expect(await copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await copyContentDataTablePage.clickOnIdColumn('1');
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await copyContentDataTablePage.clickOnIdColumn('2');
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await copyContentDataTablePage.pasteClipboard();
await expect(await copyContentDataTablePage.getClipboardInputText()).toEqual('2');
});
it('[C307100] A column value of type text and with copyContent set to true is copied when clicking on it', () => {
dataTablePage.mouseOverIdColumn('1');
expect(dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
dataTablePage.clickOnIdColumn('1');
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.pasteClipboard();
expect(dataTablePage.getClipboardInputText()).toEqual('1');
it('[C307100] A column value of type text and with copyContent set to true is copied when clicking on it', async () => {
await dataTablePage.mouseOverIdColumn('1');
await expect(await dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await dataTablePage.clickOnIdColumn('1');
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await dataTablePage.pasteClipboard();
await expect(await dataTablePage.getClipboardInputText()).toEqual('1');
});
it('[C307101] A column value of type json and with copyContent set to true is copied when clicking on it', () => {
it('[C307101] A column value of type json and with copyContent set to true is copied when clicking on it', async () => {
const jsonValue = `{ "id": 4 }`;
copyContentDataTablePage.mouseOverJsonColumn(2);
expect(copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
copyContentDataTablePage.clickOnJsonColumn(2);
notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.pasteClipboard();
expect(copyContentDataTablePage.getClipboardInputText()).toContain(jsonValue);
await copyContentDataTablePage.mouseOverJsonColumn(2);
await expect(await copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
await copyContentDataTablePage.clickOnJsonColumn(2);
await notificationHistoryPage.checkNotifyContains('Text copied to clipboard');
await copyContentDataTablePage.pasteClipboard();
await expect(await copyContentDataTablePage.getClipboardInputText()).toContain(jsonValue);
});
afterAll(async () => {
await navigationBarPage.clickHomeButton();
});
});
describe('Datatable component - Drag and Drop', () => {
beforeAll(async (done) => {
navigationBarPage.navigateToDragAndDropDatatable();
done();
beforeAll(async () => {
await navigationBarPage.navigateToDragAndDropDatatable();
await dragAndDropDataTablePage.dataTable.waitForTableBody();
});
it('[C307984] Should trigger the event handling header-drop and cell-drop', () => {
it('[C307984] Should trigger the event handling header-drop and cell-drop', async () => {
const dragAndDropHeader = dragAndDropDataTablePage.getDropTargetIdColumnHeader();
dragAndDrop.dropFile(dragAndDropHeader, pngFile.location);
notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] header');
await dragAndDrop.dropFile(dragAndDropHeader, pngFile.location);
await notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] header');
const dragAndDropCell = dragAndDropDataTablePage.getDropTargetIdColumnCell(1);
dragAndDrop.dropFile(dragAndDropCell, pngFile.location);
notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] cell');
await dragAndDrop.dropFile(dragAndDropCell, pngFile.location);
await notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] cell');
});
});
});
+24 -26
View File
@@ -28,7 +28,7 @@ describe('Error Component', () => {
const errorPage = new ErrorPage();
const navigationBarPage = new NavigationBarPage();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -38,49 +38,47 @@ describe('Error Component', () => {
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C277302] Should display the error 403 when access to unauthorized page - My Change', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/403');
expect(errorPage.getErrorCode()).toBe('403');
expect(errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
it('[C277302] Should display the error 403 when access to unauthorized page - My Change', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/403');
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
it('[C280563] Should back home button navigate to the home page', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/404');
it('[C280563] Should back home button navigate to the home page', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/404');
errorPage.clickBackButton();
await errorPage.clickBackButton();
expect(browser.getCurrentUrl()).toBe(browser.params.testConfig.adf.url + '/');
await expect(await browser.getCurrentUrl()).toBe(browser.params.testConfig.adf.url + '/');
});
it('[C280564] Should secondary button by default redirect to report-issue URL', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/403');
it('[C280564] Should secondary button by default redirect to report-issue URL', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/403');
errorPage.clickSecondButton();
await errorPage.clickSecondButton();
expect(browser.getCurrentUrl()).toBe(browser.params.testConfig.adf.url + '/report-issue');
await expect(await browser.getCurrentUrl()).toBe(browser.params.testConfig.adf.url + '/report-issue');
});
it('[C277304] Should display the error 404 when access to not found page', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/404');
expect(errorPage.getErrorCode()).toBe('404');
expect(errorPage.getErrorTitle()).toBe('An error occurred.');
expect(errorPage.getErrorDescription()).toBe('We couldnt find the page you were looking for.');
it('[C277304] Should display the error 404 when access to not found page', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/404');
await expect(await errorPage.getErrorCode()).toBe('404');
await expect(await errorPage.getErrorTitle()).toBe('An error occurred.');
await expect(await errorPage.getErrorDescription()).toBe('We couldnt find the page you were looking for.');
});
it('[C307029] Should display Unknown message when error is undefined', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/501');
expect(errorPage.getErrorCode()).toBe('UNKNOWN');
expect(errorPage.getErrorTitle()).toBe('We hit a problem.');
expect(errorPage.getErrorDescription()).toBe('Looks like something went wrong.');
it('[C307029] Should display Unknown message when error is undefined', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/error/501');
await expect(await errorPage.getErrorCode()).toBe('UNKNOWN');
await expect(await errorPage.getErrorTitle()).toBe('We hit a problem.');
await expect(await errorPage.getErrorDescription()).toBe('Looks like something went wrong.');
});
});
+52 -54
View File
@@ -46,7 +46,7 @@ describe('Header Component', () => {
logo_tooltip: 'test_tooltip'
};
beforeAll(async(done) => {
beforeAll(async() => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -64,85 +64,83 @@ describe('Header Component', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
beforeEach(async(done) => {
navigationBarPage.clickHeaderDataButton();
done();
beforeEach(async() => {
await navigationBarPage.clickHeaderDataButton();
});
afterAll(async(done) => {
afterAll(async() => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C280002] Should be able to view Header component', () => {
headerPage.checkShowMenuCheckBoxIsDisplayed();
headerPage.checkChooseHeaderColourIsDisplayed();
headerPage.checkHexColorInputIsDisplayed();
headerPage.checkChangeTitleIsDisplayed();
headerPage.checkChangeUrlPathIsDisplayed();
headerPage.checkLogoHyperlinkInputIsDisplayed();
headerPage.checkLogoTooltipInputIsDisplayed();
it('[C280002] Should be able to view Header component', async () => {
await headerPage.checkShowMenuCheckBoxIsDisplayed();
await headerPage.checkChooseHeaderColourIsDisplayed();
await headerPage.checkHexColorInputIsDisplayed();
await headerPage.checkChangeTitleIsDisplayed();
await headerPage.checkChangeUrlPathIsDisplayed();
await headerPage.checkLogoHyperlinkInputIsDisplayed();
await headerPage.checkLogoTooltipInputIsDisplayed();
});
it('[C279996] Should be able to show/hide menu button', () => {
headerPage.clickShowMenuButton();
navigationBarPage.checkMenuButtonIsNotDisplayed();
headerPage.clickShowMenuButton();
navigationBarPage.checkMenuButtonIsDisplayed();
it('[C279996] Should be able to show/hide menu button', async () => {
await headerPage.clickShowMenuButton();
await navigationBarPage.checkMenuButtonIsNotDisplayed();
await headerPage.clickShowMenuButton();
await navigationBarPage.checkMenuButtonIsDisplayed();
});
it('[C279999] Should be able to change the colour between primary, accent and warn', () => {
headerPage.changeHeaderColor(names.color_accent);
navigationBarPage.checkToolbarColor(names.color_accent);
headerPage.changeHeaderColor(names.color_primary);
navigationBarPage.checkToolbarColor(names.color_primary);
headerPage.changeHeaderColor(names.color_warn);
navigationBarPage.checkToolbarColor(names.color_warn);
it('[C279999] Should be able to change the colour between primary, accent and warn', async () => {
await headerPage.changeHeaderColor(names.color_accent);
await navigationBarPage.checkToolbarColor(names.color_accent);
await headerPage.changeHeaderColor(names.color_primary);
await navigationBarPage.checkToolbarColor(names.color_primary);
await headerPage.changeHeaderColor(names.color_warn);
await navigationBarPage.checkToolbarColor(names.color_warn);
});
it('[C280552] Should be able to change the colour of the header by typing a hex code', () => {
headerPage.addHexCodeColor(names.color_custom);
navigationBarPage.checkToolbarColor(names.color_custom);
it('[C280552] Should be able to change the colour of the header by typing a hex code', async () => {
await headerPage.addHexCodeColor(names.color_custom);
await navigationBarPage.checkToolbarColor(names.color_custom);
});
it('[C279997] Should be able to change the title of the app', () => {
headerPage.checkAppTitle(names.app_title_default);
headerPage.addTitle(names.app_title_custom);
headerPage.checkAppTitle(names.app_title_custom);
it('[C279997] Should be able to change the title of the app', async () => {
await headerPage.checkAppTitle(names.app_title_default);
await headerPage.addTitle(names.app_title_custom);
await headerPage.checkAppTitle(names.app_title_custom);
});
it('[C279998] Should be able to change the default logo of the app', () => {
headerPage.checkIconIsDisplayed(names.urlPath_default);
headerPage.addIcon(names.urlPath_custom);
headerPage.checkIconIsDisplayed(names.urlPath_custom);
it('[C279998] Should be able to change the default logo of the app', async () => {
await headerPage.checkIconIsDisplayed(names.urlPath_default);
await headerPage.addIcon(names.urlPath_custom);
await headerPage.checkIconIsDisplayed(names.urlPath_custom);
});
it('[C280553] Should be able to set a hyperlink to the logo', () => {
headerPage.addLogoHyperlink(names.urlPath_logo_link);
navigationBarPage.clickAppLogo(names.logo_title);
settingsPage.checkProviderDropdownIsDisplayed();
it('[C280553] Should be able to set a hyperlink to the logo', async () => {
await headerPage.addLogoHyperlink(names.urlPath_logo_link);
await navigationBarPage.clickAppLogo(names.logo_title);
await settingsPage.checkProviderDropdownIsDisplayed();
});
it('[C286517] Should be able to set a hyperlink to the logo text', () => {
headerPage.addLogoHyperlink(names.urlPath_logo_link);
navigationBarPage.clickAppLogoText();
settingsPage.checkProviderDropdownIsDisplayed();
it('[C286517] Should be able to set a hyperlink to the logo text', async () => {
await headerPage.addLogoHyperlink(names.urlPath_logo_link);
await navigationBarPage.clickAppLogoText();
await settingsPage.checkProviderDropdownIsDisplayed();
});
it('[C280554] Should be able to customise the tooltip-text of the logo', () => {
headerPage.addLogoTooltip(names.logo_tooltip);
navigationBarPage.checkLogoTooltip(names.logo_tooltip);
it('[C280554] Should be able to customise the tooltip-text of the logo', async () => {
await headerPage.addLogoTooltip(names.logo_tooltip);
await navigationBarPage.checkLogoTooltip(names.logo_tooltip);
});
it('[C286297] Should be able to change the position of the sidebar menu', () => {
headerPage.sideBarPositionEnd();
headerPage.checkSidebarPositionEnd();
headerPage.sideBarPositionStart();
headerPage.checkSidebarPositionStart();
it('[C286297] Should be able to change the position of the sidebar menu', async () => {
await headerPage.sideBarPositionEnd();
await headerPage.checkSidebarPositionEnd();
await headerPage.sideBarPositionStart();
await headerPage.checkSidebarPositionStart();
});
});
+9 -13
View File
@@ -23,14 +23,14 @@ import { AcsUserModel } from '../models/ACS/acsUserModel';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Universal Icon component', function () {
describe('Universal Icon component', () => {
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
const navigationBarPage = new NavigationBarPage();
const iconsPage = new IconsPage();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -40,25 +40,21 @@ describe('Universal Icon component', function () {
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
navigationBarPage.navigateToIconsPage();
done();
beforeEach(async () => {
await navigationBarPage.clickIconsButton();
});
it('[C291872] Should display the icons on the page', () => {
expect(iconsPage.locateLigatureIcon('folder').isDisplayed()).toBe(true, 'Ligature icon is not displayed');
expect(iconsPage.locateCustomIcon('adf:move_file').isDisplayed()).toBe(true, 'Named icon is not displayed');
expect(iconsPage.locateCustomIcon('adf:folder').isDisplayed()).toBe(true, 'Thumbnail service icon is not displayed');
it('[C291872] Should display the icons on the page', async () => {
await expect(await iconsPage.isLigatureIconDisplayed('folder')).toBe(true, 'Ligature icon is not displayed');
await expect(await iconsPage.isCustomIconDisplayed('adf:move_file')).toBe(true, 'Named icon is not displayed');
await expect(await iconsPage.isCustomIconDisplayed('adf:folder')).toBe(true, 'Thumbnail service icon is not displayed');
});
});
+43 -44
View File
@@ -52,7 +52,7 @@ describe('Enable infinite scrolling', () => {
extension: '.txt'
};
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -79,81 +79,80 @@ describe('Enable infinite scrolling', () => {
await uploadActions.createEmptyFiles(deleteFileNames, deleteUploaded.entry.id);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
done();
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
});
it('[C260484] Should be possible to enable infinite scrolling', () => {
contentServicesPage.doubleClickRow(folderModel.name);
contentServicesPage.enableInfiniteScrolling();
infinitePaginationPage.clickLoadMoreButton();
it('[C260484] Should be possible to enable infinite scrolling', async () => {
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.enableInfiniteScrolling();
await infinitePaginationPage.clickLoadMoreButton();
for (let i = 0; i < nrOfFiles; i++) {
contentServicesPage.checkContentIsDisplayed(fileNames[i]);
await contentServicesPage.checkContentIsDisplayed(fileNames[i]);
}
});
it('[C268165] Delete folder when infinite scrolling is enabled', () => {
contentServicesPage.doubleClickRow(deleteUploaded.entry.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
contentServicesPage.enableInfiniteScrolling();
infinitePaginationPage.clickLoadMoreButton();
it('[C268165] Delete folder when infinite scrolling is enabled', async () => {
await contentServicesPage.doubleClickRow(deleteUploaded.entry.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.enableInfiniteScrolling();
await infinitePaginationPage.clickLoadMoreButton();
for (let i = 0; i < nrOfDeletedFiles; i++) {
contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
}
expect(contentServicesPage.getContentList().dataTablePage().numberOfRows()).toEqual(nrOfDeletedFiles);
await expect(await contentServicesPage.getDocumentList().dataTablePage().numberOfRows()).toEqual(nrOfDeletedFiles);
contentServicesPage.deleteContent(deleteFileNames[nrOfDeletedFiles - 1]);
contentServicesPage.checkContentIsNotDisplayed(deleteFileNames[nrOfDeletedFiles - 1]);
await contentServicesPage.deleteContent(deleteFileNames[nrOfDeletedFiles - 1]);
await contentServicesPage.checkContentIsNotDisplayed(deleteFileNames[nrOfDeletedFiles - 1]);
for (let i = 0; i < nrOfDeletedFiles - 1; i++) {
contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
}
});
it('[C299201] Should use default pagination settings for infinite pagination', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(folderModel.name);
it('[C299201] Should use default pagination settings for infinite pagination', async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderModel.name);
contentServicesPage.enableInfiniteScrolling();
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
infinitePaginationPage.clickLoadMoreButton();
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
await contentServicesPage.enableInfiniteScrolling();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
});
it('[C299202] Should not display load more button when all the files are already displayed', () => {
LocalStorageUtil.setUserPreference('paginationSize', '30');
it('[C299202] Should not display load more button when all the files are already displayed', async () => {
await LocalStorageUtil.setUserPreference('paginationSize', '30');
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.doubleClickRow(folderModel.name);
contentServicesPage.enableInfiniteScrolling();
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
await contentServicesPage.enableInfiniteScrolling();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
});
it('[C299203] Should not display load more button when a folder is empty', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
it('[C299203] Should not display load more button when a folder is empty', async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(emptyFolderModel.entry.name);
await contentServicesPage.doubleClickRow(emptyFolderModel.entry.name);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
});
});
+164 -169
View File
@@ -56,7 +56,7 @@ describe('Login component', () => {
const invalidUsername = 'invaliduser';
const invalidPassword = 'invalidpassword';
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ALL',
hostEcm: browser.params.testConfig.adf_acs.host,
@@ -68,218 +68,213 @@ describe('Login component', () => {
await this.alfrescoJsApi.core.peopleApi.addPerson(userA);
await this.alfrescoJsApi.core.peopleApi.addPerson(userB);
done();
});
it('[C276746] Should display the right information in user-info when a different users logs in', async () => {
await loginPage.loginToContentServicesUsingUserModel(userA);
userInfoPage.clickUserProfile();
expect(userInfoPage.getContentHeaderTitle()).toEqual(userA.firstName + ' ' + userA.lastName);
expect(userInfoPage.getContentEmail()).toEqual(userA.email);
await userInfoPage.clickUserProfile();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(userA.firstName + ' ' + userA.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(userA.email);
await loginPage.loginToContentServicesUsingUserModel(userB);
userInfoPage.clickUserProfile();
expect(userInfoPage.getContentHeaderTitle()).toEqual(userB.firstName + ' ' + userB.lastName);
expect(userInfoPage.getContentEmail()).toEqual(userB.email);
await userInfoPage.clickUserProfile();
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(userB.firstName + ' ' + userB.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(userB.email);
});
it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => {
await loginPage.loginToContentServicesUsingUserModel(userA);
navigationBarPage.navigateToProcessServicesCloudPage();
expect(errorPage.getErrorCode()).toBe('403');
expect(errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
await navigationBarPage.navigateToProcessServicesCloudPage();
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
it('[C260036] Should require username', () => {
loginPage.goToLoginPage();
loginPage.checkUsernameInactive();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterUsername('A');
expect(loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
loginPage.clearUsername();
expect(loginPage.getUsernameTooltip()).toEqual(errorMessages.required);
loginPage.checkUsernameHighlighted();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
it('[C260036] Should require username', async () => {
await loginPage.goToLoginPage();
await loginPage.checkUsernameInactive();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterUsername('A');
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
await loginPage.clearUsername();
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.required);
await loginPage.checkUsernameHighlighted();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
});
it('[C260043] Should require password', () => {
loginPage.goToLoginPage();
loginPage.checkPasswordInactive();
loginPage.checkUsernameInactive();
loginPage.enterPassword('A');
loginPage.checkPasswordTooltipIsNotVisible();
loginPage.clearPassword();
expect(loginPage.getPasswordTooltip()).toEqual(errorMessages.password);
loginPage.checkPasswordHighlighted();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
it('[C260043] Should require password', async () => {
await loginPage.goToLoginPage();
await loginPage.checkPasswordInactive();
await loginPage.checkUsernameInactive();
await loginPage.enterPassword('A');
await loginPage.checkPasswordTooltipIsNotVisible();
await loginPage.clearPassword();
await expect(await loginPage.getPasswordTooltip()).toEqual(errorMessages.password);
await loginPage.checkPasswordHighlighted();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
});
it('[C260044] Username should be at least 2 characters long', () => {
loginPage.goToLoginPage();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterUsername('A');
expect(loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
loginPage.enterUsername('AB');
loginPage.checkUsernameTooltipIsNotVisible();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.clearUsername();
it('[C260044] Username should be at least 2 characters long', async () => {
await loginPage.goToLoginPage();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterUsername('A');
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
await loginPage.enterUsername('AB');
await loginPage.checkUsernameTooltipIsNotVisible();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.clearUsername();
});
it('[C260045] Should enable login button after entering a valid username and a password', () => {
loginPage.goToLoginPage();
loginPage.enterUsername(adminUserModel.id);
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterPassword('a');
expect(loginPage.getSignInButtonIsEnabled()).toBe(true);
loginPage.clearUsername();
loginPage.clearPassword();
it('[C260045] Should enable login button after entering a valid username and a password', async () => {
await loginPage.goToLoginPage();
await loginPage.enterUsername(adminUserModel.id);
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterPassword('a');
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(true);
await loginPage.clearUsername();
await loginPage.clearPassword();
});
it('[C260046] Should NOT be possible to login with an invalid username/password', () => {
loginPage.goToLoginPage();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterUsername('test');
loginPage.enterPassword('test');
expect(loginPage.getSignInButtonIsEnabled()).toBe(true);
loginPage.clickSignInButton();
expect(loginPage.getLoginError()).toEqual(errorMessages.invalid_credentials);
loginPage.clearUsername();
loginPage.clearPassword();
it('[C260046] Should NOT be possible to login with an invalid username/password', async () => {
await loginPage.goToLoginPage();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterUsername('test');
await loginPage.enterPassword('test');
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(true);
await loginPage.clickSignInButton();
await expect(await loginPage.getLoginError()).toEqual(errorMessages.invalid_credentials);
await loginPage.clearUsername();
await loginPage.clearPassword();
});
it('[C260047] Password should be crypted', () => {
loginPage.goToLoginPage();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterPassword('test');
loginPage.showPassword();
loginPage.getShownPassword().then(async (tooltip) => {
await expect(tooltip).toEqual('test');
});
loginPage.hidePassword();
loginPage.checkPasswordIsHidden();
loginPage.clearPassword();
it('[C260047] Password should be crypted', async () => {
await loginPage.goToLoginPage();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterPassword('test');
await loginPage.showPassword();
const tooltip = await loginPage.getShownPassword();
await expect(tooltip).toEqual('test');
await loginPage.hidePassword();
await loginPage.checkPasswordIsHidden();
await loginPage.clearPassword();
});
it('[C260048] Should be possible to enable/disable login footer', () => {
loginPage.goToLoginPage();
loginPage.enableFooter();
loginPage.checkRememberIsDisplayed();
loginPage.checkNeedHelpIsDisplayed();
loginPage.checkRegisterDisplayed();
loginPage.disableFooter();
loginPage.checkRememberIsNotDisplayed();
loginPage.checkNeedHelpIsNotDisplayed();
loginPage.checkRegisterIsNotDisplayed();
it('[C260048] Should be possible to enable/disable login footer', async () => {
await loginPage.goToLoginPage();
await loginPage.enableFooter();
await loginPage.checkRememberIsDisplayed();
await loginPage.checkNeedHelpIsDisplayed();
await loginPage.checkRegisterDisplayed();
await loginPage.disableFooter();
await loginPage.checkRememberIsNotDisplayed();
await loginPage.checkNeedHelpIsNotDisplayed();
await loginPage.checkRegisterIsNotDisplayed();
});
it('[C260049] Should be possible to login to Process Services with Content Services disabled', () => {
loginPage.goToLoginPage();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.clickSettingsIcon();
settingsPage.setProviderBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
navigationBarPage.clickContentServicesButton();
loginPage.waitForElements();
it('[C260049] Should be possible to login to Process Services with Content Services disabled', async () => {
await loginPage.goToLoginPage();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.clickSettingsIcon();
await settingsPage.setProviderBpm();
await loginPage.login(adminUserModel.id, adminUserModel.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await navigationBarPage.clickContentServicesButton();
await loginPage.waitForElements();
});
it('[C260050] Should be possible to login to Content Services with Process Services disabled', () => {
loginPage.goToLoginPage();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.clickSettingsIcon();
settingsPage.setProviderEcm();
loginPage.login(browser.params.testConfig.adf.adminUser, browser.params.testConfig.adf.adminPassword);
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
it('[C260050] Should be possible to login to Content Services with Process Services disabled', async () => {
await loginPage.goToLoginPage();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(browser.params.testConfig.adf.adminUser, browser.params.testConfig.adf.adminPassword);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
});
it('[C260051] Should be able to login to both Content Services and Process Services', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
navigationBarPage.clickLoginButton();
loginPage.waitForElements();
it('[C260051] Should be able to login to both Content Services and Process Services', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.login(adminUserModel.id, adminUserModel.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await navigationBarPage.clickLoginButton();
await loginPage.waitForElements();
});
it('[C277754] Should the user be redirect to the login page when the Content Service session expire', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
browser.executeScript('window.localStorage.removeItem("ticket-ECM");');
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
loginPage.waitForElements();
it('[C277754] Should the user be redirect to the login page when the Content Service session expire', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.login(adminUserModel.id, adminUserModel.password);
await browser.executeScript('window.localStorage.removeItem("ticket-ECM");');
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
await loginPage.waitForElements();
});
it('[C279932] Should successRoute property change the landing page when the user Login', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.enableSuccessRouteSwitch();
loginPage.enterSuccessRoute('activiti');
loginPage.login(adminUserModel.id, adminUserModel.password);
processServicesPage.checkApsContainer();
it('[C279932] Should successRoute property change the landing page when the user Login', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.enableSuccessRouteSwitch();
await loginPage.enterSuccessRoute('activiti');
await loginPage.login(adminUserModel.id, adminUserModel.password);
await processServicesPage.checkApsContainer();
});
it('[C279931] Should the user be redirect to the login page when the Process Service session expire', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
browser.executeScript('window.localStorage.removeItem("ticket-BPM");');
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
loginPage.waitForElements();
it('[C279931] Should the user be redirect to the login page when the Process Service session expire', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.login(adminUserModel.id, adminUserModel.password);
await browser.executeScript('window.localStorage.removeItem("ticket-BPM");');
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
await loginPage.waitForElements();
});
it('[C279930] Should a user still be logged-in when open a new tab', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
it('[C279930] Should a user still be logged-in when open a new tab', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.login(adminUserModel.id, adminUserModel.password);
Util.openNewTabInBrowser();
await Util.openNewTabInBrowser();
browser.getAllWindowHandles().then((handles) => {
browser.switchTo().window(handles[1]).then(() => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
processServicesPage.checkApsContainer();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
contentServicesPage.checkAcsContainer();
});
});
const handles = await browser.getAllWindowHandles();
await browser.switchTo().window(handles[1]);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
await processServicesPage.checkApsContainer();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
await contentServicesPage.checkAcsContainer();
});
it('[C279933] Should be possible change the login component logo when logoImageUrl is changed', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.enableLogoSwitch();
loginPage.enterLogo('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
loginPage.checkLoginImgURL();
it('[C279933] Should be possible change the login component logo when logoImageUrl is changed', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.enableLogoSwitch();
await loginPage.enterLogo('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
await loginPage.checkLoginImgURL();
});
it('[C291854] Should be possible login in valid credentials', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url);
loginPage.waitForElements();
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterUsername(invalidUsername);
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
loginPage.enterPassword(invalidPassword);
expect(loginPage.getSignInButtonIsEnabled()).toBe(true);
loginPage.clickSignInButton();
expect(loginPage.getLoginError()).toEqual(errorMessages.invalid_credentials);
loginPage.login(adminUserModel.id, adminUserModel.password);
it('[C291854] Should be possible login in valid credentials', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url);
await loginPage.waitForElements();
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterUsername(invalidUsername);
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
await loginPage.enterPassword(invalidPassword);
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(true);
await loginPage.clickSignInButton();
await expect(await loginPage.getLoginError()).toEqual(errorMessages.invalid_credentials);
await loginPage.login(adminUserModel.id, adminUserModel.password);
});
});
@@ -36,7 +36,7 @@ describe('Login component - SSO', () => {
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId);
await loginSSOPage.clickOnSSOButton();
await loginSSOPage.checkLoginErrorIsDisplayed();
expect(loginSSOPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
await expect(loginSSOPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
});
});
+8 -33
View File
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginSSOPage, SettingsPage, LoginPage } from '@alfresco/adf-testing';
import { LoginSSOPage, SettingsPage, LoginPage, BrowserVisibility } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
@@ -29,21 +29,6 @@ describe('Login component - SSO', () => {
const silentLogin = false;
let implicitFlow;
it('[C280665] Should be possible change the logout redirect URL', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId, '/login');
await loginSSOPage.clickOnSSOButton();
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await navigationBarPage.clickLogoutButton();
browser.sleep(2000);
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/login');
});
});
describe('Login component - SSO Grant type password (implicit flow false)', () => {
it('[C299158] Should be possible to login with SSO, with grant type password (Implicit Flow false)', async () => {
@@ -63,28 +48,18 @@ describe('Login component - SSO', () => {
await loginPage.enterPassword(browser.params.testConfig.adf.adminPassword);
await loginPage.clickSignInButton();
let isDisplayed = false;
await BrowserVisibility.waitUntilElementIsVisible(loginPage.sidenavLayout);
browser.wait(() => {
loginPage.header.isDisplayed().then(
() => {
isDisplayed = true;
},
() => {
isDisplayed = false;
}
);
return isDisplayed;
}, browser.params.testConfig.main.timeout, 'Element is not visible ' + loginPage.header.locator());
});
});
describe('Login component - SSO implicit Flow', () => {
afterEach(() => {
navigationBarPage.clickLogoutButton();
browser.executeScript('window.sessionStorage.clear();');
browser.executeScript('window.localStorage.clear();');
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
await browser.executeScript('window.sessionStorage.clear();');
await browser.executeScript('window.localStorage.clear();');
await browser.refresh();
});
it('[C261050] Should be possible login with SSO', async () => {
@@ -96,7 +71,7 @@ describe('Login component - SSO', () => {
});
it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf_acs.host,
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf_acs.host,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, true, true, browser.params.config.oauth2.clientId);
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -0,0 +1,42 @@
/*!
* @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 { LoginSSOPage, SettingsPage } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
describe('Logout component - SSO', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginSSOPage();
const navigationBarPage = new NavigationBarPage();
it('[C280665] Should be possible change the logout redirect URL', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, false, true, browser.params.config.oauth2.clientId, '/login');
await loginSSOPage.clickOnSSOButton();
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await navigationBarPage.clickLogoutButton();
await browser.sleep(2000);
const actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/login');
});
});
+67 -74
View File
@@ -48,7 +48,7 @@ describe('Login component - Redirect', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
const logoutPage = new LogoutPage();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -59,118 +59,111 @@ describe('Login component - Redirect', () => {
uploadedFolder = await uploadActions.createFolder('protecteFolder' + StringUtil.generateRandomString(), '-my-');
done();
});
it('[C213838] Should after login in CS be redirect to Login page when try to access to PS', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcm();
loginPage.login(user.id, user.password);
it('[C213838] Should after login in CS be redirect to Login page when try to access to PS', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.id, user.password);
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.navigateToProcessServicesPage();
loginPage.waitForElements();
await loginPage.waitForElements();
});
it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderBpm();
it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderBpm();
loginPage.enableSuccessRouteSwitch();
loginPage.enterSuccessRoute('activiti');
await loginPage.enableSuccessRouteSwitch();
await loginPage.enterSuccessRoute('activiti');
loginPage.login(adminUserModel.id, adminUserModel.password);
await loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
loginPage.waitForElements();
await loginPage.waitForElements();
});
it('[C260081] Should after login in BOTH not be redirect to Login page when try to access to CS or PS', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
it('[C260081] Should after login in BOTH not be redirect to Login page when try to access to CS or PS', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
await settingsPage.setProviderEcmBpm();
loginPage.login(adminUserModel.id, adminUserModel.password);
await loginPage.login(adminUserModel.id, adminUserModel.password);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
});
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcm();
loginPage.login(user.id, user.password);
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.id, user.password);
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
let actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
contentServicesPage.waitForTableBody();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickLogoutButton();
await navigationBarPage.clickLogoutButton();
logoutPage.checkLogoutSectionIsDisplayed();
await logoutPage.checkLogoutSectionIsDisplayed();
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
loginPage.waitForElements();
await loginPage.waitForElements();
loginPage.login(user.id, user.password);
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
await loginPage.login(user.id, user.password);
actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
it('[C299161] Should redirect user to requested URL after reloading login page', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcm();
loginPage.login(user.id, user.password);
it('[C299161] Should redirect user to requested URL after reloading login page', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcm();
await loginPage.login(user.id, user.password);
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
const currentUrl = await browser.getCurrentUrl();
await expect(currentUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
contentServicesPage.waitForTableBody();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickLogoutButton();
await navigationBarPage.clickLogoutButton();
logoutPage.checkLogoutSectionIsDisplayed();
await logoutPage.checkLogoutSectionIsDisplayed();
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
loginPage.waitForElements();
browser.refresh();
loginPage.waitForElements();
await navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
await loginPage.waitForElements();
await browser.refresh();
await loginPage.waitForElements();
loginPage.enterUsername(user.id);
loginPage.enterPassword(user.password);
loginPage.clickSignInButton();
await loginPage.enterUsername(user.id);
await loginPage.enterPassword(user.password);
await loginPage.clickSignInButton();
navigationBarPage.checkMenuButtonIsDisplayed();
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
await navigationBarPage.checkMenuButtonIsDisplayed();
const actualUrl = await browser.getCurrentUrl();
await expect(actualUrl).toEqual(browser.params.testConfig.adf.url + '/files/' + uploadedFolder.entry.id);
});
});
+8 -9
View File
@@ -22,16 +22,15 @@ describe('Login component - Remember Me', () => {
const settingsPage = new SettingsPage();
const loginPage = new LoginPage();
beforeAll((done) => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
done();
beforeAll(async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
});
it('[C260501] Should Remember me checkbox not be present in the login if the property showRememberMe is false', () => {
loginPage.checkRememberIsDisplayed();
loginPage.disableRememberMe();
loginPage.checkRememberIsNotDisplayed();
it('[C260501] Should Remember me checkbox not be present in the login if the property showRememberMe is false', async () => {
await loginPage.checkRememberIsDisplayed();
await loginPage.disableRememberMe();
await loginPage.checkRememberIsNotDisplayed();
});
});
+57 -67
View File
@@ -30,7 +30,6 @@ import { UploadActions } from '@alfresco/adf-testing';
import { Util } from '../util/util';
import resources = require('../util/resources');
import { browser } from 'protractor';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
describe('Pagination - returns to previous page when current is empty', () => {
@@ -38,7 +37,6 @@ describe('Pagination - returns to previous page when current is empty', () => {
const contentServicesPage = new ContentServicesPage();
const paginationPage = new PaginationPage();
const viewerPage = new ViewerPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const folderModel = new FolderModel({ 'name': 'folderOne' });
@@ -67,7 +65,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -98,79 +96,71 @@ describe('Pagination - returns to previous page when current is empty', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C274710] Should redirect to previous page when current is emptied', () => {
contentServicesPage.doubleClickRow(folderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then((list) => {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.getAllRowsNameColumn().then((list) => {
expect(Util.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
});
contentServicesPage.deleteContent(lastFile);
contentServicesPage.checkContentIsNotDisplayed(lastFile);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then((list) => {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
await contentServicesPage.goToDocumentList();
});
it('[C297494] Should display content when navigating to a non-empty folder not in the first page', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.doubleClickRow(parentFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
it('[C274710] Should redirect to previous page when current is emptied', async () => {
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
paginationPage.clickOnNextPage();
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
await paginationPage.clickOnNextPage();
contentServicesPage.doubleClickRow(lastFolderResponse.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFileInfo.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
viewerPage.viewFile(pngFileUploaded.entry.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickCloseButton();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
await contentServicesPage.deleteContent(lastFile);
await contentServicesPage.checkContentIsNotDisplayed(lastFile);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
it('[C297494] Should display content when navigating to a non-empty folder not in the first page', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.doubleClickRow(parentFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.doubleClickRow(lastFolderResponse.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFileInfo.name);
await viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickCloseButton();
});
});
+155 -152
View File
@@ -39,179 +39,182 @@ describe('Settings component', () => {
});
describe('Should be able to change Urls in the Settings', () => {
beforeEach( (done) => {
settingsPage.goToSettingsPage();
done();
});
it('[C245641] Should navigate User from Settings page to Login screen', () => {
settingsPage.clickBackButton();
loginPage.waitForElements();
});
it('[C291948] Should save ALL Settings changes when User clicks Apply button', () => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.setProviderEcmBpm();
loginPage.waitForElements();
settingsPage.goToSettingsPage();
expect(settingsPage.getSelectedOptionText()).toEqual('ALL', 'The Settings changes are not saved');
expect(settingsPage.getBpmHostUrl()).toEqual(browser.params.testConfig.adf_aps.host, 'The BPM Settings changes are not saved');
expect(settingsPage.getEcmHostUrl()).toEqual(browser.params.testConfig.adf_acs.host, 'The ECM Settings changes are not saved');
beforeEach(async () => {
await settingsPage.goToSettingsPage();
});
it('[C291949] Should have field validation for Content Services Url', () => {
settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
settingsPage.clearContentServicesURL();
settingsPage.ecmText.sendKeys(protractor.Key.TAB);
settingsPage.checkValidationMessageIsDisplayed();
settingsPage.checkApplyButtonIsDisabled();
it('[C245641] Should navigate User from Settings page to Login screen', async () => {
await settingsPage.clickBackButton();
await loginPage.waitForElements();
});
it('[C291950] Should have field validation for Process Services Url', () => {
settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
settingsPage.clearProcessServicesURL();
settingsPage.bpmText.sendKeys(protractor.Key.TAB);
settingsPage.checkValidationMessageIsDisplayed();
settingsPage.checkApplyButtonIsDisabled();
it('[C291948] Should save ALL Settings changes when User clicks Apply button', async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.setProviderEcmBpm();
await loginPage.waitForElements();
await settingsPage.goToSettingsPage();
await expect(await settingsPage.getSelectedOptionText()).toEqual('ALL', 'The Settings changes are not saved');
await expect(await settingsPage.getBpmHostUrl()).toEqual(browser.params.testConfig.adf_aps.host, 'The BPM Settings changes are not saved');
await expect(await settingsPage.getEcmHostUrl()).toEqual(browser.params.testConfig.adf_acs.host, 'The ECM Settings changes are not saved');
});
it('[C291951] Should not be able to sign in with invalid Content Services Url', () => {
settingsPage.setProvider(settingsPage.getEcmOption(), 'ECM');
settingsPage.setContentServicesURL('http://localhost:7070');
settingsPage.clickApply();
loginPage.waitForElements();
loginPage.enterUsername(adminUserModel.id);
loginPage.enterPassword(adminUserModel.password);
loginPage.clickSignInButton();
expect(loginPage.getLoginError()).toMatch(loginError);
it('[C291949] Should have field validation for Content Services Url', async () => {
await settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
await settingsPage.clearContentServicesURL();
await settingsPage.ecmText.sendKeys(protractor.Key.TAB);
await settingsPage.checkValidationMessageIsDisplayed();
await settingsPage.checkApplyButtonIsDisabled();
});
it('[C291952] Should not be able to sign in with invalid Process Services Url', () => {
settingsPage.setProvider(settingsPage.getBpmOption(), 'BPM');
settingsPage.setProcessServicesURL('http://localhost:7070');
settingsPage.clickApply();
loginPage.waitForElements();
loginPage.enterUsername(adminUserModel.id);
loginPage.enterPassword(adminUserModel.password);
loginPage.clickSignInButton();
expect(loginPage.getLoginError()).toMatch(loginError);
it('[C291950] Should have field validation for Process Services Url', async () => {
await settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
await settingsPage.clearProcessServicesURL();
await settingsPage.bpmText.sendKeys(protractor.Key.TAB);
await settingsPage.checkValidationMessageIsDisplayed();
await settingsPage.checkApplyButtonIsDisabled();
});
it('[C291951] Should not be able to sign in with invalid Content Services Url', async () => {
await settingsPage.setProvider(settingsPage.getEcmOption(), 'ECM');
await settingsPage.setContentServicesURL('http://localhost:7070');
await settingsPage.clickApply();
await loginPage.waitForElements();
await loginPage.enterUsername(adminUserModel.id);
await loginPage.enterPassword(adminUserModel.password);
await loginPage.clickSignInButton();
await expect(await loginPage.getLoginError()).toMatch(loginError);
});
it('[C291952] Should not be able to sign in with invalid Process Services Url', async () => {
await settingsPage.setProvider(settingsPage.getBpmOption(), 'BPM');
await settingsPage.setProcessServicesURL('http://localhost:7070');
await settingsPage.clickApply();
await loginPage.waitForElements();
await loginPage.enterUsername(adminUserModel.id);
await loginPage.enterPassword(adminUserModel.password);
await loginPage.clickSignInButton();
await expect(await loginPage.getLoginError()).toMatch(loginError);
});
});
describe('Settings Component - Basic Authentication', () => {
beforeAll( (done) => {
settingsPage.goToSettingsPage();
settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
settingsPage.setContentServicesURL(browser.params.testConfig.adf_acs.host);
settingsPage.setProcessServicesURL(browser.params.testConfig.adf_aps.host);
settingsPage.clickApply();
done();
beforeAll(async () => {
await settingsPage.goToSettingsPage();
await settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
await settingsPage.setContentServicesURL(browser.params.testConfig.adf_acs.host);
await settingsPage.setProcessServicesURL(browser.params.testConfig.adf_aps.host);
await settingsPage.clickApply();
});
beforeEach( (done) => {
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.checkProviderDropdownIsDisplayed();
done();
beforeEach(async () => {
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.checkProviderDropdownIsDisplayed();
});
it('[C277751] Should allow the User to login to Process Services using the BPM selection on Settings page', () => {
settingsPage.checkProviderOptions();
settingsPage.checkBasicAuthRadioIsSelected();
settingsPage.checkSsoRadioIsNotSelected();
expect(settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
expect(settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
expect(settingsPage.getBackButton().isEnabled()).toBe(true);
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
loginPage.goToLoginPage();
loginPage.clickSettingsIcon();
settingsPage.checkProviderDropdownIsDisplayed();
settingsPage.setProvider(settingsPage.getBpmOption(), 'BPM');
settingsPage.clickBackButton();
loginPage.waitForElements();
loginPage.clickSettingsIcon();
settingsPage.checkProviderDropdownIsDisplayed();
settingsPage.setProviderBpm();
loginPage.waitForElements();
loginPage.enterUsername(adminUserModel.id);
loginPage.enterPassword(adminUserModel.password);
loginPage.clickSignInButton();
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed('Task App');
navigationBarPage.navigateToSettingsPage();
expect(settingsPage.getSelectedOptionText()).toBe('BPM');
settingsPage.checkBasicAuthRadioIsSelected();
settingsPage.checkSsoRadioIsNotSelected();
expect(settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
expect(settingsPage.getBackButton().isEnabled()).toBe(true);
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
settingsPage.clickBackButton();
loginPage.waitForElements();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed('Task App');
it('[C277751] Should allow the User to login to Process Services using the BPM selection on Settings page', async () => {
await settingsPage.checkProviderOptions();
await settingsPage.checkBasicAuthRadioIsSelected();
await settingsPage.checkSsoRadioIsNotSelected();
await expect(await settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
await expect(await settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
await expect(await settingsPage.getBackButton().isEnabled()).toBe(true);
await expect(await settingsPage.getApplyButton().isEnabled()).toBe(true);
await loginPage.goToLoginPage();
await loginPage.clickSettingsIcon();
await settingsPage.checkProviderDropdownIsDisplayed();
await settingsPage.setProvider(settingsPage.getBpmOption(), 'BPM');
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await loginPage.clickSettingsIcon();
await settingsPage.checkProviderDropdownIsDisplayed();
await settingsPage.setProviderBpm();
await loginPage.waitForElements();
await loginPage.enterUsername(adminUserModel.id);
await loginPage.enterPassword(adminUserModel.password);
await loginPage.clickSignInButton();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed('Task App');
await navigationBarPage.clickSettingsButton();
await expect(await settingsPage.getSelectedOptionText()).toBe('BPM');
await settingsPage.checkBasicAuthRadioIsSelected();
await settingsPage.checkSsoRadioIsNotSelected();
await expect(await settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
await expect(await settingsPage.getBackButton().isEnabled()).toBe(true);
await expect(await settingsPage.getApplyButton().isEnabled()).toBe(true);
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed('Task App');
});
it('[C277752] Should allow the User to login to Content Services using the ECM selection on Settings page', () => {
settingsPage.setProvider(settingsPage.getEcmOption(), 'ECM');
settingsPage.clickBackButton();
loginPage.waitForElements();
loginPage.clickSettingsIcon();
settingsPage.checkProviderDropdownIsDisplayed();
settingsPage.setProviderEcm();
loginPage.waitForElements();
loginPage.enterUsername(adminUserModel.id);
loginPage.enterPassword(adminUserModel.password);
loginPage.clickSignInButton();
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
navigationBarPage.navigateToSettingsPage();
expect(settingsPage.getSelectedOptionText()).toBe('ECM');
settingsPage.checkBasicAuthRadioIsSelected();
settingsPage.checkSsoRadioIsNotSelected();
expect(settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
expect(settingsPage.getBackButton().isEnabled()).toBe(true);
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
settingsPage.clickBackButton();
loginPage.waitForElements();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
contentServicesPage.checkAcsContainer();
it('[C277752] Should allow the User to login to Content Services using the ECM selection on Settings page', async () => {
await settingsPage.setProvider(settingsPage.getEcmOption(), 'ECM');
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await loginPage.clickSettingsIcon();
await settingsPage.checkProviderDropdownIsDisplayed();
await settingsPage.setProviderEcm();
await loginPage.waitForElements();
await loginPage.enterUsername(adminUserModel.id);
await loginPage.enterPassword(adminUserModel.password);
await loginPage.clickSignInButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await navigationBarPage.clickSettingsButton();
await expect(await settingsPage.getSelectedOptionText()).toBe('ECM');
await settingsPage.checkBasicAuthRadioIsSelected();
await settingsPage.checkSsoRadioIsNotSelected();
await expect(await settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
await expect(await settingsPage.getBackButton().isEnabled()).toBe(true);
await expect(await settingsPage.getApplyButton().isEnabled()).toBe(true);
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
await contentServicesPage.checkAcsContainer();
});
it('[C277753] Should allow the User to login to both Process Services and Content Services using the ALL selection on Settings Page', () => {
settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
settingsPage.clickBackButton();
loginPage.waitForElements();
loginPage.clickSettingsIcon();
settingsPage.checkProviderDropdownIsDisplayed();
settingsPage.setProviderEcmBpm();
loginPage.waitForElements();
loginPage.enterUsername(adminUserModel.id);
loginPage.enterPassword(adminUserModel.password);
loginPage.clickSignInButton();
navigationBarPage.clickContentServicesButton();
contentServicesPage.checkAcsContainer();
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed('Task App');
navigationBarPage.navigateToSettingsPage();
expect(settingsPage.getSelectedOptionText()).toBe('ALL');
settingsPage.checkBasicAuthRadioIsSelected();
settingsPage.checkSsoRadioIsNotSelected();
expect(settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
expect(settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
expect(settingsPage.getBackButton().isEnabled()).toBe(true);
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
settingsPage.clickBackButton();
loginPage.waitForElements();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
contentServicesPage.checkAcsContainer();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed('Task App');
it('[C277753] Should allow the User to login to both Process Services and Content Services using the ALL selection on Settings Page', async () => {
await settingsPage.setProvider(settingsPage.getEcmAndBpmOption(), 'ALL');
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await loginPage.clickSettingsIcon();
await settingsPage.checkProviderDropdownIsDisplayed();
await settingsPage.setProviderEcmBpm();
await loginPage.waitForElements();
await loginPage.enterUsername(adminUserModel.id);
await loginPage.enterPassword(adminUserModel.password);
await loginPage.clickSignInButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed('Task App');
await navigationBarPage.clickSettingsButton();
await expect(await settingsPage.getSelectedOptionText()).toBe('ALL');
await settingsPage.checkBasicAuthRadioIsSelected();
await settingsPage.checkSsoRadioIsNotSelected();
await expect(await settingsPage.getEcmHostUrl()).toBe(browser.params.testConfig.adf_acs.host);
await expect(await settingsPage.getBpmHostUrl()).toBe(browser.params.testConfig.adf_aps.host);
await expect(await settingsPage.getBackButton().isEnabled()).toBe(true);
await expect(await settingsPage.getApplyButton().isEnabled()).toBe(true);
await settingsPage.clickBackButton();
await loginPage.waitForElements();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files');
await contentServicesPage.checkAcsContainer();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed('Task App');
});
});
});
+11 -12
View File
@@ -28,7 +28,7 @@ describe('User Info - SSO', () => {
let silentLogin, identityUser;
let identityService: IdentityService;
beforeAll(async (done) => {
beforeAll(async () => {
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.testConfig.adf.url, browser.params.testConfig.adf.hostSso, 'ECM');
await apiService.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -36,15 +36,14 @@ describe('User Info - SSO', () => {
identityUser = await identityService.createIdentityUser();
silentLogin = false;
settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
await settingsPage.setProviderEcmSso(browser.params.testConfig.adf.url,
browser.params.testConfig.adf.hostSso,
browser.params.testConfig.adf.hostIdentity, silentLogin, true, browser.params.config.oauth2.clientId);
loginSSOPage.clickOnSSOButton();
await loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(identityUser.email, identityUser.password);
await loginSSOPage.loginSSOIdentityService(identityUser.email, identityUser.password);
done();
});
afterAll(async () => {
@@ -53,13 +52,13 @@ describe('User Info - SSO', () => {
}
});
it('[C290066] Should display UserInfo when login using SSO', () => {
userInfoPage.clickUserProfile();
expect(userInfoPage.getSsoHeaderTitle()).toEqual(identityUser.firstName + ' ' + identityUser.lastName);
expect(userInfoPage.getSsoTitle()).toEqual(identityUser.firstName + ' ' + identityUser.lastName);
expect(userInfoPage.getSsoEmail()).toEqual(identityUser.email);
userInfoPage.closeUserProfile();
userInfoPage.dialogIsNotDisplayed();
it('[C290066] Should display UserInfo when login using SSO', async () => {
await userInfoPage.clickUserProfile();
await expect(await userInfoPage.getSsoHeaderTitle()).toEqual(identityUser.firstName + ' ' + identityUser.lastName);
await expect(await userInfoPage.getSsoTitle()).toEqual(identityUser.firstName + ' ' + identityUser.lastName);
await expect(await userInfoPage.getSsoEmail()).toEqual(identityUser.email);
await userInfoPage.closeUserProfile();
await userInfoPage.dialogIsNotDisplayed();
});
});
+61 -62
View File
@@ -46,7 +46,7 @@ describe('User Info component', () => {
'location': resources.Files.PROFILE_IMAGES.BPM.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -69,7 +69,6 @@ describe('User Info component', () => {
await this.alfrescoJsApi.core.peopleApi.addPerson(contentUserModel);
done();
});
afterAll(async () => {
@@ -79,86 +78,86 @@ describe('User Info component', () => {
it('[C260111] Should display UserInfo when Process Services and Content Services are enabled', async () => {
await loginPage.loginToAllUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
await userInfoPage.clickUserProfile();
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A');
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.clickOnContentServicesTab();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.clickOnContentServicesTab();
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A');
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.clickOnProcessServicesTab();
userInfoPage.checkProcessServicesTabIsSelected();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.clickOnProcessServicesTab();
await userInfoPage.checkProcessServicesTabIsSelected();
expect(userInfoPage.getProcessHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getProcessTitle()).toEqual(contentUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoPage.getProcessEmail()).toEqual(contentUserModel.email);
await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getProcessTitle()).toEqual(contentUserModel.firstName + ' ' + processUserModel.lastName);
await expect(await userInfoPage.getProcessEmail()).toEqual(contentUserModel.email);
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.closeUserProfile();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260113] Should display UserInfo when Content Services is enabled and Process Services is disabled', async () => {
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
userInfoPage.dialogIsDisplayed();
await userInfoPage.clickUserProfile();
await userInfoPage.dialogIsDisplayed();
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
await expect(await userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
await expect(await userInfoPage.getContentJobTitle()).toEqual('N/A');
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.closeUserProfile();
userInfoPage.dialogIsNotDisplayed();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
await userInfoPage.dialogIsNotDisplayed();
});
it('[C260115] Should display UserInfo when Process Services is enabled and Content Services is disabled', async () => {
await loginPage.loginToProcessServicesUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
await userInfoPage.clickUserProfile();
userInfoPage.dialogIsDisplayed();
await userInfoPage.dialogIsDisplayed();
expect(userInfoPage.getProcessHeaderTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoPage.getProcessTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
expect(userInfoPage.getProcessEmail()).toEqual(processUserModel.email);
await expect(await userInfoPage.getProcessHeaderTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
await expect(await userInfoPage.getProcessTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
await expect(await userInfoPage.getProcessEmail()).toEqual(processUserModel.email);
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.closeUserProfile();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260117] Should display UserInfo with profile image uploaded in ACS', async () => {
await PeopleAPI.updateAvatarViaAPI(contentUserModel, acsAvatarFileModel, '-me-');
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function () {
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', async() => {
});
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
await userInfoPage.clickUserProfile();
userInfoPage.checkACSProfileImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.closeUserProfile();
await userInfoPage.checkACSProfileImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260118] Should display UserInfo with profile image uploaded in APS', async () => {
@@ -168,12 +167,12 @@ describe('User Info component', () => {
await loginPage.loginToProcessServicesUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
await userInfoPage.clickUserProfile();
userInfoPage.checkAPSProfileImage();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.initialImageNotDisplayed();
userInfoPage.closeUserProfile();
await userInfoPage.checkAPSProfileImage();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.initialImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
it('[C260120] Should not display profile image in UserInfo when deleted in ACS', async () => {
@@ -181,11 +180,11 @@ describe('User Info component', () => {
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
userInfoPage.clickUserProfile();
await userInfoPage.clickUserProfile();
userInfoPage.checkInitialImage();
userInfoPage.APSProfileImageNotDisplayed();
userInfoPage.ACSProfileImageNotDisplayed();
userInfoPage.closeUserProfile();
await userInfoPage.checkInitialImage();
await userInfoPage.APSProfileImageNotDisplayed();
await userInfoPage.ACSProfileImageNotDisplayed();
await userInfoPage.closeUserProfile();
});
});
@@ -47,24 +47,19 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.ARCHIVE_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
site = await this.alfrescoJsApi.core.sitesApi.createSite({
title: StringUtil.generateRandomString(8),
visibility: 'PUBLIC'
});
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.id,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
@@ -75,32 +70,28 @@ describe('Viewer', () => {
let uploadedArchives;
let archiveFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
archiveFolderUploaded = await uploadActions.createFolder(archiveFolderInfo.name, '-my-');
uploadedArchives = await uploadActions.uploadFolder(archiveFolderInfo.location, archiveFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(archiveFolderUploaded.entry.id);
done();
});
it('[C260517] Should be possible to open any Archive file', () => {
contentServicesPage.doubleClickRow('archive');
uploadedArchives.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
it('[C260517] Should be possible to open any Archive file', async () => {
await contentServicesPage.doubleClickRow('archive');
for (const file of uploadedArchives) {
if (file.entry.name !== '.DS_Store') {
await contentServicesPage.doubleClickRow(file.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}
});
});
@@ -53,7 +53,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.OTHER_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -70,7 +70,7 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
done();
});
afterAll(async () => {
@@ -80,14 +80,14 @@ describe('Viewer', () => {
it('[C272813] Should be redirected to site when opening and closing a file in a site', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.goToSite(site);
contentServicesPage.checkAcsContainer();
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.viewFile(pngFileUploaded.entry.name);
viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
describe('Other Folder Uploaded', () => {
@@ -95,32 +95,30 @@ describe('Viewer', () => {
let uploadedOthers;
let otherFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
otherFolderUploaded = await uploadActions.createFolder(otherFolderInfo.name, '-my-');
uploadedOthers = await uploadActions.uploadFolder(otherFolderInfo.location, otherFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(otherFolderUploaded.entry.id);
done();
});
it('[C280012] Should be possible to open any other Document supported extension', () => {
contentServicesPage.doubleClickRow('other');
uploadedOthers.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
it('[C280012] Should be possible to open any other Document supported extension', async () => {
await contentServicesPage.doubleClickRow('other');
for (const file of uploadedOthers) {
if (file.entry.name !== '.DS_Store') {
await contentServicesPage.doubleClickRow(file.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}
});
});
@@ -24,15 +24,12 @@ import resources = require('../../../util/resources');
import { FolderModel } from '../../../models/ACS/folderModel';
import { AcsUserModel } from '../../../models/ACS/acsUserModel';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
let site;
const acsUser = new AcsUserModel();
@@ -46,7 +43,7 @@ describe('Viewer', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,45 +59,37 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('Excel Folder Uploaded', () => {
let uploadedExcels;
let excelFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
excelFolderUploaded = await uploadActions.createFolder(excelFolderInfo.name, '-my-');
uploadedExcels = await uploadActions.uploadFolder(excelFolderInfo.location, excelFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(excelFolderUploaded.entry.id);
done();
});
it('[C280008] Should be possible to open any Excel file', () => {
contentServicesPage.doubleClickRow('excel');
uploadedExcels.forEach((currentFile) => {
it('[C280008] Should be possible to open any Excel file', async () => {
await contentServicesPage.doubleClickRow('excel');
for (const currentFile of uploadedExcels) {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded(currentFile.entry.name);
viewerPage.clickCloseButton();
await contentServicesPage.doubleClickRow(currentFile.entry.name);
await viewerPage.checkFileIsLoaded(currentFile.entry.name);
await viewerPage.clickCloseButton();
}
});
}, 5 * 60 * 1000);
}
});
});
@@ -24,15 +24,12 @@ import resources = require('../../../util/resources');
import { FolderModel } from '../../../models/ACS/folderModel';
import { AcsUserModel } from '../../../models/ACS/acsUserModel';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -51,7 +48,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.IMG_RENDITION_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -67,11 +64,6 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('Image Folder Uploaded', () => {
@@ -79,7 +71,7 @@ describe('Viewer', () => {
let uploadedImages, uploadedImgRenditionFolderInfo;
let imgFolderUploaded, imgFolderRenditionUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
imgFolderUploaded = await uploadActions.createFolder(imgFolderInfo.name, '-my-');
uploadedImages = await uploadActions.uploadFolder(imgFolderInfo.location, imgFolderUploaded.entry.id);
@@ -89,37 +81,33 @@ describe('Viewer', () => {
uploadedImgRenditionFolderInfo = await uploadActions.uploadFolder(imgRenditionFolderInfo.location, imgFolderRenditionUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(imgFolderUploaded.entry.id);
done();
});
it('[C279966] Should be possible to open any Image supported extension', () => {
contentServicesPage.doubleClickRow('images');
uploadedImages.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickCloseButton();
it('[C279966] Should be possible to open any Image supported extension', async () => {
await contentServicesPage.doubleClickRow('images');
for (const image of uploadedImages) {
if (image.entry.name !== '.DS_Store') {
await contentServicesPage.doubleClickRow(image.entry.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickCloseButton();
}
});
contentServicesPage.doubleClickRow('images-rendition');
uploadedImgRenditionFolderInfo.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
}
await contentServicesPage.doubleClickRow('images-rendition');
for (const item of uploadedImgRenditionFolderInfo) {
if (item.entry.name !== '.DS_Store') {
await contentServicesPage.doubleClickRow(item.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}, 5 * 60 * 1000);
}
});
});
@@ -24,19 +24,16 @@ import { FolderModel } from '../../../models/ACS/folderModel';
import { AcsUserModel } from '../../../models/ACS/acsUserModel';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let site;
@@ -47,7 +44,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.PPT_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -63,11 +60,6 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('PowerPoint Folder Uploaded', () => {
@@ -75,33 +67,32 @@ describe('Viewer', () => {
let uploadedPpt;
let pptFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
pptFolderUploaded = await uploadActions.createFolder(pptFolderInfo.name, '-my-');
uploadedPpt = await uploadActions.uploadFolder(pptFolderInfo.location, pptFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pptFolderUploaded.entry.id);
done();
});
it('[C280009] Should be possible to open any PowerPoint file', () => {
contentServicesPage.doubleClickRow('ppt');
it('[C280009] Should be possible to open any PowerPoint file', async () => {
await contentServicesPage.doubleClickRow('ppt');
uploadedPpt.forEach((currentFile) => {
for (const currentFile of uploadedPpt) {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await contentServicesPage.doubleClickRow(currentFile.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}, 5 * 60 * 1000);
}
});
});
@@ -24,19 +24,16 @@ import resources = require('../../../util/resources');
import { FolderModel } from '../../../models/ACS/folderModel';
import { AcsUserModel } from '../../../models/ACS/acsUserModel';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let site;
const acsUser = new AcsUserModel();
@@ -46,7 +43,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,11 +59,6 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('Text Folder Uploaded', () => {
@@ -74,32 +66,30 @@ describe('Viewer', () => {
let uploadedTexts;
let textFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
textFolderUploaded = await uploadActions.createFolder(textFolderInfo.name, '-my-');
uploadedTexts = await uploadActions.uploadFolder(textFolderInfo.location, textFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(textFolderUploaded.entry.id);
done();
});
it('[C280010] Should be possible to open any Text file', () => {
contentServicesPage.doubleClickRow('text');
uploadedTexts.forEach((currentFile) => {
it('[C280010] Should be possible to open any Text file', async () => {
await contentServicesPage.doubleClickRow('text');
for (const currentFile of uploadedTexts) {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await contentServicesPage.doubleClickRow(currentFile.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}
});
});
@@ -46,7 +46,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.WORD_FOLDER.folder_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,7 +62,6 @@ describe('Viewer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
afterAll(async () => {
@@ -74,32 +73,30 @@ describe('Viewer', () => {
let uploadedWords;
let wordFolderUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
wordFolderUploaded = await uploadActions.createFolder(wordFolderInfo.name, '-my-');
uploadedWords = await uploadActions.uploadFolder(wordFolderInfo.location, wordFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(wordFolderUploaded.entry.id);
done();
});
it('[C280011] Should be possible to open any Word file', () => {
contentServicesPage.doubleClickRow('word');
uploadedWords.forEach((currentFile) => {
it('[C280011] Should be possible to open any Word file', async () => {
await contentServicesPage.doubleClickRow('word');
for (const currentFile of uploadedWords) {
if (currentFile.entry.name !== '.DS_Store') {
contentServicesPage.doubleClickRow(currentFile.entry.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await contentServicesPage.doubleClickRow(currentFile.entry.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
}
});
}
});
});
+22 -26
View File
@@ -46,7 +46,7 @@ describe('Info Drawer', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -63,43 +63,39 @@ describe('Info Drawer', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await uploadActions.deleteFileOrFolder(pngFileUploaded.entry.id);
done();
});
beforeEach(async() => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.goToSite(site);
contentServicesPage.checkAcsContainer();
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
it('[C277251] Should display the icon when the icon property is defined', async () => {
await viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.clickLeftSidebarButton();
await viewerPage.enableShowTabWithIcon();
await viewerPage.enableShowTabWithIconAndLabel();
await viewerPage.checkTabHasNoIcon(0);
await expect(await viewerPage.getTabIconById(1)).toBe('face');
await expect(await viewerPage.getTabIconById(2)).toBe('comment');
});
it('[C277251] Should display the icon when the icon property is defined', () => {
viewerPage.viewFile(pngFileUploaded.entry.name);
viewerPage.clickLeftSidebarButton();
viewerPage.enableShowTabWithIcon();
viewerPage.enableShowTabWithIconAndLabel();
viewerPage.checkTabHasNoIcon(0);
expect(viewerPage.getTabIconById(1)).toBe('face');
expect(viewerPage.getTabIconById(2)).toBe('comment');
});
it('[C277252] Should display the label when the label property is defined', () => {
viewerPage.viewFile(pngFileUploaded.entry.name);
viewerPage.clickLeftSidebarButton();
viewerPage.enableShowTabWithIcon();
viewerPage.enableShowTabWithIconAndLabel();
expect(viewerPage.getTabLabelById(0)).toBe('SETTINGS');
viewerPage.checkTabHasNoLabel(1);
expect(viewerPage.getTabLabelById(2)).toBe('COMMENTS');
it('[C277252] Should display the label when the label property is defined', async () => {
await viewerPage.viewFile(pngFileUploaded.entry.name);
await viewerPage.clickLeftSidebarButton();
await viewerPage.enableShowTabWithIcon();
await viewerPage.enableShowTabWithIconAndLabel();
await expect(await viewerPage.getTabLabelById(0)).toBe('SETTINGS');
await viewerPage.checkTabHasNoLabel(1);
await expect(await viewerPage.getTabLabelById(2)).toBe('COMMENTS');
});
});
@@ -77,7 +77,7 @@ describe('Content Services Viewer', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -108,12 +108,11 @@ describe('Content Services Viewer', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pdfFile.getId());
await uploadActions.deleteFileOrFolder(protectedFile.getId());
await uploadActions.deleteFileOrFolder(docxFile.getId());
@@ -123,294 +122,293 @@ describe('Content Services Viewer', () => {
await uploadActions.deleteFileOrFolder(unsupportedFile.getId());
await navigationBarPage.clickLogoutButton();
done();
});
it('[C260038] Should display first page, toolbar and pagination when opening a .pdf file', () => {
contentServicesPage.checkAcsContainer();
it('[C260038] Should display first page, toolbar and pagination when opening a .pdf file', async () => {
await contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.viewFile(pdfFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileNameIsDisplayed(pdfFile.name);
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkFullScreenButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkPreviousPageButtonIsDisplayed();
viewerPage.checkNextPageButtonIsDisplayed();
viewerPage.checkPageSelectorInputIsDisplayed('1');
viewerPage.checkPercentageIsDisplayed();
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed();
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(pdfFile.name);
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkFullScreenButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkPreviousPageButtonIsDisplayed();
await viewerPage.checkNextPageButtonIsDisplayed();
await viewerPage.checkPageSelectorInputIsDisplayed('1');
await viewerPage.checkPercentageIsDisplayed();
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkZoomOutButtonIsDisplayed();
await viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260040] Should be able to change pages and zoom when .pdf file is open', async () => {
viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.viewFile(pdfFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.clickNextPageButton();
viewerPage.checkFileContent('2', pdfFile.secondPageText);
viewerPage.checkPageSelectorInputIsDisplayed('2');
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.clickNextPageButton();
await viewerPage.checkFileContent('2', pdfFile.secondPageText);
await viewerPage.checkPageSelectorInputIsDisplayed('2');
viewerPage.clickPreviousPageButton();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkPageSelectorInputIsDisplayed('1');
await viewerPage.clickPreviousPageButton();
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkPageSelectorInputIsDisplayed('1');
viewerPage.clearPageNumber();
viewerPage.checkPageSelectorInputIsDisplayed('');
await viewerPage.clearPageNumber();
await viewerPage.checkPageSelectorInputIsDisplayed('');
const initialWidth = await viewerPage.getCanvasWidth();
const initialHeight = await viewerPage.getCanvasHeight();
viewerPage.clickZoomInButton();
expect(+(await viewerPage.getCanvasWidth())).toBeGreaterThan(+initialWidth);
expect(+(await viewerPage.getCanvasHeight())).toBeGreaterThan(+initialHeight);
await viewerPage.clickZoomInButton();
await expect(+(await viewerPage.getCanvasWidth())).toBeGreaterThan(+initialWidth);
await expect(+(await viewerPage.getCanvasHeight())).toBeGreaterThan(+initialHeight);
viewerPage.clickActualSize();
expect(+(await viewerPage.getCanvasWidth())).toEqual(+initialWidth);
expect(+(await viewerPage.getCanvasHeight())).toEqual(+initialHeight);
await viewerPage.clickActualSize();
await expect(+(await viewerPage.getCanvasWidth())).toEqual(+initialWidth);
await expect(+(await viewerPage.getCanvasHeight())).toEqual(+initialHeight);
viewerPage.clickZoomOutButton();
expect(+(await viewerPage.getCanvasWidth())).toBeLessThan(+initialWidth);
expect(+(await viewerPage.getCanvasHeight())).toBeLessThan(+initialHeight);
await viewerPage.clickZoomOutButton();
await expect(+(await viewerPage.getCanvasWidth())).toBeLessThan(+initialWidth);
await expect(+(await viewerPage.getCanvasHeight())).toBeLessThan(+initialHeight);
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260042] Should be able to download, open full-screen and Info container from the Viewer', () => {
viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C260042] Should be able to download, open full-screen and Info container from the Viewer', async () => {
await viewerPage.viewFile(jpgFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkFullScreenButtonIsDisplayed();
viewerPage.clickFullScreenButton();
await viewerPage.checkFullScreenButtonIsDisplayed();
await viewerPage.clickFullScreenButton();
viewerPage.exitFullScreen();
await viewerPage.exitFullScreen();
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.clickDownloadButton();
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.clickDownloadButton();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260052] Should display image, toolbar and pagination when opening a .jpg file', () => {
viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C260052] Should display image, toolbar and pagination when opening a .jpg file', async () => {
await viewerPage.viewFile(jpgFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileNameIsDisplayed(jpgFile.name);
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkFullScreenButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkPercentageIsDisplayed();
viewerPage.checkRotateLeftButtonIsDisplayed();
viewerPage.checkRotateRightButtonIsDisplayed();
viewerPage.checkScaleImgButtonIsDisplayed();
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(jpgFile.name);
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkFullScreenButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkZoomOutButtonIsDisplayed();
await viewerPage.checkPercentageIsDisplayed();
await viewerPage.checkRotateLeftButtonIsDisplayed();
await viewerPage.checkRotateRightButtonIsDisplayed();
await viewerPage.checkScaleImgButtonIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260483] Should be able to zoom and rotate image when .jpg file is open', () => {
viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C260483] Should be able to zoom and rotate image when .jpg file is open', async () => {
await viewerPage.viewFile(jpgFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkPercentageIsDisplayed();
await viewerPage.checkPercentageIsDisplayed();
zoom = viewerPage.getZoom();
viewerPage.clickZoomInButton();
viewerPage.checkZoomedIn(zoom);
zoom = await viewerPage.getZoom();
await viewerPage.clickZoomInButton();
await viewerPage.checkZoomedIn(zoom);
zoom = viewerPage.getZoom();
viewerPage.clickZoomOutButton();
viewerPage.checkZoomedOut(zoom);
zoom = await viewerPage.getZoom();
await viewerPage.clickZoomOutButton();
await viewerPage.checkZoomedOut(zoom);
viewerPage.clickRotateLeftButton();
viewerPage.checkRotation('transform: scale(1, 1) rotate(-90deg) translate(0px, 0px);');
await viewerPage.clickRotateLeftButton();
await viewerPage.checkRotation('transform: scale(1, 1) rotate(-90deg) translate(0px, 0px);');
viewerPage.clickScaleImgButton();
viewerPage.checkRotation('transform: scale(1, 1) rotate(0deg) translate(0px, 0px);');
await viewerPage.clickScaleImgButton();
await viewerPage.checkRotation('transform: scale(1, 1) rotate(0deg) translate(0px, 0px);');
viewerPage.clickRotateRightButton();
viewerPage.checkRotation('transform: scale(1, 1) rotate(90deg) translate(0px, 0px);');
await viewerPage.clickRotateRightButton();
await viewerPage.checkRotation('transform: scale(1, 1) rotate(90deg) translate(0px, 0px);');
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C279922] Should display first page, toolbar and pagination when opening a .ppt file', () => {
viewerPage.viewFile(pptFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C279922] Should display first page, toolbar and pagination when opening a .ppt file', async () => {
await viewerPage.viewFile(pptFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pptFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkFileNameIsDisplayed(pptFile.name);
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkPreviousPageButtonIsDisplayed();
viewerPage.checkNextPageButtonIsDisplayed();
viewerPage.checkPageSelectorInputIsDisplayed('1');
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed();
await viewerPage.checkFileContent('1', pptFile.firstPageText);
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(pptFile.name);
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkPreviousPageButtonIsDisplayed();
await viewerPage.checkNextPageButtonIsDisplayed();
await viewerPage.checkPageSelectorInputIsDisplayed('1');
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkZoomOutButtonIsDisplayed();
await viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C291903] Should display the buttons in order in the adf viewer toolbar', () => {
viewerPage.viewFile(pdfFile.name);
viewerPage.checkLeftSideBarIsNotDisplayed();
viewerPage.clickLeftSidebarButton();
viewerPage.checkLeftSideBarIsDisplayed();
viewerPage.enableMoreActionsMenu();
viewerPage.checkToolbarIsDisplayed();
expect(viewerPage.getLastButtonTitle()).toEqual(viewerPage.getMoreActionsMenuTitle());
viewerPage.clickCloseButton();
it('[C291903] Should display the buttons in order in the adf viewer toolbar', async () => {
await viewerPage.viewFile(pdfFile.name);
await viewerPage.checkLeftSideBarIsNotDisplayed();
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.enableMoreActionsMenu();
await viewerPage.checkToolbarIsDisplayed();
await expect(await viewerPage.getLastButtonTitle()).toEqual(await viewerPage.getMoreActionsMenuTitle());
await viewerPage.clickCloseButton();
});
it('[C260053] Should display first page, toolbar and pagination when opening a .docx file', () => {
viewerPage.viewFile(docxFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C260053] Should display first page, toolbar and pagination when opening a .docx file', async () => {
await viewerPage.viewFile(docxFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', docxFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkFileNameIsDisplayed(docxFile.name);
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkPreviousPageButtonIsDisplayed();
viewerPage.checkNextPageButtonIsDisplayed();
viewerPage.checkPageSelectorInputIsDisplayed('1');
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed();
await viewerPage.checkFileContent('1', docxFile.firstPageText);
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(docxFile.name);
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkPreviousPageButtonIsDisplayed();
await viewerPage.checkNextPageButtonIsDisplayed();
await viewerPage.checkPageSelectorInputIsDisplayed('1');
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkZoomOutButtonIsDisplayed();
await viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260054] Should display Preview could not be loaded and viewer toolbar when opening an unsupported file', () => {
viewerPage.viewFile(unsupportedFile.name);
it('[C260054] Should display Preview could not be loaded and viewer toolbar when opening an unsupported file', async () => {
await viewerPage.viewFile(unsupportedFile.name);
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileNameIsDisplayed(unsupportedFile.name);
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(unsupportedFile.name);
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkZoomInButtonIsNotDisplayed();
viewerPage.checkUnknownFormatIsDisplayed();
expect(viewerPage.getUnknownFormatMessage()).toBe('Couldn\'t load preview. Unknown format.');
await viewerPage.checkZoomInButtonIsNotDisplayed();
await viewerPage.checkUnknownFormatIsDisplayed();
await expect(await viewerPage.getUnknownFormatMessage()).toBe('Couldn\'t load preview. Unknown format.');
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C260056] Should display video and viewer toolbar when opening a media file', () => {
viewerPage.viewFile(mp4File.name);
it('[C260056] Should display video and viewer toolbar when opening a media file', async () => {
await viewerPage.viewFile(mp4File.name);
viewerPage.checkMediaPlayerContainerIsDisplayed();
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileThumbnailIsDisplayed();
viewerPage.checkFileNameIsDisplayed(mp4File.name);
viewerPage.checkDownloadButtonIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.checkFullScreenButtonIsNotDisplayed();
await viewerPage.checkMediaPlayerContainerIsDisplayed();
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.checkFileThumbnailIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(mp4File.name);
await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkFullScreenButtonIsNotDisplayed();
viewerPage.checkZoomInButtonIsNotDisplayed();
await viewerPage.checkZoomInButtonIsNotDisplayed();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C261123] Should be able to preview all pages and navigate to a page when using thumbnails', () => {
viewerPage.viewFile(pdfFile.name);
it('[C261123] Should be able to preview all pages and navigate to a page when using thumbnails', async () => {
await viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkThumbnailsBtnIsDisplayed();
viewerPage.clickThumbnailsBtn();
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkThumbnailsBtnIsDisplayed();
await viewerPage.clickThumbnailsBtn();
viewerPage.checkThumbnailsContentIsDisplayed();
viewerPage.checkThumbnailsCloseIsDisplayed();
viewerPage.checkAllThumbnailsDisplayed(pdfFile.lastPageNumber);
await viewerPage.checkThumbnailsContentIsDisplayed();
await viewerPage.checkThumbnailsCloseIsDisplayed();
await viewerPage.checkAllThumbnailsDisplayed(pdfFile.lastPageNumber);
viewerPage.clickSecondThumbnail();
viewerPage.checkFileContent('2', pdfFile.secondPageText);
viewerPage.checkCurrentThumbnailIsSelected();
await viewerPage.clickSecondThumbnail();
await viewerPage.checkFileContent('2', pdfFile.secondPageText);
await viewerPage.checkCurrentThumbnailIsSelected();
viewerPage.checkPreviousPageButtonIsDisplayed();
viewerPage.clickPreviousPageButton();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkCurrentThumbnailIsSelected();
await viewerPage.checkPreviousPageButtonIsDisplayed();
await viewerPage.clickPreviousPageButton();
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkCurrentThumbnailIsSelected();
viewerPage.clickThumbnailsBtn();
viewerPage.checkThumbnailsContentIsNotDisplayed();
viewerPage.clickThumbnailsBtn();
viewerPage.checkThumbnailsCloseIsDisplayed();
viewerPage.clickThumbnailsClose();
await viewerPage.clickThumbnailsBtn();
await viewerPage.checkThumbnailsContentIsNotDisplayed();
await viewerPage.clickThumbnailsBtn();
await viewerPage.checkThumbnailsCloseIsDisplayed();
await viewerPage.clickThumbnailsClose();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C268105] Should display current thumbnail when getting to the page following the last visible thumbnail', () => {
viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
it('[C268105] Should display current thumbnail when getting to the page following the last visible thumbnail', async () => {
await viewerPage.viewFile(pdfFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkThumbnailsBtnIsDisplayed();
viewerPage.clickThumbnailsBtn();
viewerPage.clickLastThumbnailDisplayed();
viewerPage.checkCurrentThumbnailIsSelected();
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkThumbnailsBtnIsDisplayed();
await viewerPage.clickThumbnailsBtn();
await viewerPage.clickLastThumbnailDisplayed();
await viewerPage.checkCurrentThumbnailIsSelected();
viewerPage.checkNextPageButtonIsDisplayed();
viewerPage.clickNextPageButton();
viewerPage.checkCurrentThumbnailIsSelected();
await viewerPage.checkNextPageButtonIsDisplayed();
await viewerPage.clickNextPageButton();
await viewerPage.checkCurrentThumbnailIsSelected();
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C269109] Should not be able to open thumbnail panel before the pdf is loaded', () => {
viewerPage.viewFile(pdfFile.name);
it('[C269109] Should not be able to open thumbnail panel before the pdf is loaded', async () => {
await viewerPage.viewFile(pdfFile.name);
viewerPage.checkThumbnailsBtnIsDisabled();
await viewerPage.checkThumbnailsBtnIsDisabled();
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.clickCloseButton();
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.clickCloseButton();
});
it('[C268901] Should need a password when opening a protected file', () => {
viewerPage.viewFile(protectedFile.name);
it('[C268901] Should need a password when opening a protected file', async () => {
await viewerPage.viewFile(protectedFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkPasswordDialogIsDisplayed();
viewerPage.checkPasswordSubmitDisabledIsDisplayed();
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkPasswordDialogIsDisplayed();
await viewerPage.checkPasswordSubmitDisabledIsDisplayed();
viewerPage.enterPassword('random password');
viewerPage.clickPasswordSubmit();
viewerPage.checkPasswordErrorIsDisplayed();
viewerPage.checkPasswordInputIsDisplayed();
await viewerPage.enterPassword('random password');
await viewerPage.clickPasswordSubmit();
await viewerPage.checkPasswordErrorIsDisplayed();
await viewerPage.checkPasswordInputIsDisplayed();
viewerPage.enterPassword(protectedFile.password);
viewerPage.clickPasswordSubmit();
viewerPage.checkFileContent('1', protectedFile.firstPageText);
await viewerPage.enterPassword(protectedFile.password);
await viewerPage.clickPasswordSubmit();
await viewerPage.checkFileContent('1', protectedFile.firstPageText);
viewerPage.clickCloseButton();
await viewerPage.clickCloseButton();
});
it('[C307985] Should close the viewer when password dialog is cancelled', () => {
viewerPage.viewFile(protectedFile.name);
viewerPage.checkPasswordDialogIsDisplayed();
viewerPage.clickClosePasswordDialog();
contentServicesPage.checkContentIsDisplayed(protectedFile.name);
it('[C307985] Should close the viewer when password dialog is cancelled', async () => {
await viewerPage.viewFile(protectedFile.name);
await viewerPage.checkPasswordDialogIsDisplayed();
await viewerPage.clickClosePasswordDialog();
await contentServicesPage.checkContentIsDisplayed(protectedFile.name);
});
});
@@ -44,7 +44,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -54,41 +54,40 @@ describe('Viewer', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(txtFileUploaded.entry.id);
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
contentServicesPage.doubleClickRow(txtFileUploaded.entry.name);
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.doubleClickRow(txtFileUploaded.entry.name);
});
afterEach(() => {
viewerPage.clickCloseButton();
afterEach(async () => {
await viewerPage.clickCloseButton();
});
it('[C260096] Should the Viewer able to accept a customToolbar', () => {
viewerPage.clickLeftSidebarButton();
viewerPage.checkLeftSideBarIsDisplayed();
viewerPage.checkToolbarIsDisplayed();
viewerPage.enableCustomToolbar();
viewerPage.checkCustomToolbarIsDisplayed();
viewerPage.disableCustomToolbar();
it('[C260096] Should the Viewer able to accept a customToolbar', async () => {
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.checkToolbarIsDisplayed();
await viewerPage.enableCustomToolbar();
await viewerPage.checkCustomToolbarIsDisplayed();
await viewerPage.disableCustomToolbar();
});
it('[C260097] Should the viewer able to show a custom info-drawer when the sidebarTemplate is set', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnTab('Comments');
viewerPage.checkTabIsActive('Comments');
viewerPage.clickOnTab('Properties');
viewerPage.checkTabIsActive('Properties');
viewerPage.clickOnTab('Versions');
viewerPage.checkTabIsActive('Versions');
it('[C260097] Should the viewer able to show a custom info-drawer when the sidebarTemplate is set', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnTab('Comments');
await viewerPage.checkTabIsActive('Comments');
await viewerPage.clickOnTab('Properties');
await viewerPage.checkTabIsActive('Properties');
await viewerPage.clickOnTab('Versions');
await viewerPage.checkTabIsActive('Versions');
});
});
+13 -16
View File
@@ -34,9 +34,9 @@ describe('Viewer', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let site;
const acsUser = new AcsUserModel();
@@ -48,7 +48,7 @@ describe('Viewer', () => {
'location': resources.Files.ADF_DOCUMENTS.JS.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -69,30 +69,27 @@ describe('Viewer', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await uploadActions.deleteFileOrFolder(jsFileUploaded.entry.id);
await navigationBarPage.clickLogoutButton();
done();
});
describe('Viewer extension', () => {
it('[C297698] Should be able to add an extension for code editor viewer', () => {
navigationBarPage.clickAboutButton();
it('[C297698] Should be able to add an extension for code editor viewer', async () => {
await navigationBarPage.clickAboutButton();
monacoExtensionPage.checkMonacoPluginIsDisplayed();
await monacoExtensionPage.checkMonacoPluginIsDisplayed();
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(jsFileInfo.name);
contentServicesPage.doubleClickRow(jsFileInfo.name);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(jsFileInfo.name);
await contentServicesPage.doubleClickRow(jsFileInfo.name);
viewerPage.checkCodeViewerIsDisplayed();
await viewerPage.checkCodeViewerIsDisplayed();
});
});
});
+82 -85
View File
@@ -49,7 +49,7 @@ describe('Viewer - properties', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -64,136 +64,133 @@ describe('Viewer - properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
await contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pngFile.name);
await viewerPage.viewFile(pngFile.name);
viewerPage.clickLeftSidebarButton();
viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pngFile.getId());
await navigationBarPage.clickLogoutButton();
done();
});
it('[C260066] Should Show/Hide viewer toolbar when showToolbar is true/false', () => {
viewerPage.checkToolbarIsDisplayed();
viewerPage.disableToolbar();
viewerPage.checkToolbarIsNotDisplayed();
viewerPage.enableToolbar();
it('[C260066] Should Show/Hide viewer toolbar when showToolbar is true/false', async () => {
await viewerPage.checkToolbarIsDisplayed();
await viewerPage.disableToolbar();
await viewerPage.checkToolbarIsNotDisplayed();
await viewerPage.enableToolbar();
});
it('[C260076] Should Show/Hide back button when allowGoBack is true/false', () => {
viewerPage.checkGoBackIsDisplayed();
viewerPage.disableGoBack();
viewerPage.checkGoBackIsNotDisplayed();
viewerPage.enableGoBack();
it('[C260076] Should Show/Hide back button when allowGoBack is true/false', async () => {
await viewerPage.checkGoBackIsDisplayed();
await viewerPage.disableGoBack();
await viewerPage.checkGoBackIsNotDisplayed();
await viewerPage.enableGoBack();
});
it('[C260077] Should Show toolbar options dropdown when adf-viewer-open-with directive is used', () => {
viewerPage.checkToolbarOptionsIsNotDisplayed();
viewerPage.enableToolbarOptions();
viewerPage.checkToolbarOptionsIsDisplayed();
viewerPage.disableToolbarOptions();
it('[C260077] Should Show toolbar options dropdown when adf-viewer-open-with directive is used', async () => {
await viewerPage.checkToolbarOptionsIsNotDisplayed();
await viewerPage.enableToolbarOptions();
await viewerPage.checkToolbarOptionsIsDisplayed();
await viewerPage.disableToolbarOptions();
});
it('[C260079] Should Show/Hide download button when allowDownload is true/false', () => {
viewerPage.checkDownloadButtonDisplayed();
viewerPage.disableDownload();
viewerPage.checkDownloadButtonIsNotDisplayed();
viewerPage.enableDownload();
it('[C260079] Should Show/Hide download button when allowDownload is true/false', async () => {
await viewerPage.checkDownloadButtonDisplayed();
await viewerPage.disableDownload();
await viewerPage.checkDownloadButtonIsNotDisplayed();
await viewerPage.enableDownload();
});
it('[C260082] Should Show/Hide print button when allowPrint is true/false', () => {
viewerPage.checkPrintButtonIsDisplayed();
viewerPage.disablePrint();
viewerPage.checkPrintButtonIsNotDisplayed();
viewerPage.enablePrint();
it('[C260082] Should Show/Hide print button when allowPrint is true/false', async () => {
await viewerPage.checkPrintButtonIsDisplayed();
await viewerPage.disablePrint();
await viewerPage.checkPrintButtonIsNotDisplayed();
await viewerPage.enablePrint();
});
it('[C260092] Should show adf-viewer-toolbar-actions directive buttons when adf-viewer-toolbar-actions is used', () => {
viewerPage.checkMoreActionsDisplayed();
it('[C260092] Should show adf-viewer-toolbar-actions directive buttons when adf-viewer-toolbar-actions is used', async () => {
await viewerPage.checkMoreActionsDisplayed();
viewerPage.disableMoreActions();
await viewerPage.disableMoreActions();
viewerPage.checkMoreActionsIsNotDisplayed();
await viewerPage.checkMoreActionsIsNotDisplayed();
viewerPage.enableMoreActions();
await viewerPage.enableMoreActions();
});
it('[C260074] Should show a custom file name when displayName property is used', () => {
viewerPage.checkFileNameIsDisplayed(pngFile.name);
it('[C260074] Should show a custom file name when displayName property is used', async () => {
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.enableCustomName();
await viewerPage.enableCustomName();
viewerPage.enterCustomName('test custom title');
viewerPage.checkFileNameIsDisplayed('test custom title');
await viewerPage.enterCustomName('test custom title');
await viewerPage.checkFileNameIsDisplayed('test custom title');
viewerPage.disableCustomName();
await viewerPage.disableCustomName();
});
it('[C260090] Should showSidebar allow right info-drawer to be shown', () => {
viewerPage.clickToggleRightSidebar();
viewerPage.checkInfoSideBarIsDisplayed();
it('[C260090] Should showSidebar allow right info-drawer to be shown', async () => {
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickToggleRightSidebar();
viewerPage.checkInfoSideBarIsNotDisplayed();
await viewerPage.clickToggleRightSidebar();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
it('[C286442] Should showLeftSidebar allow left info-drawer to be shown', () => {
viewerPage.clickToggleLeftSidebar();
viewerPage.checkLeftSideBarIsNotDisplayed();
viewerPage.clickLeftSidebarButton();
viewerPage.checkLeftSideBarIsDisplayed();
it('[C286442] Should showLeftSidebar allow left info-drawer to be shown', async () => {
await viewerPage.clickToggleLeftSidebar();
await viewerPage.checkLeftSideBarIsNotDisplayed();
await viewerPage.clickLeftSidebarButton();
await viewerPage.checkLeftSideBarIsDisplayed();
});
it('[C260089] Should Show/Hide info-drawer if allowSidebar true/false', () => {
viewerPage.clickInfoButton();
it('[C260089] Should Show/Hide info-drawer if allowSidebar true/false', async () => {
await viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
viewerPage.disableAllowSidebar();
await viewerPage.disableAllowSidebar();
viewerPage.checkInfoButtonIsNotDisplayed();
viewerPage.checkInfoSideBarIsNotDisplayed();
await viewerPage.checkInfoButtonIsNotDisplayed();
await viewerPage.checkInfoSideBarIsNotDisplayed();
});
it('[C286596] Should Show/Hide left info-drawer if allowLeftSidebar true/false', () => {
viewerPage.checkLeftSideBarIsDisplayed();
viewerPage.checkLeftSideBarButtonIsDisplayed();
it('[C286596] Should Show/Hide left info-drawer if allowLeftSidebar true/false', async () => {
await viewerPage.checkLeftSideBarIsDisplayed();
await viewerPage.checkLeftSideBarButtonIsDisplayed();
viewerPage.disableAllowLeftSidebar();
await viewerPage.disableAllowLeftSidebar();
viewerPage.checkLeftSideBarButtonIsNotDisplayed();
viewerPage.checkLeftSideBarIsNotDisplayed();
await viewerPage.checkLeftSideBarButtonIsNotDisplayed();
await viewerPage.checkLeftSideBarIsNotDisplayed();
});
it('[C260100] Should be possible to disable Overlay viewer', () => {
viewerPage.clickCloseButton();
navigationBarPage.scrollTo(navigationBarPage.overlayViewerButton);
navigationBarPage.clickOverlayViewerButton();
it('[C260100] Should be possible to disable Overlay viewer', async () => {
await viewerPage.clickCloseButton();
await navigationBarPage.clickOverlayViewerButton();
dataTable.doubleClickRow('Name', fileForOverlay.name);
viewerPage.checkOverlayViewerIsDisplayed();
viewerPage.clickCloseButton();
dataTable.doubleClickRow('Name', pngFile.name);
viewerPage.checkOverlayViewerIsDisplayed();
viewerPage.clickCloseButton();
await dataTable.doubleClickRow('Name', fileForOverlay.name);
await viewerPage.checkOverlayViewerIsDisplayed();
await viewerPage.clickCloseButton();
await dataTable.doubleClickRow('Name', pngFile.name);
await viewerPage.checkOverlayViewerIsDisplayed();
await viewerPage.clickCloseButton();
viewerPage.disableOverlay();
dataTable.doubleClickRow('Name', fileForOverlay.name);
viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkInlineViewerIsDisplayed();
dataTable.doubleClickRow('Name', pngFile.name);
viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkInlineViewerIsDisplayed();
await viewerPage.disableOverlay();
await dataTable.doubleClickRow('Name', fileForOverlay.name);
await viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkInlineViewerIsDisplayed();
await dataTable.doubleClickRow('Name', pngFile.name);
await viewerPage.checkImgContainerIsDisplayed();
await viewerPage.checkInlineViewerIsDisplayed();
});
});
+28 -33
View File
@@ -34,9 +34,9 @@ describe('Viewer', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let site;
const acsUser = new AcsUserModel();
@@ -56,7 +56,7 @@ describe('Viewer', () => {
let pngFileShared, wordFileUploaded;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -80,49 +80,44 @@ describe('Viewer', () => {
pngFileShared = await this.alfrescoJsApi.core.sharedlinksApi.addSharedLink({ 'nodeId': pngFileUploaded.entry.id });
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await uploadActions.deleteFileOrFolder(wordFileUploaded.entry.id);
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260105] Should be able to open an image file shared via API', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
viewerPage.checkImgContainerIsDisplayed();
BrowserActions.getUrl(browser.params.testConfig.adf.url);
navigationBarPage.clickLogoutButton();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
viewerPage.checkImgContainerIsDisplayed();
it('[C260105] Should be able to open an image file shared via API', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
await viewerPage.checkImgContainerIsDisplayed();
await BrowserActions.getUrl(browser.params.testConfig.adf.url);
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
await viewerPage.checkImgContainerIsDisplayed();
});
it('[C260106] Should be able to open a Word file shared via API', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
it('[C260106] Should be able to open a Word file shared via API', async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
contentList.selectRow(wordFileInfo.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
browser.controlFlow().execute(async () => {
const sharedLink = await shareDialog.getShareLink();
await contentList.selectRow(wordFileInfo.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
await BrowserActions.getUrl(sharedLink);
viewerPage.checkFileIsLoaded();
viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
await BrowserActions.getUrl(browser.params.testConfig.adf.url);
navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
viewerPage.checkFileIsLoaded();
viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
});
await BrowserActions.getUrl(browser.params.testConfig.adf.url);
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
});
});
+12 -13
View File
@@ -36,7 +36,7 @@ describe('Analytics Smoke Test', () => {
let tenantId;
const reportTitle = 'New Title';
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -53,22 +53,21 @@ describe('Analytics Smoke Test', () => {
await loginPage.loginToProcessServicesUsingUserModel(procUserModel);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C260346] Should be able to change title of a report', () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp('Task App');
processServiceTabBarPage.clickReportsButton();
analyticsPage.checkNoReportMessage();
analyticsPage.getReport('Process definition heat map');
analyticsPage.changeReportTitle(reportTitle);
expect(analyticsPage.getReportTitle()).toEqual(reportTitle);
it('[C260346] Should be able to change title of a report', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickReportsButton();
await analyticsPage.checkNoReportMessage();
await analyticsPage.getReport('Process definition heat map');
await analyticsPage.changeReportTitle(reportTitle);
await expect(await analyticsPage.getReportTitle()).toEqual(reportTitle);
});
});
+89 -108
View File
@@ -15,182 +15,163 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { ElementFinder } from 'protractor/built/element';
export class CardViewComponentPage {
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
keyValueRow = 'card-view__key-value-pairs__row';
addButton: ElementFinder = element(by.className('adf-card-view__key-value-pairs__add-btn'));
selectValue = 'mat-option';
textField = element(by.css(`input[data-automation-id='card-textitem-editinput-name']`));
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
consoleLog = element(by.className('adf-console'));
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
select = element(by.css('mat-select[data-automation-class="select-box"]'));
checkbox = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
resetButton = element(by.css(`#adf-reset-card-log`));
listContent = element(by.css('.mat-select-panel'));
editableSwitch = element(by.id('adf-toggle-editable'));
textField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-name']`));
intField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
floatField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
valueInputField: ElementFinder = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
nameInputField: ElementFinder = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
consoleLog: ElementFinder = element(by.className('adf-console'));
deleteButton: ElementFinder = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
select: ElementFinder = element(by.css('mat-select[data-automation-class="select-box"]'));
checkbox: ElementFinder = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
resetButton: ElementFinder = element(by.css(`#adf-reset-card-log`));
listContent: ElementFinder = element(by.css('.mat-select-panel'));
editableSwitch: ElementFinder = element(by.id('adf-toggle-editable'));
clickOnAddButton() {
BrowserActions.click(this.addButton);
return this;
async clickOnAddButton(): Promise<void> {
await BrowserActions.click(this.addButton);
}
clickOnResetButton() {
BrowserActions.click(this.resetButton);
return this;
async clickOnResetButton(): Promise<void> {
await BrowserActions.click(this.resetButton);
}
clickOnTextField() {
const toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`));
BrowserActions.click(toggleText);
BrowserVisibility.waitUntilElementIsVisible(this.textField);
return this;
async clickOnTextField(): Promise<void> {
const toggleText: ElementFinder = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`));
await BrowserActions.click(toggleText);
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
}
clickOnTextClearIcon() {
const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`));
BrowserActions.click(clearIcon);
async clickOnTextClearIcon(): Promise<void> {
const clearIcon: ElementFinder = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`));
await BrowserActions.click(clearIcon);
}
clickOnTextSaveIcon() {
const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`));
BrowserActions.click(saveIcon);
async clickOnTextSaveIcon(): Promise<void> {
const saveIcon: ElementFinder = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`));
await BrowserActions.click(saveIcon);
}
getTextFieldText() {
const textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`));
getTextFieldText(): Promise<string> {
const textField: ElementFinder = element(by.css(`span[data-automation-id="card-textitem-value-name"]`));
return BrowserActions.getText(textField);
}
enterTextField(text) {
BrowserVisibility.waitUntilElementIsVisible(this.textField);
BrowserActions.clearSendKeys(this.textField, text);
return this;
async enterTextField(text: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
await BrowserActions.clearSendKeys(this.textField, text);
}
clickOnIntField() {
const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
BrowserActions.click(toggleText);
BrowserVisibility.waitUntilElementIsVisible(this.intField);
return this;
async clickOnIntField(): Promise<void> {
const toggleText: ElementFinder = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
await BrowserActions.click(toggleText);
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
}
clickOnIntClearIcon() {
const clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
BrowserActions.click(clearIcon);
async clickOnIntClearIcon(): Promise<void> {
const clearIcon: ElementFinder = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
await BrowserActions.click(clearIcon);
}
clickOnIntSaveIcon() {
const saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
BrowserActions.click(saveIcon);
async clickOnIntSaveIcon(): Promise<void> {
const saveIcon: ElementFinder = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
await BrowserActions.click(saveIcon);
}
enterIntField(text) {
BrowserVisibility.waitUntilElementIsVisible(this.intField);
BrowserActions.clearSendKeys(this.intField, text);
return this;
async enterIntField(text): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
await BrowserActions.clearSendKeys(this.intField, text);
}
getIntFieldText() {
const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
getIntFieldText(): Promise<string> {
const textField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
return BrowserActions.getText(textField);
}
getErrorInt() {
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
getErrorInt(): Promise<string> {
const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
return BrowserActions.getText(errorElement);
}
clickOnFloatField() {
const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
BrowserActions.click(toggleText);
BrowserVisibility.waitUntilElementIsVisible(this.floatField);
return this;
async clickOnFloatField(): Promise<void> {
const toggleText: ElementFinder = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
await BrowserActions.click(toggleText);
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
}
clickOnFloatClearIcon() {
const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`));
BrowserActions.click(clearIcon);
async clickOnFloatClearIcon(): Promise<void> {
const clearIcon: ElementFinder = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`));
await BrowserActions.click(clearIcon);
}
clickOnFloatSaveIcon() {
const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`));
BrowserActions.click(saveIcon);
async clickOnFloatSaveIcon(): Promise<void> {
const saveIcon: ElementFinder = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`));
await BrowserActions.click(saveIcon);
}
enterFloatField(text) {
BrowserVisibility.waitUntilElementIsVisible(this.floatField);
BrowserActions.clearSendKeys(this.floatField, text);
return this;
async enterFloatField(text): Promise<void> {
await BrowserActions.clearSendKeys(this.floatField, text);
}
getFloatFieldText() {
const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
getFloatFieldText(): Promise<string> {
const textField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
return BrowserActions.getText(textField);
}
getErrorFloat() {
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
getErrorFloat(): Promise<string> {
const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
return BrowserActions.getText(errorElement);
}
setName(name) {
BrowserVisibility.waitUntilElementIsVisible(this.nameInputField);
this.nameInputField.sendKeys(name);
return this;
async setName(name: string): Promise<void> {
await BrowserActions.clearSendKeys(this.nameInputField, name);
}
setValue(value) {
BrowserVisibility.waitUntilElementIsVisible(this.valueInputField);
this.valueInputField.sendKeys(value);
return this;
async setValue(value): Promise<void> {
await BrowserActions.clearSendKeys(this.valueInputField, value);
}
waitForOutput() {
BrowserVisibility.waitUntilElementIsVisible(this.consoleLog);
return this;
async waitForOutput(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.consoleLog);
}
getOutputText(index) {
getOutputText(index: number): Promise<string> {
return BrowserActions.getText(this.consoleLog.all(by.css('p')).get(index));
}
deletePairsValues() {
BrowserActions.click(this.deleteButton);
return this;
async deletePairsValues(): Promise<void> {
await BrowserActions.click(this.deleteButton);
}
clickSelectBox() {
BrowserActions.click(this.select);
BrowserVisibility.waitUntilElementIsVisible(this.listContent);
async clickSelectBox(): Promise<void> {
await BrowserActions.click(this.select);
await BrowserVisibility.waitUntilElementIsVisible(this.listContent);
}
checkboxClick() {
BrowserActions.click(this.checkbox);
async checkboxClick(): Promise<void> {
await BrowserActions.click(this.checkbox);
}
selectValueFromComboBox(index) {
async selectValueFromComboBox(index): Promise<void> {
const value: ElementFinder = element.all(by.className(this.selectValue)).get(index);
BrowserActions.click(value);
return this;
await BrowserActions.click(value);
}
disableEdit() {
BrowserVisibility.waitUntilElementIsVisible(this.editableSwitch);
async disableEdit(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.editableSwitch);
this.editableSwitch.getAttribute('class').then((check) => {
if (check.indexOf('mat-checked') > -1) {
this.editableSwitch.click();
expect(this.editableSwitch.getAttribute('class')).not.toContain('mat-checked');
}
});
const check = await this.editableSwitch.getAttribute('class');
if (check.indexOf('mat-checked') > -1) {
await BrowserActions.click(this.editableSwitch);
await expect(await this.editableSwitch.getAttribute('class')).not.toContain('mat-checked');
}
}
}
+24 -26
View File
@@ -15,59 +15,57 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { element, by, ElementFinder, ElementArrayFinder } from 'protractor';
import { TabsPage } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class CommentsPage {
tabsPage = new TabsPage();
numberOfComments = element(by.id('comment-header'));
commentUserIcon = element.all(by.id('comment-user-icon'));
commentUserName = element.all(by.id('comment-user'));
commentMessage = element.all(by.id('comment-message'));
commentTime = element.all(by.id('comment-time'));
commentInput = element(by.id('comment-input'));
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
tabsPage: TabsPage = new TabsPage();
numberOfComments: ElementFinder = element(by.id('comment-header'));
commentUserIcon: ElementArrayFinder = element.all(by.id('comment-user-icon'));
commentUserName: ElementArrayFinder = element.all(by.id('comment-user'));
commentMessage: ElementArrayFinder = element.all(by.id('comment-message'));
commentTime: ElementArrayFinder = element.all(by.id('comment-time'));
commentInput: ElementFinder = element(by.id('comment-input'));
addCommentButton: ElementFinder = element(by.css("[data-automation-id='comments-input-add']"));
getTotalNumberOfComments() {
async getTotalNumberOfComments(): Promise<string> {
return BrowserActions.getText(this.numberOfComments);
}
checkUserIconIsDisplayed(position) {
BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon.first());
return this.commentUserIcon.get(position);
async checkUserIconIsDisplayed(position): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon.first());
}
getUserName(position) {
getUserName(position): Promise<string> {
return BrowserActions.getText(this.commentUserName.get(position));
}
getMessage(position) {
getMessage(position): Promise<string> {
return BrowserActions.getText(this.commentMessage.get(position));
}
getTime(position) {
getTime(position): Promise<string> {
return BrowserActions.getText(this.commentTime.get(position));
}
checkCommentInputIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotVisible(this.commentInput);
async checkCommentInputIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.commentInput);
}
addComment(comment) {
BrowserVisibility.waitUntilElementIsVisible(this.commentInput);
this.commentInput.sendKeys(comment);
BrowserActions.click(this.addCommentButton);
async addComment(comment): Promise<void> {
await BrowserActions.clearSendKeys(this.commentInput, comment);
await BrowserActions.click(this.addCommentButton);
}
checkCommentsTabIsSelected() {
this.tabsPage.checkTabIsSelectedByTitle('Comments');
async checkCommentsTabIsSelected(): Promise<void> {
await this.tabsPage.checkTabIsSelectedByTitle('Comments');
}
checkCommentInputIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.commentInput);
async checkCommentInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.commentInput);
}
}
+16 -19
View File
@@ -15,35 +15,32 @@
* limitations under the License.
*/
import { element, by, browser } from 'protractor';
import { element, by, browser, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class ConfigEditorPage {
textField = element(by.css('#adf-form-config-editor div.overflow-guard > textarea'));
textField: ElementFinder = element(by.css('#adf-form-config-editor div.overflow-guard > textarea'));
enterConfiguration(text) {
BrowserVisibility.waitUntilElementIsVisible(this.textField);
this.textField.sendKeys(text);
return this;
async enterConfiguration(text): Promise<void> {
await BrowserActions.clearSendKeys(this.textField, text);
}
clickSaveButton() {
const saveButton = element(by.id('adf-form-config-save'));
BrowserActions.click(saveButton);
async clickSaveButton(): Promise<void> {
const saveButton: ElementFinder = element(by.id('adf-form-config-save'));
await BrowserActions.click(saveButton);
}
clickClearButton() {
BrowserVisibility.waitUntilElementIsVisible(this.textField);
const clearButton = element(by.id('adf-form-config-clear'));
BrowserActions.click(clearButton);
async clickClearButton(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
const clearButton: ElementFinder = element(by.id('adf-form-config-clear'));
await BrowserActions.click(clearButton);
}
enterBulkConfiguration(text) {
this.clickClearButton();
BrowserVisibility.waitUntilElementIsVisible(this.textField);
browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + JSON.stringify(text) + '`)');
this.clickSaveButton();
async enterBulkConfiguration(text): Promise<void> {
await this.clickClearButton();
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
await browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + JSON.stringify(text) + '`)');
await this.clickSaveButton();
}
}
@@ -15,32 +15,32 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class BreadCrumbDropdownPage {
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
breadCrumb: ElementFinder = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
breadCrumbDropdown = element(by.css(`div[class*='mat-select-panel']`));
breadCrumbDropdown: ElementFinder = element(by.css(`div[class*='mat-select-panel']`));
currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
choosePath(pathName) {
async choosePath(pathName): Promise<void> {
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
pathName));
BrowserActions.click(path);
await BrowserActions.click(path);
}
clickParentFolder() {
BrowserActions.click(this.parentFolder);
async clickParentFolder(): Promise<void> {
await BrowserActions.click(this.parentFolder);
}
checkBreadCrumbDropdownIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
async checkBreadCrumbDropdownIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
}
getTextOfCurrentFolder() {
async getTextOfCurrentFolder(): Promise<string> {
return BrowserActions.getText(this.currentFolder);
}
}
@@ -15,16 +15,16 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { BrowserActions } from '@alfresco/adf-testing';
export class BreadCrumbPage {
breadCrumb = element(by.css(`adf-breadcrumb nav[data-automation-id='breadcrumb']`));
breadCrumb: ElementFinder = element(by.css(`adf-breadcrumb nav[data-automation-id='breadcrumb']`));
chooseBreadCrumb(breadCrumbItem) {
async chooseBreadCrumb(breadCrumbItem): Promise<void> {
const path = this.breadCrumb.element(by.css(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`));
BrowserActions.click(path);
await BrowserActions.click(path);
}
}
+40 -44
View File
@@ -15,76 +15,72 @@
* limitations under the License.
*/
import { element, by, protractor } from 'protractor';
import { element, by, ElementFinder, ElementArrayFinder, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class TreeViewPage {
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
nodeIdInput = element(by.css('input[placeholder="Node Id"]'));
noNodeMessage = element(by.id('adf-tree-view-missing-node'));
nodesOnPage = element.all(by.css('mat-tree-node'));
treeViewTitle: ElementFinder = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
nodeIdInput: ElementFinder = element(by.css('input[placeholder="Node Id"]'));
noNodeMessage: ElementFinder = element(by.id('adf-tree-view-missing-node'));
nodesOnPage: ElementArrayFinder = element.all(by.css('mat-tree-node'));
checkTreeViewTitleIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
async checkTreeViewTitleIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
}
getNodeId() {
BrowserVisibility.waitUntilElementIsVisible(this.nodeIdInput);
return this.nodeIdInput.getAttribute('value');
async getNodeId(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.nodeIdInput);
return await this.nodeIdInput.getAttribute('value');
}
clickNode(nodeName) {
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
return BrowserActions.click(node);
async clickNode(nodeName): Promise<void> {
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
await BrowserActions.click(node);
}
checkNodeIsDisplayedAsClosed(nodeName) {
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
return BrowserVisibility.waitUntilElementIsVisible(node);
async checkNodeIsDisplayedAsClosed(nodeName): Promise<void> {
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
await BrowserVisibility.waitUntilElementIsVisible(node);
}
checkNodeIsDisplayedAsOpen(nodeName) {
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
return BrowserVisibility.waitUntilElementIsVisible(node);
async checkNodeIsDisplayedAsOpen(nodeName): Promise<void> {
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
await BrowserVisibility.waitUntilElementIsVisible(node);
}
checkClickedNodeName(nodeName) {
const clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
return BrowserVisibility.waitUntilElementIsVisible(clickedNode);
async checkClickedNodeName(nodeName): Promise<void> {
const clickedNode: ElementFinder = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
await BrowserVisibility.waitUntilElementIsVisible(clickedNode);
}
checkNodeIsNotDisplayed(nodeName) {
const node = element(by.id('' + nodeName + '-tree-child-node'));
return BrowserVisibility.waitUntilElementIsNotVisible(node);
async checkNodeIsNotDisplayed(nodeName): Promise<void> {
const node: ElementFinder = element(by.id('' + nodeName + '-tree-child-node'));
await BrowserVisibility.waitUntilElementIsNotVisible(node);
}
clearNodeIdInput() {
BrowserVisibility.waitUntilElementIsVisible(this.nodeIdInput);
this.nodeIdInput.getAttribute('value').then((value) => {
for (let i = value.length; i >= 0; i--) {
this.nodeIdInput.sendKeys(protractor.Key.BACK_SPACE);
}
});
async clearNodeIdInput(): Promise<void> {
await BrowserActions.click(this.nodeIdInput);
await BrowserActions.clearWithBackSpace(this.nodeIdInput);
}
checkNoNodeIdMessageIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.noNodeMessage);
async checkNoNodeIdMessageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noNodeMessage);
}
addNodeId(nodeId) {
BrowserActions.click(this.nodeIdInput);
this.nodeIdInput.clear();
this.nodeIdInput.sendKeys(nodeId + ' ');
this.nodeIdInput.sendKeys(protractor.Key.BACK_SPACE);
async addNodeId(nodeId): Promise<void> {
await BrowserActions.click(this.nodeIdInput);
await BrowserActions.clearSendKeys(this.nodeIdInput, nodeId);
await this.nodeIdInput.sendKeys('a');
await this.nodeIdInput.sendKeys(protractor.Key.BACK_SPACE);
}
checkErrorMessageIsDisplayed() {
const clickedNode = element(by.cssContainingText('span', 'An Error Occurred '));
return BrowserVisibility.waitUntilElementIsVisible(clickedNode);
async checkErrorMessageIsDisplayed(): Promise<void> {
const clickedNode: ElementFinder = element(by.cssContainingText('span', 'An Error Occurred '));
await BrowserVisibility.waitUntilElementIsVisible(clickedNode);
}
getTotalNodes() {
return this.nodesOnPage.count();
async getTotalNodes() {
return await this.nodesOnPage.count();
}
}
+316 -390
View File
@@ -19,7 +19,7 @@ import { FolderDialog } from './dialog/folderDialog';
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
import { FormControllersPage } from '@alfresco/adf-testing';
import { DropActions } from '../../actions/drop.actions';
import { by, element, protractor, $$, browser } from 'protractor';
import { by, element, protractor, $$, browser, ElementFinder } from 'protractor';
import path = require('path');
import { BrowserVisibility, DocumentListPage, BrowserActions, DateUtil } from '@alfresco/adf-testing';
@@ -35,166 +35,158 @@ export class ContentServicesPage {
created: 'Created'
};
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
formControllersPage = new FormControllersPage();
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
createFolderDialog = new FolderDialog();
createLibraryDialog = new CreateLibraryDialog();
dragAndDropAction = new DropActions();
uploadBorder = element(by.id('document-list-container'));
contentServices = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
editFolderButton = element(by.css('button[data-automation-id="edit-folder"]'));
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
activeBreadcrumb = element(by.css('div[class*="active"]'));
contentList: DocumentListPage = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
formControllersPage: FormControllersPage = new FormControllersPage();
createFolderDialog: FolderDialog = new FolderDialog();
createLibraryDialog: CreateLibraryDialog = new CreateLibraryDialog();
dragAndDropAction: DropActions = new DropActions();
multipleFileUploadToggle: ElementFinder = element(by.id('adf-document-list-enable-drop-files'));
uploadBorder: ElementFinder = element(by.id('document-list-container'));
contentServices: ElementFinder = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
currentFolder: ElementFinder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
createFolderButton: ElementFinder = element(by.css('button[data-automation-id="create-new-folder"]'));
editFolderButton: ElementFinder = element(by.css('button[data-automation-id="edit-folder"]'));
createLibraryButton: ElementFinder = element(by.css('button[data-automation-id="create-new-library"]'));
activeBreadcrumb: ElementFinder = element(by.css('div[class*="active"]'));
tooltip = by.css('div[class*="--text adf-full-width"] span');
uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
emptyPagination = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
dragAndDrop = element.all(by.css('adf-upload-drag-area div')).first();
nameHeader = element(by.css('div[data-automation-id="auto_id_name"] > span'));
sizeHeader = element(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span'));
createdByHeader = element(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span'));
createdHeader = element(by.css('div[data-automation-id="auto_id_createdAt"] > span'));
recentFiles = element(by.css('.adf-container-recent'));
recentFilesExpanded = element(by.css('.adf-container-recent mat-expansion-panel-header.mat-expanded'));
recentFilesClosed = element(by.css('.adf-container-recent mat-expansion-panel-header'));
recentFileIcon = element(by.css('.adf-container-recent mat-expansion-panel-header mat-icon'));
documentListSpinner = element(by.css('mat-progress-spinner'));
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
emptyRecent = element(by.css('.adf-container-recent .adf-empty-list__title'));
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
cardViewContainer = element(by.css('div.adf-document-list-container div.adf-datatable-card'));
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
uploadFileButton: ElementFinder = element(by.css('.adf-upload-button-file-container button'));
uploadFileButtonInput: ElementFinder = element(by.css('input[data-automation-id="upload-single-file"]'));
uploadMultipleFileButton: ElementFinder = element(by.css('input[data-automation-id="upload-multiple-files"]'));
uploadFolderButton: ElementFinder = element(by.css('input[data-automation-id="uploadFolder"]'));
errorSnackBar: ElementFinder = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
emptyPagination: ElementFinder = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
dragAndDrop: ElementFinder = element.all(by.css('adf-upload-drag-area div')).first();
nameHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_name"] > span'));
sizeHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span'));
createdByHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span'));
createdHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_createdAt"] > span'));
recentFiles: ElementFinder = element(by.css('.adf-container-recent'));
recentFilesExpanded: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header.mat-expanded'));
recentFilesClosed: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header'));
recentFileIcon: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header mat-icon'));
emptyFolder: ElementFinder = element(by.css('.adf-empty-folder-this-space-is-empty'));
emptyFolderImage: ElementFinder = element(by.css('.adf-empty-folder-image'));
emptyRecent: ElementFinder = element(by.css('.adf-container-recent .adf-empty-list__title'));
gridViewButton: ElementFinder = element(by.css('button[data-automation-id="document-list-grid-view"]'));
cardViewContainer: ElementFinder = element(by.css('div.adf-document-list-container div.adf-datatable-card'));
shareNodeButton: ElementFinder = element(by.cssContainingText('mat-icon', ' share '));
nameColumnHeader = 'name';
createdByColumnHeader = 'createdByUser.displayName';
createdColumnHeader = 'createdAt';
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
siteListDropdown = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
downloadButton = element(by.css('button[title="Download"]'));
favoriteButton = element(by.css('button[data-automation-id="favorite"]'));
markedFavorite = element(by.cssContainingText( 'button[data-automation-id="favorite"] mat-icon', 'star'));
notMarkedFavorite = element(by.cssContainingText( 'button[data-automation-id="favorite"] mat-icon', 'star_border'));
multiSelectToggle = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
deleteContentElement: ElementFinder = element(by.css('button[data-automation-id*="DELETE"]'));
metadataAction: ElementFinder = element(by.css('button[data-automation-id*="METADATA"]'));
versionManagerAction: ElementFinder = element(by.css('button[data-automation-id*="VERSIONS"]'));
moveContentElement: ElementFinder = element(by.css('button[data-automation-id*="MOVE"]'));
copyContentElement: ElementFinder = element(by.css('button[data-automation-id*="COPY"]'));
lockContentElement: ElementFinder = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
downloadContent: ElementFinder = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
siteListDropdown: ElementFinder = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
downloadButton: ElementFinder = element(by.css('button[title="Download"]'));
favoriteButton: ElementFinder = element(by.css('button[data-automation-id="favorite"]'));
markedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
notMarkedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
pressContextMenuActionNamed(actionName) {
BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
async pressContextMenuActionNamed(actionName): Promise<void> {
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
}
checkContextActionIsVisible(actionName) {
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
BrowserVisibility.waitUntilElementIsVisible(actionButton);
return actionButton;
async checkContextActionIsVisible(actionName) {
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
}
checkContentActionIsEnabled(actionName) {
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
BrowserVisibility.waitUntilElementIsVisible(actionButton);
async isContextActionEnabled(actionName): Promise<boolean> {
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
return actionButton.isEnabled();
}
getDocumentList() {
getDocumentList(): DocumentListPage {
return this.contentList;
}
closeActionContext() {
BrowserActions.closeMenuAndDialogs();
return this;
async closeActionContext(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
}
checkLockedIcon(content) {
return this.contentList.checkLockedIcon(content);
async checkLockedIcon(content): Promise<void> {
return await this.contentList.checkLockedIcon(content);
}
checkUnlockedIcon(content) {
return this.contentList.checkUnlockedIcon(content);
async checkUnlockedIcon(content): Promise<void> {
return await this.contentList.checkUnlockedIcon(content);
}
checkDeleteIsDisabled(content) {
this.contentList.clickOnActionMenu(content);
this.waitForContentOptions();
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
async checkDeleteIsDisabled(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
const disabledDelete: ElementFinder = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
}
deleteContent(content) {
this.contentList.clickOnActionMenu(content);
this.waitForContentOptions();
BrowserActions.click(this.deleteContentElement);
async deleteContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.deleteContentElement);
}
metadataContent(content) {
this.contentList.clickOnActionMenu(content);
this.waitForContentOptions();
BrowserActions.click(this.metadataAction);
async metadataContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.metadataAction);
}
versionManagerContent(content) {
this.contentList.clickOnActionMenu(content);
this.waitForContentOptions();
BrowserActions.click(this.versionManagerAction);
async versionManagerContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await this.waitForContentOptions();
await BrowserActions.click(this.versionManagerAction);
}
copyContent(content) {
this.contentList.clickOnActionMenu(content);
BrowserActions.click(this.copyContentElement);
async copyContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.copyContentElement);
}
lockContent(content) {
this.contentList.clickOnActionMenu(content);
BrowserActions.click(this.lockContentElement);
async lockContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.lockContentElement);
}
waitForContentOptions() {
BrowserVisibility.waitUntilElementIsVisible(this.copyContentElement);
BrowserVisibility.waitUntilElementIsVisible(this.moveContentElement);
BrowserVisibility.waitUntilElementIsVisible(this.deleteContentElement);
BrowserVisibility.waitUntilElementIsVisible(this.downloadContent);
async waitForContentOptions(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.copyContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.moveContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.deleteContentElement);
await BrowserVisibility.waitUntilElementIsVisible(this.downloadContent);
}
clickFileHyperlink(fileName) {
async clickFileHyperlink(fileName): Promise<void> {
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
BrowserActions.click(hyperlink);
return this;
await BrowserActions.click(hyperlink);
}
checkFileHyperlinkIsEnabled(fileName) {
async checkFileHyperlinkIsEnabled(fileName): Promise<void> {
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
BrowserVisibility.waitUntilElementIsVisible(hyperlink);
return this;
await BrowserVisibility.waitUntilElementIsVisible(hyperlink);
}
clickHyperlinkNavigationToggle() {
const hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
BrowserActions.click(hyperlinkToggle);
return this;
async clickHyperlinkNavigationToggle(): Promise<void> {
const hyperlinkToggle: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
await BrowserActions.click(hyperlinkToggle);
}
enableDropFilesInAFolder() {
this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
return this;
async enableDropFilesInAFolder(): Promise<void> {
await this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
}
disableDropFilesInAFolder() {
browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
return this;
async disableDropFilesInAFolder(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
await this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
}
getElementsDisplayedId() {
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
async getElementsDisplayedId() {
return await this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
}
checkElementsDateSortedAsc(elements) {
@@ -229,459 +221,393 @@ export class ContentServicesPage {
return sorted;
}
getContentList() {
return this.contentList;
async checkRecentFileToBeShowed() {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
}
checkRecentFileToBeShowed() {
BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
async expandRecentFiles(): Promise<void> {
await this.checkRecentFileToBeShowed();
await this.checkRecentFileToBeClosed();
await BrowserActions.click(this.recentFilesClosed);
await this.checkRecentFileToBeOpened();
}
expandRecentFiles() {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeClosed();
BrowserActions.click(this.recentFilesClosed);
this.checkRecentFileToBeOpened();
async closeRecentFiles(): Promise<void> {
await this.checkRecentFileToBeShowed();
await this.checkRecentFileToBeOpened();
await BrowserActions.click(this.recentFilesExpanded);
await this.checkRecentFileToBeClosed();
}
closeRecentFiles() {
this.checkRecentFileToBeShowed();
this.checkRecentFileToBeOpened();
BrowserActions.click(this.recentFilesExpanded);
this.checkRecentFileToBeClosed();
async checkRecentFileToBeClosed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
}
checkRecentFileToBeClosed() {
BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
async checkRecentFileToBeOpened(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
}
checkRecentFileToBeOpened() {
BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
async getRecentFileIcon(): Promise<string> {
return await BrowserActions.getText(this.recentFileIcon);
}
async getRecentFileIcon() {
return BrowserActions.getText(this.recentFileIcon);
async checkAcsContainer(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
}
checkAcsContainer() {
return BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
}
async waitForTableBody() {
async waitForTableBody(): Promise<void> {
await this.contentList.waitForTableBody();
}
goToDocumentList() {
async goToDocumentList(): Promise<void> {
const navigationBarPage = new NavigationBarPage();
navigationBarPage.clickContentServicesButton();
return this;
await navigationBarPage.clickContentServicesButton();
}
clickOnContentServices() {
BrowserActions.click(this.contentServices);
async clickOnContentServices(): Promise<void> {
await BrowserActions.click(this.contentServices);
}
numberOfResultsDisplayed() {
return this.contentList.dataTablePage().numberOfRows();
async numberOfResultsDisplayed(): Promise<number> {
return await this.contentList.dataTablePage().numberOfRows();
}
currentFolderName() {
const deferred = protractor.promise.defer();
BrowserVisibility.waitUntilElementIsVisible(this.currentFolder);
this.currentFolder.getText().then(function (result) {
deferred.fulfill(result);
});
return deferred.promise;
async currentFolderName(): Promise<string> {
return await BrowserActions.getText(this.currentFolder);
}
getAllRowsNameColumn() {
return this.contentList.getAllRowsColumnValues(this.columns.name);
async getAllRowsNameColumn(): Promise<any> {
return await this.contentList.getAllRowsColumnValues(this.columns.name);
}
sortByName(sortOrder: string) {
return this.contentList.dataTable.sortByColumn(sortOrder, this.nameColumnHeader);
async sortByName(sortOrder: string): Promise<any> {
await this.contentList.dataTable.sortByColumn(sortOrder, this.nameColumnHeader);
}
sortByAuthor(sortOrder: string) {
return this.contentList.dataTable.sortByColumn(sortOrder, this.createdByColumnHeader);
async sortByAuthor(sortOrder: string): Promise<any> {
await this.contentList.dataTable.sortByColumn(sortOrder, this.createdByColumnHeader);
}
sortByCreated(sortOrder: string) {
return this.contentList.dataTable.sortByColumn(sortOrder, this.createdColumnHeader);
async sortByCreated(sortOrder: string): Promise<any> {
await this.contentList.dataTable.sortByColumn(sortOrder, this.createdColumnHeader);
}
sortAndCheckListIsOrderedByName(sortOrder: string) {
this.sortByName(sortOrder);
const deferred = protractor.promise.defer();
this.checkListIsSortedByNameColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
async sortAndCheckListIsOrderedByName(sortOrder: string): Promise<any> {
await this.sortByName(sortOrder);
return await this.checkListIsSortedByNameColumn(sortOrder);
}
async checkListIsSortedByNameColumn(sortOrder: string) {
async checkListIsSortedByNameColumn(sortOrder: string): Promise<any> {
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.name);
}
async checkListIsSortedByCreatedColumn(sortOrder: string) {
async checkListIsSortedByCreatedColumn(sortOrder: string): Promise<any> {
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.created);
}
async checkListIsSortedByAuthorColumn(sortOrder: string) {
async checkListIsSortedByAuthorColumn(sortOrder: string): Promise<any> {
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy);
}
async checkListIsSortedBySizeColumn(sortOrder: string) {
async checkListIsSortedBySizeColumn(sortOrder: string): Promise<any> {
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.size);
}
sortAndCheckListIsOrderedByAuthor(sortOrder: string) {
this.sortByAuthor(sortOrder);
const deferred = protractor.promise.defer();
this.checkListIsSortedByAuthorColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
async sortAndCheckListIsOrderedByAuthor(sortOrder: string): Promise<any> {
await this.sortByAuthor(sortOrder);
return await this.checkListIsSortedByAuthorColumn(sortOrder);
}
sortAndCheckListIsOrderedByCreated(sortOrder: string) {
this.sortByCreated(sortOrder);
const deferred = protractor.promise.defer();
this.checkListIsSortedByCreatedColumn(sortOrder).then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
async sortAndCheckListIsOrderedByCreated(sortOrder: string): Promise<any> {
await this.sortByCreated(sortOrder);
return await this.checkListIsSortedByCreatedColumn(sortOrder);
}
doubleClickRow(nodeName) {
this.contentList.doubleClickRow(nodeName);
return this;
async doubleClickRow(nodeName): Promise<void> {
await this.contentList.doubleClickRow(nodeName);
}
clickOnCreateNewFolder() {
BrowserActions.click(this.createFolderButton);
return this;
async clickOnCreateNewFolder(): Promise<void> {
await BrowserActions.click(this.createFolderButton);
}
clickOnFavoriteButton() {
BrowserActions.click(this.favoriteButton);
return this;
async clickOnFavoriteButton(): Promise<void> {
await BrowserActions.click(this.favoriteButton);
}
checkIsMarkedFavorite() {
BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
return this;
async checkIsMarkedFavorite(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
}
checkIsNotMarkedFavorite() {
BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
return this;
async checkIsNotMarkedFavorite(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
}
clickOnEditFolder() {
BrowserActions.click(this.editFolderButton);
return this;
async clickOnEditFolder(): Promise<void> {
await BrowserActions.click(this.editFolderButton);
}
checkEditFolderButtonIsEnabled() {
async isEditFolderButtonEnabled(): Promise<boolean> {
return this.editFolderButton.isEnabled();
}
openCreateLibraryDialog() {
BrowserActions.click(this.createLibraryButton);
this.createLibraryDialog.waitForDialogToOpen();
return this.createLibraryDialog;
async openCreateLibraryDialog(): Promise<void> {
await BrowserActions.click(this.createLibraryButton);
await this.createLibraryDialog.waitForDialogToOpen();
}
createNewFolder(folder) {
this.clickOnCreateNewFolder();
this.createFolderDialog.addFolderName(folder);
browser.sleep(200);
this.createFolderDialog.clickOnCreateUpdateButton();
return this;
async createNewFolder(folder): Promise<void> {
await this.clickOnCreateNewFolder();
await this.createFolderDialog.addFolderName(folder);
await this.createFolderDialog.clickOnCreateUpdateButton();
}
checkContentIsDisplayed(content) {
this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
return this;
async checkContentIsDisplayed(content): Promise<void> {
await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
}
checkContentsAreDisplayed(content) {
async checkContentsAreDisplayed(content): Promise<void> {
for (let i = 0; i < content.length; i++) {
this.checkContentIsDisplayed(content[i]);
await this.checkContentIsDisplayed(content[i]);
}
return this;
}
checkContentIsNotDisplayed(content) {
this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
return this;
async checkContentIsNotDisplayed(content): Promise<void> {
await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
}
getActiveBreadcrumb() {
BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
return this.activeBreadcrumb.getAttribute('title');
async getActiveBreadcrumb(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
return await this.activeBreadcrumb.getAttribute('title');
}
uploadFile(fileLocation) {
this.checkUploadButton();
this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
this.checkUploadButton();
return this;
async uploadFile(fileLocation): Promise<void> {
await this.checkUploadButton();
await this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
await this.checkUploadButton();
}
uploadMultipleFile(files) {
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
async uploadMultipleFile(files): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
let allFiles = path.resolve(path.join(browser.params.testConfig.main.rootPath, files[0]));
for (let i = 1; i < files.length; i++) {
allFiles = allFiles + '\n' + path.resolve(path.join(browser.params.testConfig.main.rootPath, files[i]));
}
this.uploadMultipleFileButton.sendKeys(allFiles);
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
return this;
await this.uploadMultipleFileButton.sendKeys(allFiles);
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
}
uploadFolder(folder) {
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folder)));
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
return this;
async uploadFolder(folder): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folder)));
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
}
getSingleFileButtonTooltip() {
BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
return this.uploadFileButtonInput.getAttribute('title');
async getSingleFileButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
return await this.uploadFileButtonInput.getAttribute('title');
}
getMultipleFileButtonTooltip() {
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
return this.uploadMultipleFileButton.getAttribute('title');
async getMultipleFileButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
return await this.uploadMultipleFileButton.getAttribute('title');
}
getFolderButtonTooltip() {
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
return this.uploadFolderButton.getAttribute('title');
async getFolderButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
return await this.uploadFolderButton.getAttribute('title');
}
checkUploadButton() {
BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
return this;
async checkUploadButton(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
}
uploadButtonIsEnabled() {
return this.uploadFileButton.isEnabled();
async uploadButtonIsEnabled(): Promise<boolean> {
return await this.uploadFileButton.isEnabled();
}
getErrorMessage() {
BrowserVisibility.waitUntilElementIsVisible(this.errorSnackBar);
const deferred = protractor.promise.defer();
this.errorSnackBar.getText().then(function (text) {
deferred.fulfill(text);
});
return deferred.promise;
async getErrorMessage(): Promise<string> {
return BrowserActions.getText(this.errorSnackBar);
}
enableInfiniteScrolling() {
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
BrowserActions.click(infiniteScrollButton);
return this;
async enableInfiniteScrolling(): Promise<void> {
const infiniteScrollButton: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
await BrowserActions.click(infiniteScrollButton);
}
enableCustomPermissionMessage() {
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
BrowserActions.click(customPermissionMessage);
return this;
async enableCustomPermissionMessage(): Promise<void> {
const customPermissionMessage: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
await BrowserActions.click(customPermissionMessage);
}
enableMediumTimeFormat() {
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
BrowserActions.click(mediumTimeFormat);
return this;
async enableMediumTimeFormat(): Promise<void> {
const mediumTimeFormat: ElementFinder = element(by.css('#enableMediumTimeFormat'));
await BrowserActions.click(mediumTimeFormat);
}
enableThumbnails() {
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
BrowserActions.click(thumbnailSlide);
return this;
async enableThumbnails(): Promise<void> {
const thumbnailSlide: ElementFinder = element(by.id('adf-thumbnails-upload-switch'));
await BrowserActions.click(thumbnailSlide);
}
checkPaginationIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.emptyPagination);
async checkPaginationIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyPagination);
}
getDocumentListRowNumber() {
const documentList = element(by.css('adf-upload-drag-area adf-document-list'));
BrowserVisibility.waitUntilElementIsVisible(documentList);
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
async getDocumentListRowNumber(): Promise<number> {
const documentList: ElementFinder = element(by.css('adf-upload-drag-area adf-document-list'));
await BrowserVisibility.waitUntilElementIsVisible(documentList);
return await $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
}
checkColumnNameHeader() {
BrowserVisibility.waitUntilElementIsVisible(this.nameHeader);
async checkColumnNameHeader(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.nameHeader);
}
checkColumnSizeHeader() {
BrowserVisibility.waitUntilElementIsVisible(this.sizeHeader);
async checkColumnSizeHeader(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sizeHeader);
}
checkColumnCreatedByHeader() {
BrowserVisibility.waitUntilElementIsVisible(this.createdByHeader);
async checkColumnCreatedByHeader(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.createdByHeader);
}
checkColumnCreatedHeader() {
BrowserVisibility.waitUntilElementIsVisible(this.createdHeader);
async checkColumnCreatedHeader(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.createdHeader);
}
checkDragAndDropDIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop);
async checkDragAndDropDIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop);
}
dragAndDropFile(file) {
this.checkDragAndDropDIsDisplayed();
this.dragAndDropAction.dropFile(this.dragAndDrop, file);
async dragAndDropFile(file): Promise<void> {
await this.checkDragAndDropDIsDisplayed();
await this.dragAndDropAction.dropFile(this.dragAndDrop, file);
}
dragAndDropFolder(folder) {
this.checkDragAndDropDIsDisplayed();
this.dragAndDropAction.dropFolder(this.dragAndDrop, folder);
async dragAndDropFolder(folder): Promise<void> {
await this.checkDragAndDropDIsDisplayed();
await this.dragAndDropAction.dropFolder(this.dragAndDrop, folder);
}
checkLockIsDisplayedForElement(name) {
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
BrowserVisibility.waitUntilElementIsVisible(lockButton);
async checkLockIsDisplayedForElement(name): Promise<void> {
const lockButton: ElementFinder = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
}
getColumnValueForRow(file, columnName) {
return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
async getColumnValueForRow(file, columnName): Promise<string> {
return await this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
}
async getStyleValueForRowText(rowName, styleName) {
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
BrowserVisibility.waitUntilElementIsVisible(row);
return row.getCssValue(styleName);
async getStyleValueForRowText(rowName, styleName): Promise<string> {
const row: ElementFinder = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
await BrowserVisibility.waitUntilElementIsVisible(row);
return await row.getCssValue(styleName);
}
checkSpinnerIsShowed() {
BrowserVisibility.waitUntilElementIsPresent(this.documentListSpinner);
async checkEmptyFolderTextToBe(text): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
await expect(await this.emptyFolder.getText()).toContain(text);
}
checkEmptyFolderTextToBe(text) {
BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
expect(this.emptyFolder.getText()).toContain(text);
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
await expect(await this.emptyFolderImage.getAttribute('src')).toContain(url);
}
checkEmptyFolderImageUrlToContain(url) {
BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
expect(this.emptyFolderImage.getAttribute('src')).toContain(url);
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
}
checkEmptyRecentFileIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
async getRowIconImageUrl(fileName): Promise<string> {
const iconRow: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
await BrowserVisibility.waitUntilElementIsVisible(iconRow);
return await iconRow.getAttribute('src');
}
checkIconForRowIsDisplayed(fileName) {
const iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
BrowserVisibility.waitUntilElementIsVisible(iconRow);
return iconRow;
async checkGridViewButtonIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton);
}
async getRowIconImageUrl(fileName) {
const iconRow = this.checkIconForRowIsDisplayed(fileName);
return iconRow.getAttribute('src');
async clickGridViewButton(): Promise<void> {
await this.checkGridViewButtonIsVisible();
await BrowserActions.click(this.gridViewButton);
}
checkGridViewButtonIsVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton);
async checkCardViewContainerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
}
clickGridViewButton() {
this.checkGridViewButtonIsVisible();
BrowserActions.click(this.gridViewButton);
async getCardElementShowedInPage(): Promise<number> {
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
return $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
}
checkCardViewContainerIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
async getDocumentCardIconForElement(elementName): Promise<string> {
const elementIcon: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
return await elementIcon.getAttribute('src');
}
getCardElementShowedInPage() {
this.checkCardViewContainerIsDisplayed();
const actualCards = $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
return actualCards;
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
const elementProperty: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
}
getDocumentCardIconForElement(elementName) {
const elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
return elementIcon.getAttribute('src');
}
checkDocumentCardPropertyIsShowed(elementName, propertyName) {
const elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
BrowserVisibility.waitUntilElementIsVisible(elementProperty);
}
getAttributeValueForElement(elementName, propertyName) {
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
return BrowserActions.getText(elementSize);
return await BrowserActions.getText(elementSize);
}
checkMenuIsShowedForElementIndex(elementIndex) {
const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
BrowserVisibility.waitUntilElementIsVisible(elementMenu);
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
const elementMenu: ElementFinder = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
}
navigateToCardFolder(folderName) {
BrowserActions.closeMenuAndDialogs();
const folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
folderCard.click();
const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
BrowserVisibility.waitUntilElementIsVisible(folderSelected);
browser.actions().sendKeys(protractor.Key.ENTER).perform();
async navigateToCardFolder(folderName): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const folderCard: ElementFinder = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
await BrowserActions.click(folderCard);
const folderSelected: ElementFinder = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
getGridViewSortingDropdown() {
const sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
BrowserVisibility.waitUntilElementIsVisible(sortingDropdown);
return sortingDropdown;
async selectGridSortingFromDropdown(sortingChosen): Promise<void> {
const sortingDropdown: ElementFinder = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
await BrowserActions.click(sortingDropdown);
const optionToClick: ElementFinder = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
await BrowserActions.click(optionToClick);
}
selectGridSortingFromDropdown(sortingChosen) {
BrowserActions.closeMenuAndDialogs();
const dropdownSorting = this.getGridViewSortingDropdown();
BrowserActions.click(dropdownSorting);
const optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
BrowserActions.click(optionToClick);
}
checkRowIsDisplayed(rowName) {
async checkRowIsDisplayed(rowName): Promise<void> {
const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName);
BrowserVisibility.waitUntilElementIsVisible(row);
await BrowserVisibility.waitUntilElementIsVisible(row);
}
clickShareButton() {
BrowserActions.closeMenuAndDialogs();
BrowserActions.click(this.shareNodeButton);
async clickShareButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.shareNodeButton);
}
checkSelectedSiteIsDisplayed(siteName) {
BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
}
selectSite(siteName: string) {
BrowserActions.clickOnSelectDropdownOption(siteName, this.siteListDropdown);
return this;
async selectSite(siteName: string): Promise<void> {
await BrowserActions.clickOnSelectDropdownOption(siteName, this.siteListDropdown);
}
clickDownloadButton() {
BrowserActions.closeMenuAndDialogs();
BrowserActions.click(this.downloadButton);
async clickDownloadButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.downloadButton);
}
clickMultiSelectToggle() {
BrowserActions.closeMenuAndDialogs();
BrowserActions.click(this.multiSelectToggle);
async clickMultiSelectToggle() {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.multiSelectToggle);
}
getRowByName(rowName) {
getRowByName(rowName): ElementFinder {
return this.contentList.dataTable.getRow(this.columns.name, rowName);
}
+66 -67
View File
@@ -15,117 +15,116 @@
* limitations under the License.
*/
import { element, by, protractor } from 'protractor';
import { element, by, protractor, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class HeaderPage {
checkBox = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button'));
headerColor = element(by.css('option[value="primary"]'));
titleInput = element(by.css('input[name="title"]'));
iconInput = element(by.css('input[placeholder="URL path"]'));
hexColorInput = element(by.css('input[placeholder="hex color code"]'));
logoHyperlinkInput = element(by.css('input[placeholder="Redirect URL"]'));
logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]'));
positionStart = element.all(by.css('mat-radio-button[value="start"]')).first();
positionEnd = element.all(by.css('mat-radio-button[value="end"]')).first();
sideBarPositionRight = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end'));
sideBarPositionLeft = element(by.css('mat-sidenav.mat-drawer.mat-sidenav'));
checkBox: ElementFinder = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button'));
headerColor: ElementFinder = element(by.css('option[value="primary"]'));
titleInput: ElementFinder = element(by.css('input[name="title"]'));
iconInput: ElementFinder = element(by.css('input[placeholder="URL path"]'));
hexColorInput: ElementFinder = element(by.css('input[placeholder="hex color code"]'));
logoHyperlinkInput: ElementFinder = element(by.css('input[placeholder="Redirect URL"]'));
logoTooltipInput: ElementFinder = element(by.css('input[placeholder="Tooltip text"]'));
positionStart: ElementFinder = element.all(by.css('mat-radio-button[value="start"]')).first();
positionEnd: ElementFinder = element.all(by.css('mat-radio-button[value="end"]')).first();
sideBarPositionRight: ElementFinder = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end'));
sideBarPositionLeft: ElementFinder = element(by.css('mat-sidenav.mat-drawer.mat-sidenav'));
checkShowMenuCheckBoxIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.checkBox);
async checkShowMenuCheckBoxIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.checkBox);
}
checkChooseHeaderColourIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.headerColor);
async checkChooseHeaderColourIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.headerColor);
}
checkChangeTitleIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
async checkChangeTitleIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
}
checkChangeUrlPathIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
async checkChangeUrlPathIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
}
clickShowMenuButton() {
const checkBox = element(by.css('mat-checkbox'));
BrowserVisibility.waitUntilElementIsVisible(checkBox);
return checkBox.get(0).click();
async clickShowMenuButton(): Promise<void> {
const checkBox: ElementFinder = element(by.css('mat-checkbox'));
await BrowserActions.click(checkBox.get(0));
}
changeHeaderColor(color) {
const headerColor = element(by.css('option[value="' + color + '"]'));
BrowserActions.click(headerColor);
async changeHeaderColor(color): Promise<void> {
const headerColor: ElementFinder = element(by.css('option[value="' + color + '"]'));
await BrowserActions.click(headerColor);
}
checkAppTitle(name) {
const title = element(by.cssContainingText('.adf-app-title', name));
return BrowserVisibility.waitUntilElementIsVisible(title);
async checkAppTitle(name): Promise<void> {
const title: ElementFinder = element(by.cssContainingText('.adf-app-title', name));
await BrowserVisibility.waitUntilElementIsVisible(title);
}
addTitle(title) {
BrowserActions.click(this.titleInput);
this.titleInput.sendKeys(title);
this.titleInput.sendKeys(protractor.Key.ENTER);
async addTitle(title): Promise<void> {
await BrowserActions.click(this.titleInput);
await BrowserActions.clearSendKeys(this.titleInput, title);
await this.titleInput.sendKeys(protractor.Key.ENTER);
}
checkIconIsDisplayed(url) {
const icon = element(by.css('img[src="' + url + '"]'));
BrowserVisibility.waitUntilElementIsVisible(icon);
async checkIconIsDisplayed(url): Promise<void> {
const icon: ElementFinder = element(by.css('img[src="' + url + '"]'));
await BrowserVisibility.waitUntilElementIsVisible(icon);
}
addIcon(url) {
BrowserActions.click(this.iconInput);
this.iconInput.sendKeys(url);
this.iconInput.sendKeys(protractor.Key.ENTER);
async addIcon(url): Promise<void> {
await BrowserActions.click(this.iconInput);
await BrowserActions.clearSendKeys(this.iconInput, url);
await this.iconInput.sendKeys(protractor.Key.ENTER);
}
checkHexColorInputIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
async checkHexColorInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
}
checkLogoHyperlinkInputIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
async checkLogoHyperlinkInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
}
checkLogoTooltipInputIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
async checkLogoTooltipInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
}
addHexCodeColor(hexCode) {
BrowserActions.click(this.hexColorInput);
this.hexColorInput.sendKeys(hexCode);
return this.hexColorInput.sendKeys(protractor.Key.ENTER);
async addHexCodeColor(hexCode): Promise<void> {
await BrowserActions.click(this.hexColorInput);
await this.hexColorInput.sendKeys(hexCode);
await this.hexColorInput.sendKeys(protractor.Key.ENTER);
}
addLogoHyperlink(hyperlink) {
BrowserActions.click(this.logoHyperlinkInput);
this.logoHyperlinkInput.sendKeys(hyperlink);
return this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
async addLogoHyperlink(hyperlink): Promise<void> {
await BrowserActions.click(this.logoHyperlinkInput);
await this.logoHyperlinkInput.sendKeys(hyperlink);
await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
}
addLogoTooltip(tooltip) {
BrowserActions.click(this.logoTooltipInput);
this.logoTooltipInput.sendKeys(tooltip);
return this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
async addLogoTooltip(tooltip): Promise<void> {
await BrowserActions.click(this.logoTooltipInput);
await this.logoTooltipInput.sendKeys(tooltip);
await this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
}
sideBarPositionStart() {
BrowserActions.click(this.positionStart);
async sideBarPositionStart(): Promise<void> {
await BrowserActions.click(this.positionStart);
}
sideBarPositionEnd() {
BrowserActions.click(this.positionEnd);
async sideBarPositionEnd(): Promise<void> {
await BrowserActions.click(this.positionEnd);
}
checkSidebarPositionStart() {
return BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft);
async checkSidebarPositionStart(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionLeft);
}
checkSidebarPositionEnd() {
return BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight);
async checkSidebarPositionEnd(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sideBarPositionRight);
}
}
+5 -8
View File
@@ -15,9 +15,7 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { ElementFinder } from 'protractor/built/element';
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class InfinitePaginationPage {
@@ -30,13 +28,12 @@ export class InfinitePaginationPage {
this.loadMoreButton = this.rootElement.element(by.css('button[data-automation-id="adf-infinite-pagination-button"]'));
}
clickLoadMoreButton() {
BrowserActions.click(this.loadMoreButton);
return this;
async clickLoadMoreButton(): Promise<void> {
await BrowserActions.click(this.loadMoreButton);
}
checkLoadMoreButtonIsNotDisplayed() {
return BrowserVisibility.waitUntilElementIsNotOnPage(this.loadMoreButton);
async checkLoadMoreButtonIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.loadMoreButton);
}
}
+22 -23
View File
@@ -16,7 +16,7 @@
*/
import { BrowserVisibility } from '@alfresco/adf-testing';
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { DataTableComponentPage, BrowserActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../navigationBarPage';
@@ -38,49 +38,48 @@ const column = {
export class CustomSources {
dataTable = new DataTableComponentPage();
navigationBarPage = new NavigationBarPage();
dataTable: DataTableComponentPage = new DataTableComponentPage();
navigationBarPage: NavigationBarPage = new NavigationBarPage();
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
sourceTypeDropdown = element(by.css('div[class*="select-arrow"]>div'));
toolbar: ElementFinder = element(by.css('app-custom-sources .adf-toolbar-title'));
sourceTypeDropdown: ElementFinder = element(by.css('div[class*="select-arrow"]>div'));
getSourceType(option) {
getSourceType(option): ElementFinder {
return element(by.cssContainingText('.cdk-overlay-pane span', `${option}`));
}
waitForToolbarToBeVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
return this;
async waitForToolbarToBeVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
}
navigateToCustomSources() {
this.navigationBarPage.navigateToCustomSources();
this.waitForToolbarToBeVisible();
async navigateToCustomSources(): Promise<void> {
await this.navigationBarPage.clickCustomSources();
await this.waitForToolbarToBeVisible();
}
clickOnSourceType() {
BrowserActions.click(this.sourceTypeDropdown);
async clickOnSourceType(): Promise<void> {
await BrowserActions.click(this.sourceTypeDropdown);
}
selectMySitesSourceType() {
this.clickOnSourceType();
BrowserActions.click(this.getSourceType(source.mySites));
async selectMySitesSourceType(): Promise<void> {
await this.clickOnSourceType();
await BrowserActions.click(this.getSourceType(source.mySites));
}
selectFavoritesSourceType() {
this.clickOnSourceType();
BrowserActions.click(this.getSourceType(source.favorites));
async selectFavoritesSourceType(): Promise<void> {
await this.clickOnSourceType();
await BrowserActions.click(this.getSourceType(source.favorites));
}
checkRowIsDisplayed(rowName) {
checkRowIsDisplayed(rowName): Promise<void> {
return this.dataTable.checkContentIsDisplayed('Name', rowName);
}
checkRowIsNotDisplayed(rowName) {
checkRowIsNotDisplayed(rowName): Promise<void> {
return this.dataTable.checkContentIsNotDisplayed('Name', rowName);
}
getStatusCell(rowName) {
async getStatusCell(rowName): Promise<string> {
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
return BrowserActions.getText(cell);
}
+83 -86
View File
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, by, element, protractor } from 'protractor';
import { browser, by, element, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
import { DataTableComponentPage } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
@@ -33,20 +33,18 @@ export class DataTablePage {
defaultTable: 'datatable'
};
dataTable;
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
selectionButton = element(by.css(`div[class='mat-select-arrow']`));
selectionDropDown = element(by.css(`div[class*='ng-trigger-transformPanel']`));
allSelectedRows = element.all(by.css(`div[class*='is-selected']`));
selectedRowNumber = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
selectAll = element(by.css(`div[class*='header'] label`));
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
idColumnHeader = element(by.css(`div[data-automation-id='auto_id_id']`));
pasteClipboardInput = element(by.css(`input[data-automation-id='paste clipboard input']`));
dataTable: DataTableComponentPage;
multiSelect: ElementFinder = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
reset: ElementFinder = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
allSelectedRows: ElementArrayFinder = element.all(by.css(`div[class*='is-selected']`));
selectedRowNumber: ElementFinder = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
selectAll: ElementFinder = element(by.css(`div[class*='header'] label`));
addRowElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
replaceRowsElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
replaceColumnsElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
createdOnColumn: ElementFinder = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
idColumnHeader: ElementFinder = element(by.css(`div[data-automation-id='auto_id_id']`));
pasteClipboardInput: ElementFinder = element(by.css(`input[data-automation-id='paste clipboard input']`));
constructor(data?) {
if (this.data[data]) {
@@ -56,142 +54,141 @@ export class DataTablePage {
}
}
insertFilter(filterText) {
const inputFilter = element(by.css(`#adf-datatable-filter-input`));
inputFilter.clear();
return inputFilter.sendKeys(filterText);
async insertFilter(filterText): Promise<void> {
const inputFilter: ElementFinder = element(by.css(`#adf-datatable-filter-input`));
await BrowserActions.clearSendKeys(inputFilter, filterText);
}
addRow() {
BrowserActions.click(this.addRowElement);
async addRow(): Promise<void> {
await BrowserActions.click(this.addRowElement);
}
replaceRows(id) {
async replaceRows(id): Promise<void> {
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
BrowserVisibility.waitUntilElementIsVisible(rowID);
BrowserActions.click(this.replaceRowsElement);
BrowserVisibility.waitUntilElementIsNotVisible(rowID);
await BrowserVisibility.waitUntilElementIsVisible(rowID);
await BrowserActions.click(this.replaceRowsElement);
await BrowserVisibility.waitUntilElementIsNotVisible(rowID);
}
replaceColumns() {
BrowserActions.click(this.replaceColumnsElement);
BrowserVisibility.waitUntilElementIsNotOnPage(this.createdOnColumn);
async replaceColumns(): Promise<void> {
await BrowserActions.click(this.replaceColumnsElement);
await BrowserVisibility.waitUntilElementIsNotVisible(this.createdOnColumn);
}
clickMultiSelect() {
BrowserActions.click(this.multiSelect);
async clickMultiSelect(): Promise<void> {
await BrowserActions.click(this.multiSelect);
}
clickReset() {
BrowserActions.click(this.reset);
async clickReset(): Promise<void> {
await BrowserActions.click(this.reset);
}
checkRowIsNotSelected(rowNumber) {
async checkRowIsNotSelected(rowNumber): Promise<void> {
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
BrowserVisibility.waitUntilElementIsNotOnPage(isRowSelected);
await BrowserVisibility.waitUntilElementIsNotVisible(isRowSelected);
}
checkNoRowIsSelected() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.selectedRowNumber);
async checkNoRowIsSelected(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
}
checkAllRows() {
BrowserActions.click(this.selectAll);
async checkAllRows(): Promise<void> {
await BrowserActions.click(this.selectAll);
}
checkRowIsChecked(rowNumber) {
BrowserVisibility.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
async checkRowIsChecked(rowNumber): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
}
checkRowIsNotChecked(rowNumber) {
BrowserVisibility.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
async checkRowIsNotChecked(rowNumber): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(rowNumber));
}
getNumberOfSelectedRows() {
async getNumberOfSelectedRows(): Promise<number> {
return this.allSelectedRows.count();
}
clickCheckbox(rowNumber) {
BrowserActions.closeMenuAndDialogs();
async clickCheckbox(rowNumber): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
BrowserActions.click(checkbox);
await BrowserActions.click(checkbox);
}
async selectRow(rowNumber) {
BrowserActions.clickExecuteScript(`div[title="${this.columns.id}"] div[data-automation-id="text_${rowNumber}"] span`);
return this;
}
selectRowWithKeyboard(rowNumber) {
async selectRow(rowNumber): Promise<void> {
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
await BrowserActions.click(row);
}
selectSelectionMode(selectionMode) {
const selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
BrowserActions.clickExecuteScript('div[class="mat-select-arrow"]');
BrowserActions.click(selectMode);
async selectRowWithKeyboard(rowNumber): Promise<void> {
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
await this.selectRow(rowNumber);
await browser.actions().sendKeys(protractor.Key.NULL).perform();
}
getRowCheckbox(rowNumber) {
async selectSelectionMode(selectionMode): Promise<void> {
const selectMode: ElementFinder = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
await BrowserActions.clickExecuteScript('div[class="mat-select-arrow"]');
await BrowserActions.click(selectMode);
}
getRowCheckbox(rowNumber): ElementFinder {
return this.dataTable.getCellElementByValue(this.columns.id, rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
}
getCopyContentTooltip() {
return this.dataTable.getCopyContentTooltip();
async getCopyContentTooltip(): Promise<string> {
return await this.dataTable.getCopyContentTooltip();
}
mouseOverNameColumn(name) {
return this.dataTable.mouseOverColumn(this.columns.name, name);
async mouseOverNameColumn(name): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.name, name);
}
mouseOverCreatedByColumn(name) {
return this.dataTable.mouseOverColumn(this.columns.createdBy, name);
async mouseOverCreatedByColumn(name): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.createdBy, name);
}
mouseOverIdColumn(name) {
return this.dataTable.mouseOverColumn(this.columns.id, name);
async mouseOverIdColumn(name): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.id, name);
}
mouseOverJsonColumn(rowNumber) {
return this.dataTable.mouseOverElement(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
async mouseOverJsonColumn(rowNumber): Promise<void> {
await this.dataTable.mouseOverElement(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}
getDropTargetIdColumnCell(rowNumber) {
getDropTargetIdColumnCell(rowNumber): ElementFinder {
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
}
getDropTargetIdColumnHeader() {
getDropTargetIdColumnHeader(): ElementFinder {
return this.idColumnHeader;
}
clickOnIdColumn(name) {
return this.dataTable.clickColumn(this.columns.id, name);
async clickOnIdColumn(name): Promise<void> {
await this.dataTable.clickColumn(this.columns.id, name);
}
clickOnJsonColumn(rowNumber) {
return BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
async clickOnJsonColumn(rowNumber): Promise<void> {
await BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}
clickOnNameColumn(name) {
return this.dataTable.clickColumn(this.columns.name, name);
async clickOnNameColumn(name): Promise<void> {
await this.dataTable.clickColumn(this.columns.name, name);
}
clickOnCreatedByColumn(name) {
return this.dataTable.clickColumn(this.columns.createdBy, name);
async clickOnCreatedByColumn(name): Promise<void> {
await this.dataTable.clickColumn(this.columns.createdBy, name);
}
pasteClipboard() {
this.pasteClipboardInput.clear();
BrowserActions.click(this.pasteClipboardInput);
this.pasteClipboardInput.sendKeys(protractor.Key.chord(protractor.Key.SHIFT, protractor.Key.INSERT));
return this;
async pasteClipboard(): Promise<void> {
await this.pasteClipboardInput.clear();
await BrowserActions.click(this.pasteClipboardInput);
await this.pasteClipboardInput.sendKeys(protractor.Key.chord(protractor.Key.SHIFT, protractor.Key.INSERT));
}
getClipboardInputText() {
BrowserVisibility.waitUntilElementIsVisible(this.pasteClipboardInput);
return this.pasteClipboardInput.getAttribute('value');
async getClipboardInputText(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.pasteClipboardInput);
return await this.pasteClipboardInput.getAttribute('value');
}
}
+4 -4
View File
@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class LogoutPage {
logoutSection = element(by.css('div[data-automation-id="adf-logout-section"]'));
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
checkLogoutSectionIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
async checkLogoutSectionIsDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
}
}
@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class MonacoExtensionPage {
monacoPlugin = element(by.cssContainingText('mat-row > mat-cell', 'monaco plugin'));
monacoPlugin: ElementFinder = element(by.cssContainingText('mat-row > mat-cell', 'monaco plugin'));
checkMonacoPluginIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.monacoPlugin);
async checkMonacoPluginIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.monacoPlugin);
}
}
@@ -17,28 +17,28 @@
import { ConfigEditorPage } from '../../configEditorPage';
import { BrowserActions } from '@alfresco/adf-testing';
import { by, element, browser } from 'protractor';
import { by, element, browser, ElementFinder } from 'protractor';
export class FormCloudDemoPage {
formCloudEditor = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
formCloudRender = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
formCloudEditor: ElementFinder = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
formCloudRender: ElementFinder = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
configEditorPage = new ConfigEditorPage();
goToEditor() {
BrowserActions.click(this.formCloudEditor);
async goToEditor(): Promise<void> {
await BrowserActions.click(this.formCloudEditor);
}
goToRenderedForm() {
BrowserActions.click(this.formCloudRender);
async goToRenderedForm(): Promise<void> {
await BrowserActions.click(this.formCloudRender);
}
setConfigToEditor(text) {
this.goToEditor();
browser.sleep(2000);
this.configEditorPage.enterBulkConfiguration(text);
this.goToRenderedForm();
browser.sleep(2000);
async setConfigToEditor(text): Promise<void> {
await this.goToEditor();
await browser.sleep(2000);
await this.configEditorPage.enterBulkConfiguration(text);
await this.goToRenderedForm();
await browser.sleep(2000);
}
}
@@ -19,15 +19,13 @@ import { DataTableComponentPage } from '@alfresco/adf-testing';
export class ProcessDetailsCloudDemoPage {
dataTable = new DataTableComponentPage();
dataTable: DataTableComponentPage = new DataTableComponentPage();
checkTaskIsDisplayed(taskName: string) {
this.dataTable.checkContentIsDisplayed('Name', taskName);
return this;
async checkTaskIsDisplayed(taskName: string): Promise<void> {
await this.dataTable.checkContentIsDisplayed('Name', taskName);
}
selectProcessTaskByName(taskName: string) {
this.dataTable.selectRow('Name', taskName);
return this;
async selectProcessTaskByName(taskName: string): Promise<void> {
await this.dataTable.selectRow('Name', taskName);
}
}
@@ -15,136 +15,120 @@
* limitations under the License.
*/
import { by, element, protractor } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class PeopleGroupCloudComponentPage {
peopleCloudSingleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"][class*="mat-radio-checked"]'));
peopleCloudMultipleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="adf-people-multiple-mode"][class*="mat-radio-checked"]'));
peopleCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"]'));
peopleCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="adf-people-multiple-mode"]'));
peopleCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="adf-people-filter-role"]'));
groupCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="adf-group-single-mode"]'));
groupCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="adf-group-multiple-mode"]'));
groupCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="adf-group-filter-role"]'));
peopleRoleInput = element(by.css('input[data-automation-id="adf-people-roles-input"]'));
peopleAppInput = element(by.css('input[data-automation-id="adf-people-app-input"]'));
peoplePreselect = element(by.css('input[data-automation-id="adf-people-preselect-input"]'));
groupRoleInput = element(by.css('input[data-automation-id="adf-group-roles-input"]'));
groupAppInput = element(by.css('input[data-automation-id="adf-group-app-input"]'));
peopleCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
groupCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
preselectValidation = element(by.css('mat-checkbox.adf-preselect-value'));
preselectValidationStatus = element(by.css('mat-checkbox.adf-preselect-value label input'));
peopleFilterByAppName = element(by.css('.people-control-options mat-radio-button[value="appName"]'));
groupFilterByAppName = element(by.css('.groups-control-options mat-radio-button[value="appName"]'));
peopleCloudSingleSelectionChecked: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"][class*="mat-radio-checked"]'));
peopleCloudMultipleSelectionChecked: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-people-multiple-mode"][class*="mat-radio-checked"]'));
peopleCloudSingleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"]'));
peopleCloudMultipleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-people-multiple-mode"]'));
peopleCloudFilterRole: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-people-filter-role"]'));
groupCloudSingleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-group-single-mode"]'));
groupCloudMultipleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-group-multiple-mode"]'));
groupCloudFilterRole: ElementFinder = element(by.css('mat-radio-button[data-automation-id="adf-group-filter-role"]'));
peopleRoleInput: ElementFinder = element(by.css('input[data-automation-id="adf-people-roles-input"]'));
peopleAppInput: ElementFinder = element(by.css('input[data-automation-id="adf-people-app-input"]'));
peoplePreselect: ElementFinder = element(by.css('input[data-automation-id="adf-people-preselect-input"]'));
groupRoleInput: ElementFinder = element(by.css('input[data-automation-id="adf-group-roles-input"]'));
groupAppInput: ElementFinder = element(by.css('input[data-automation-id="adf-group-app-input"]'));
peopleCloudComponentTitle: ElementFinder = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
groupCloudComponentTitle: ElementFinder = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
preselectValidation: ElementFinder = element(by.css('mat-checkbox.adf-preselect-value'));
preselectValidationStatus: ElementFinder = element(by.css('mat-checkbox.adf-preselect-value label input'));
peopleFilterByAppName: ElementFinder = element(by.css('.people-control-options mat-radio-button[value="appName"]'));
groupFilterByAppName: ElementFinder = element(by.css('.groups-control-options mat-radio-button[value="appName"]'));
checkPeopleCloudComponentTitleIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
return this;
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
}
checkGroupsCloudComponentTitleIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.groupCloudComponentTitle);
return this;
async checkGroupsCloudComponentTitleIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.groupCloudComponentTitle);
}
clickPeopleCloudSingleSelection() {
BrowserActions.click(this.peopleCloudSingleSelection);
async clickPeopleCloudSingleSelection(): Promise<void> {
await BrowserActions.click(this.peopleCloudSingleSelection);
}
clickPeopleCloudMultipleSelection() {
BrowserActions.click(this.peopleCloudMultipleSelection);
async clickPeopleCloudMultipleSelection(): Promise<void> {
await BrowserActions.click(this.peopleCloudMultipleSelection);
}
checkPeopleCloudSingleSelectionIsSelected() {
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSingleSelectionChecked);
async checkPeopleCloudSingleSelectionIsSelected(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSingleSelectionChecked);
}
checkPeopleCloudMultipleSelectionIsSelected() {
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudMultipleSelectionChecked);
async checkPeopleCloudMultipleSelectionIsSelected(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudMultipleSelectionChecked);
}
checkPeopleCloudFilterRole() {
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudFilterRole);
async checkPeopleCloudFilterRole(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudFilterRole);
}
clickPeopleCloudFilterRole() {
BrowserActions.click(this.peopleCloudFilterRole);
async clickPeopleCloudFilterRole(): Promise<void> {
await BrowserActions.click(this.peopleCloudFilterRole);
}
clickGroupCloudFilterRole() {
BrowserActions.click(this.groupCloudFilterRole);
async clickGroupCloudFilterRole(): Promise<void> {
await BrowserActions.click(this.groupCloudFilterRole);
}
enterPeopleRoles(roles) {
BrowserVisibility.waitUntilElementIsVisible(this.peopleRoleInput);
this.peopleRoleInput.clear();
this.peopleRoleInput.sendKeys(roles);
return this;
async enterPeopleRoles(roles): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleRoleInput);
await BrowserActions.clearSendKeys(this.peopleRoleInput, roles);
}
enterPeoplePreselect(preselect) {
BrowserVisibility.waitUntilElementIsVisible(this.peoplePreselect);
this.peoplePreselect.clear();
this.peoplePreselect.sendKeys(preselect);
return this;
async enterPeoplePreselect(preselect): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peoplePreselect);
await BrowserActions.clearSendKeys(this.peoplePreselect, preselect);
}
clearField(locator) {
BrowserVisibility.waitUntilElementIsVisible(locator);
locator.getAttribute('value').then((result) => {
for (let i = result.length; i >= 0; i--) {
locator.sendKeys(protractor.Key.BACK_SPACE);
}
});
async clearField(locator): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(locator);
await BrowserActions.clearSendKeys(locator, '');
}
clickGroupCloudSingleSelection() {
BrowserActions.click(this.groupCloudSingleSelection);
async clickGroupCloudSingleSelection(): Promise<void> {
await BrowserActions.click(this.groupCloudSingleSelection);
}
clickGroupCloudMultipleSelection() {
BrowserActions.click(this.groupCloudMultipleSelection);
async clickGroupCloudMultipleSelection(): Promise<void> {
await BrowserActions.click(this.groupCloudMultipleSelection);
}
enterGroupRoles(roles) {
BrowserVisibility.waitUntilElementIsVisible(this.groupRoleInput);
this.groupRoleInput.clear();
this.groupRoleInput.sendKeys(roles);
return this;
async enterGroupRoles(roles): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.groupRoleInput);
await BrowserActions.clearSendKeys(this.groupRoleInput, roles);
}
clickPreselectValidation() {
BrowserActions.click(this.preselectValidation);
async clickPreselectValidation(): Promise<void> {
await BrowserActions.click(this.preselectValidation);
}
getPreselectValidationStatus() {
BrowserVisibility.waitUntilElementIsVisible(this.preselectValidationStatus);
async getPreselectValidationStatus(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.preselectValidationStatus);
return this.preselectValidationStatus.getAttribute('aria-checked');
}
clickPeopleFilerByApp() {
return BrowserActions.click(this.peopleFilterByAppName);
async clickPeopleFilerByApp(): Promise<void> {
await BrowserActions.click(this.peopleFilterByAppName);
}
clickGroupFilerByApp() {
return BrowserActions.click(this.groupFilterByAppName);
async clickGroupFilerByApp(): Promise<void> {
await BrowserActions.click(this.groupFilterByAppName);
}
enterPeopleAppName(appName) {
BrowserVisibility.waitUntilElementIsVisible(this.peopleAppInput);
this.peopleAppInput.clear();
this.peopleAppInput.sendKeys(appName);
return this;
async enterPeopleAppName(appName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.peopleAppInput);
await BrowserActions.clearSendKeys(this.peopleAppInput, appName);
}
enterGroupAppName(appName) {
BrowserVisibility.waitUntilElementIsVisible(this.groupAppInput);
this.groupAppInput.clear();
this.groupAppInput.sendKeys(appName);
return this;
async enterGroupAppName(appName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.groupAppInput);
await BrowserActions.clearSendKeys(this.groupAppInput, appName);
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
import {
ProcessFiltersCloudComponentPage,
@@ -26,74 +26,71 @@ import {
export class ProcessCloudDemoPage {
allProcesses = element(by.css('span[data-automation-id="all-processes_filter"]'));
runningProcesses = element(by.css('span[data-automation-id="running-processes_filter"]'));
completedProcesses = element(by.css('span[data-automation-id="completed-processes_filter"]'));
activeFilter = element(by.css("mat-list-item[class*='active'] span"));
processFilters = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));
processFiltersList = element(by.css('adf-cloud-process-filters'));
allProcesses: ElementFinder = element(by.css('span[data-automation-id="all-processes_filter"]'));
runningProcesses: ElementFinder = element(by.css('span[data-automation-id="running-processes_filter"]'));
completedProcesses: ElementFinder = element(by.css('span[data-automation-id="completed-processes_filter"]'));
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
processFilters: ElementFinder = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));
processFiltersList: ElementFinder = element(by.css('adf-cloud-process-filters'));
createButton = element(by.css('button[data-automation-id="create-button"'));
newProcessButton = element(by.css('button[data-automation-id="btn-start-process"]'));
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
newProcessButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-process"]'));
processListCloud = new ProcessListCloudComponentPage();
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
editProcessFilterCloudComponent() {
editProcessFilterCloudComponent(): EditProcessFilterCloudComponentPage {
return this.editProcessFilterCloud;
}
processListCloudComponent() {
processListCloudComponent(): ProcessListCloudComponentPage {
return this.processListCloud;
}
getAllRowsByIdColumn() {
getAllRowsByIdColumn(): Promise<any> {
return this.processListCloud.getAllRowsByColumn('Id');
}
allProcessesFilter() {
allProcessesFilter(): ProcessFiltersCloudComponentPage {
return new ProcessFiltersCloudComponentPage(this.allProcesses);
}
runningProcessesFilter() {
runningProcessesFilter(): ProcessFiltersCloudComponentPage {
return new ProcessFiltersCloudComponentPage(this.runningProcesses);
}
completedProcessesFilter() {
completedProcessesFilter(): ProcessFiltersCloudComponentPage {
return new ProcessFiltersCloudComponentPage(this.completedProcesses);
}
customProcessFilter(filterName) {
customProcessFilter(filterName): ProcessFiltersCloudComponentPage {
return new ProcessFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}_filter"]`)));
}
getActiveFilterName() {
async getActiveFilterName(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
return BrowserActions.getText(this.activeFilter);
}
clickOnProcessFilters() {
return BrowserActions.click(this.processFilters);
async clickOnProcessFilters(): Promise<void> {
await BrowserActions.click(this.processFilters);
}
openNewProcessForm() {
this.clickOnCreateButton();
this.newProcessButtonIsDisplayed();
BrowserActions.click(this.newProcessButton);
return this;
async openNewProcessForm(): Promise<void> {
await this.clickOnCreateButton();
await this.newProcessButtonIsDisplayed();
await BrowserActions.click(this.newProcessButton);
}
newProcessButtonIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.newProcessButton);
return this;
async newProcessButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.newProcessButton);
}
isProcessFiltersListVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.processFiltersList);
return this;
async isProcessFiltersListVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.processFiltersList);
}
clickOnCreateButton() {
BrowserActions.click(this.createButton);
return this;
async clickOnCreateButton(): Promise<void> {
await BrowserActions.click(this.createButton);
}
}
@@ -17,96 +17,88 @@
import { BrowserVisibility } from '@alfresco/adf-testing';
import { DataTableComponentPage, BrowserActions } from '@alfresco/adf-testing';
import { element, by, protractor } from 'protractor';
import { element, by, protractor, ElementFinder } from 'protractor';
export class ProcessListDemoPage {
appIdInput = element(by.css('input[data-automation-id="app-id"]'));
resetButton = element(by.cssContainingText('button span', 'Reset'));
emptyProcessContent = element(by.css('div[class="adf-empty-content"]'));
processDefinitionInput = element(by.css('input[data-automation-id="process-definition-id"]'));
processInstanceInput = element(by.css('input[data-automation-id="process-instance-id"]'));
stateSelector = element(by.css('mat-select[data-automation-id="state"'));
sortSelector = element(by.css('mat-select[data-automation-id="sort"'));
appIdInput: ElementFinder = element(by.css('input[data-automation-id="app-id"]'));
resetButton: ElementFinder = element(by.cssContainingText('button span', 'Reset'));
emptyProcessContent: ElementFinder = element(by.css('div[class="adf-empty-content"]'));
processDefinitionInput: ElementFinder = element(by.css('input[data-automation-id="process-definition-id"]'));
processInstanceInput: ElementFinder = element(by.css('input[data-automation-id="process-instance-id"]'));
stateSelector: ElementFinder = element(by.css('mat-select[data-automation-id="state"'));
sortSelector: ElementFinder = element(by.css('mat-select[data-automation-id="sort"'));
dataTable = new DataTableComponentPage();
dataTable: DataTableComponentPage = new DataTableComponentPage();
getDisplayedProcessesNames() {
getDisplayedProcessesNames(): Promise<any> {
return this.dataTable.getAllRowsColumnValues('Name');
}
selectSorting(sort) {
BrowserActions.click(this.sortSelector);
const sortLocator = element(by.cssContainingText('mat-option span', sort));
BrowserActions.click(sortLocator);
return this;
async selectSorting(sort): Promise<void> {
await BrowserActions.click(this.sortSelector);
const sortLocator: ElementFinder = element(by.cssContainingText('mat-option span', sort));
await BrowserActions.click(sortLocator);
}
selectStateFilter(state) {
BrowserActions.click(this.stateSelector);
const stateLocator = element(by.cssContainingText('mat-option span', state));
BrowserActions.click(stateLocator);
return this;
async selectStateFilter(state): Promise<void> {
await BrowserActions.click(this.stateSelector);
const stateLocator: ElementFinder = element(by.cssContainingText('mat-option span', state));
await BrowserActions.click(stateLocator);
}
addAppId(appId) {
BrowserActions.click(this.appIdInput);
this.appIdInput.sendKeys(protractor.Key.ENTER);
this.appIdInput.clear();
return this.appIdInput.sendKeys(appId);
async addAppId(appId): Promise<void> {
await BrowserActions.click(this.appIdInput);
await this.appIdInput.sendKeys(protractor.Key.ENTER);
await this.appIdInput.clear();
await this.appIdInput.sendKeys(appId);
}
clickResetButton() {
return BrowserActions.click(this.resetButton);
async clickResetButton(): Promise<void> {
await BrowserActions.click(this.resetButton);
}
checkErrorMessageIsDisplayed(error) {
const errorMessage = element(by.cssContainingText('mat-error', error));
BrowserVisibility.waitUntilElementIsVisible(errorMessage);
async checkErrorMessageIsDisplayed(error): Promise<void> {
const errorMessage: ElementFinder = element(by.cssContainingText('mat-error', error));
await BrowserVisibility.waitUntilElementIsVisible(errorMessage);
}
checkNoProcessFoundIsDisplayed() {
return BrowserVisibility.waitUntilElementIsVisible(this.emptyProcessContent);
async checkNoProcessFoundIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyProcessContent);
}
checkProcessIsNotDisplayed(processName) {
return this.dataTable.checkContentIsNotDisplayed('Name', processName);
async checkProcessIsNotDisplayed(processName): Promise<void> {
await this.dataTable.checkContentIsNotDisplayed('Name', processName);
}
checkProcessIsDisplayed(processName) {
return this.dataTable.checkContentIsDisplayed('Name', processName);
async checkProcessIsDisplayed(processName): Promise<void> {
await this.dataTable.checkContentIsDisplayed('Name', processName);
}
checkAppIdFieldIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.appIdInput);
return this;
async checkAppIdFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.appIdInput);
}
checkProcessInstanceIdFieldIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.processInstanceInput);
return this;
async checkProcessInstanceIdFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceInput);
}
checkStateFieldIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
return this;
async checkStateFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
}
checkSortFieldIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.sortSelector);
return this;
async checkSortFieldIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sortSelector);
}
addProcessDefinitionId(procDefinitionId) {
BrowserActions.click(this.processDefinitionInput);
this.processDefinitionInput.clear();
return this.processDefinitionInput.sendKeys(procDefinitionId);
async addProcessDefinitionId(procDefinitionId): Promise<void> {
await BrowserActions.click(this.processDefinitionInput);
await BrowserActions.clearSendKeys(this.processDefinitionInput, procDefinitionId);
}
addProcessInstanceId(procInstanceId) {
BrowserActions.click(this.processInstanceInput);
this.processInstanceInput.clear();
return this.processInstanceInput.sendKeys(procInstanceId);
async addProcessInstanceId(procInstanceId): Promise<void> {
await BrowserActions.click(this.processInstanceInput);
await BrowserActions.clearSendKeys(this.processInstanceInput, procInstanceId);
}
}
@@ -16,22 +16,22 @@
*/
import { BrowserActions } from '@alfresco/adf-testing';
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { TaskFiltersPage } from '../../process-services/taskFiltersPage';
export class TaskFiltersDemoPage {
myTasks = element(by.css('span[data-automation-id="My Tasks_filter"]'));
queuedTask = element(by.css('span[data-automation-id="Queued Tasks_filter"]'));
completedTask = element(by.css('span[data-automation-id="Completed Tasks_filter"]'));
involvedTask = element(by.css('span[data-automation-id="Involved Tasks_filter"]'));
activeFilter = element(by.css("mat-list-item[class*='active']"));
myTasks: ElementFinder = element(by.css('span[data-automation-id="My Tasks_filter"]'));
queuedTask: ElementFinder = element(by.css('span[data-automation-id="Queued Tasks_filter"]'));
completedTask: ElementFinder = element(by.css('span[data-automation-id="Completed Tasks_filter"]'));
involvedTask: ElementFinder = element(by.css('span[data-automation-id="Involved Tasks_filter"]'));
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active']"));
myTasksFilter() {
myTasksFilter(): TaskFiltersPage {
return new TaskFiltersPage(this.myTasks);
}
queuedTasksFilter() {
queuedTasksFilter(): TaskFiltersPage {
return new TaskFiltersPage(this.queuedTask);
}
@@ -39,15 +39,15 @@ export class TaskFiltersDemoPage {
return new TaskFiltersPage(this.completedTask);
}
involvedTasksFilter() {
involvedTasksFilter(): TaskFiltersPage {
return new TaskFiltersPage(this.involvedTask);
}
customTaskFilter(filterName) {
customTaskFilter(filterName): TaskFiltersPage {
return new TaskFiltersPage(element(by.css(`span[data-automation-id="${filterName}_filter"]`)));
}
checkActiveFilterActive () {
async checkActiveFilterActive(): Promise<string> {
return BrowserActions.getText(this.activeFilter);
}
@@ -17,188 +17,153 @@
import { TasksListPage } from '../../process-services/tasksListPage';
import { PaginationPage } from '@alfresco/adf-testing';
import { element, by } from 'protractor';
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class TaskListDemoPage {
taskListPage: TasksListPage = new TasksListPage();
appId = element(by.css("input[data-automation-id='appId input']"));
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
processDefinitionId = element(by.css("input[data-automation-id='process definition id']"));
processInstanceId = element(by.css("input[data-automation-id='process instance id']"));
page = element(by.css("input[data-automation-id='page']"));
pageForm = element(by.css("mat-form-field[data-automation-id='page']"));
taskName = element(by.css("input[data-automation-id='task name']"));
resetButton = element(by.css("div[class='adf-reset-button'] button"));
dueBefore = element(by.css("input[data-automation-id='due before']"));
dueAfter = element(by.css("input[data-automation-id='due after']"));
taskId = element(by.css("input[data-automation-id='task id']"));
stateDropDownArrow = element(by.css("mat-form-field[data-automation-id='state'] div[class*='arrow']"));
stateSelector = element(by.css("div[class*='mat-select-panel']"));
sortDropDownArrow = element(by.css("mat-form-field[data-automation-id='sort'] div[class*='arrow']"));
sortSelector = element(by.css("div[class*='mat-select-panel']"));
appId: ElementFinder = element(by.css("input[data-automation-id='appId input']"));
itemsPerPage: ElementFinder = element(by.css("input[data-automation-id='items per page']"));
itemsPerPageForm: ElementFinder = element(by.css("mat-form-field[data-automation-id='items per page']"));
processDefinitionId: ElementFinder = element(by.css("input[data-automation-id='process definition id']"));
processInstanceId: ElementFinder = element(by.css("input[data-automation-id='process instance id']"));
page: ElementFinder = element(by.css("input[data-automation-id='page']"));
pageForm: ElementFinder = element(by.css("mat-form-field[data-automation-id='page']"));
taskName: ElementFinder = element(by.css("input[data-automation-id='task name']"));
resetButton: ElementFinder = element(by.css("div[class='adf-reset-button'] button"));
dueBefore: ElementFinder = element(by.css("input[data-automation-id='due before']"));
dueAfter: ElementFinder = element(by.css("input[data-automation-id='due after']"));
taskId: ElementFinder = element(by.css("input[data-automation-id='task id']"));
stateDropDownArrow: ElementFinder = element(by.css("mat-form-field[data-automation-id='state'] div[class*='arrow']"));
stateSelector: ElementFinder = element(by.css("div[class*='mat-select-panel']"));
taskList(): TasksListPage {
return this.taskListPage;
}
paginationPage() {
paginationPage(): PaginationPage {
return new PaginationPage();
}
typeAppId(input) {
BrowserVisibility.waitUntilElementIsVisible(this.appId);
this.clearText(this.appId);
this.appId.sendKeys(input);
return this;
async typeAppId(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.appId);
await BrowserActions.clearSendKeys(this.appId, input);
}
clickAppId() {
BrowserActions.click(this.appId);
return this;
async clickAppId(): Promise<void> {
await BrowserActions.click(this.appId);
}
getAppId() {
BrowserVisibility.waitUntilElementIsVisible(this.appId);
async getAppId(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.appId);
return this.appId.getAttribute('value');
}
typeTaskId(input) {
BrowserVisibility.waitUntilElementIsVisible(this.taskId);
this.clearText(this.taskId);
this.taskId.sendKeys(input);
return this;
async typeTaskId(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskId);
await BrowserActions.clearSendKeys(this.taskId, input);
}
getTaskId() {
BrowserVisibility.waitUntilElementIsVisible(this.taskId);
async getTaskId(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskId);
return this.taskId.getAttribute('value');
}
typeTaskName(input) {
BrowserVisibility.waitUntilElementIsVisible(this.taskName);
this.clearText(this.taskName);
this.taskName.sendKeys(input);
return this;
async typeTaskName(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskName);
await BrowserActions.clearSendKeys(this.taskName, input);
}
getTaskName() {
BrowserVisibility.waitUntilElementIsVisible(this.taskName);
async getTaskName(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskName);
return this.taskName.getAttribute('value');
}
typeItemsPerPage(input) {
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPage);
this.clearText(this.itemsPerPage);
this.itemsPerPage.sendKeys(input);
return this;
async typeItemsPerPage(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPage);
await BrowserActions.clearSendKeys(this.itemsPerPage, input);
}
typeProcessDefinitionId(input) {
BrowserVisibility.waitUntilElementIsVisible(this.processDefinitionId);
this.clearText(this.processDefinitionId);
this.processDefinitionId.sendKeys(input);
return this;
async typeProcessDefinitionId(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.processDefinitionId);
await BrowserActions.clearSendKeys(this.processDefinitionId, input);
}
getProcessDefinitionId() {
BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
async getProcessDefinitionId(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
return this.processInstanceId.getAttribute('value');
}
typeProcessInstanceId(input) {
BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
this.clearText(this.processInstanceId);
this.processInstanceId.sendKeys(input);
return this;
async typeProcessInstanceId(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
await BrowserActions.clearSendKeys(this.processInstanceId, input);
}
getProcessInstanceId() {
BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
async getProcessInstanceId(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceId);
return this.processInstanceId.getAttribute('value');
}
getItemsPerPageFieldErrorMessage() {
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
async getItemsPerPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
const errorMessage = this.itemsPerPageForm.element(by.css('mat-error'));
return BrowserActions.getText(errorMessage);
}
typePage(input) {
BrowserVisibility.waitUntilElementIsVisible(this.page);
this.clearText(this.page);
this.page.sendKeys(input);
return this;
async typePage(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.page);
await BrowserActions.clearSendKeys(this.page, input);
}
getPage() {
BrowserVisibility.waitUntilElementIsVisible(this.page);
async getPage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.page);
return this.page.getAttribute('value');
}
getPageFieldErrorMessage() {
BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
async getPageFieldErrorMessage(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
const errorMessage = this.pageForm.element(by.css('mat-error'));
return BrowserActions.getText(errorMessage);
}
typeDueAfter(input) {
BrowserVisibility.waitUntilElementIsVisible(this.dueAfter);
this.clearText(this.dueAfter);
this.dueAfter.sendKeys(input);
return this;
async typeDueAfter(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dueAfter);
await BrowserActions.clearSendKeys(this.dueAfter, input);
}
typeDueBefore(input) {
BrowserVisibility.waitUntilElementIsVisible(this.dueBefore);
this.clearText(this.dueBefore);
this.dueBefore.sendKeys(input);
return this;
async typeDueBefore(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dueBefore);
await BrowserActions.clearSendKeys(this.dueBefore, input);
}
clearText(input) {
BrowserVisibility.waitUntilElementIsVisible(input);
return input.clear();
async clearText(input): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(input);
await input.clear();
}
clickResetButton() {
BrowserActions.closeMenuAndDialogs();
BrowserActions.click(this.resetButton);
async clickResetButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.resetButton);
}
selectSort(sort) {
this.clickOnSortDropDownArrow();
async selectState(state): Promise<void> {
await this.clickOnStateDropDownArrow();
const sortElement = element.all(by.cssContainingText('mat-option span', sort)).first();
BrowserActions.click(sortElement);
return this;
const stateElement: ElementFinder = element.all(by.cssContainingText('mat-option span', state)).first();
await BrowserActions.click(stateElement);
}
clickOnSortDropDownArrow() {
BrowserActions.click(this.sortDropDownArrow);
BrowserVisibility.waitUntilElementIsVisible(this.sortSelector);
async clickOnStateDropDownArrow(): Promise<void> {
await BrowserActions.click(this.stateDropDownArrow);
await BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
}
selectState(state) {
this.clickOnStateDropDownArrow();
const stateElement = element.all(by.cssContainingText('mat-option span', state)).first();
BrowserActions.click(stateElement);
return this;
}
clickOnStateDropDownArrow() {
BrowserActions.click(this.stateDropDownArrow);
BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
}
getAllProcessDefinitionIds() {
getAllProcessDefinitionIds(): Promise<any> {
return this.taskList().getDataTable().getAllRowsColumnValues('Process Definition Id');
}
getAllProcessInstanceIds() {
getAllProcessInstanceIds(): Promise<any> {
return this.taskList().getDataTable().getAllRowsColumnValues('Process Instance Id');
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, browser } from 'protractor';
import { element, by, browser, ElementFinder, ElementArrayFinder } from 'protractor';
import {
FormControllersPage,
TaskFiltersCloudComponentPage,
@@ -27,132 +27,114 @@ import {
export class TasksCloudDemoPage {
myTasks = element(by.css('span[data-automation-id="my-tasks-filter"]'));
completedTasks = element(by.css('span[data-automation-id="completed-tasks-filter"]'));
activeFilter = element(by.css("mat-list-item[class*='active'] span"));
myTasks: ElementFinder = element(by.css('span[data-automation-id="my-tasks-filter"]'));
completedTasks: ElementFinder = element(by.css('span[data-automation-id="completed-tasks-filter"]'));
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
defaultActiveFilter = element.all(by.css('.adf-filters__entry')).first();
defaultActiveFilter: ElementFinder = element.all(by.css('.adf-filters__entry')).first();
createButton = element(by.css('button[data-automation-id="create-button"'));
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
appButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
modeDropDownArrow = element(by.css('mat-form-field[data-automation-id="selectionMode"] div[class*="arrow-wrapper"]'));
modeSelector = element(by.css("div[class*='mat-select-panel']"));
displayTaskDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
displayProcessDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
multiSelectionToggle = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
testingModeToggle = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]'));
selectedRows = element(by.xpath("//div[text()=' Selected rows: ']"));
noOfSelectedRows = element.all(by.xpath("//div[text()=' Selected rows: ']//li"));
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
newTaskButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-task"]'));
settingsButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
appButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
modeDropDownArrow: ElementFinder = element(by.css('mat-form-field[data-automation-id="selectionMode"] div[class*="arrow-wrapper"]'));
modeSelector: ElementFinder = element(by.css("div[class*='mat-select-panel']"));
displayTaskDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
displayProcessDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
multiSelectionToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
testingModeToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]'));
selectedRows: ElementFinder = element(by.xpath("//div[text()=' Selected rows: ']"));
noOfSelectedRows: ElementArrayFinder = element.all(by.xpath("//div[text()=' Selected rows: ']//li"));
formControllersPage = new FormControllersPage();
formControllersPage: FormControllersPage = new FormControllersPage();
editTaskFilterCloud = new EditTaskFilterCloudComponentPage();
editTaskFilterCloud: EditTaskFilterCloudComponentPage = new EditTaskFilterCloudComponentPage();
disableDisplayTaskDetails() {
this.formControllersPage.disableToggle(this.displayTaskDetailsToggle);
return this;
async disableDisplayTaskDetails(): Promise<void> {
await this.formControllersPage.disableToggle(this.displayTaskDetailsToggle);
}
disableDisplayProcessDetails() {
this.formControllersPage.disableToggle(this.displayProcessDetailsToggle);
return this;
async disableDisplayProcessDetails(): Promise<void> {
await this.formControllersPage.disableToggle(this.displayProcessDetailsToggle);
}
enableMultiSelection() {
this.formControllersPage.enableToggle(this.multiSelectionToggle);
return this;
async enableMultiSelection(): Promise<void> {
await this.formControllersPage.enableToggle(this.multiSelectionToggle);
}
enableTestingMode() {
this.formControllersPage.enableToggle(this.testingModeToggle);
return this;
async enableTestingMode(): Promise<void> {
await this.formControllersPage.enableToggle(this.testingModeToggle);
}
taskFiltersCloudComponent(filter) {
return new TaskFiltersCloudComponentPage(filter);
}
taskListCloudComponent() {
taskListCloudComponent(): TaskListCloudComponentPage {
return new TaskListCloudComponentPage();
}
editTaskFilterCloudComponent() {
editTaskFilterCloudComponent(): EditTaskFilterCloudComponentPage {
return this.editTaskFilterCloud;
}
myTasksFilter() {
myTasksFilter(): TaskFiltersCloudComponentPage {
return new TaskFiltersCloudComponentPage(this.myTasks);
}
completedTasksFilter() {
completedTasksFilter(): TaskFiltersCloudComponentPage {
return new TaskFiltersCloudComponentPage(this.completedTasks);
}
getActiveFilterName() {
return BrowserActions.getText(this.activeFilter);
async getActiveFilterName(): Promise<string> {
return await BrowserActions.getText(this.activeFilter);
}
customTaskFilter(filterName) {
customTaskFilter(filterName): TaskFiltersCloudComponentPage {
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
}
openNewTaskForm() {
BrowserActions.click(this.createButton);
BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]');
return this;
async openNewTaskForm(): Promise<void> {
await BrowserActions.click(this.createButton);
await BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]');
}
clickOnCreateButton() {
BrowserActions.click(this.createButton);
return this;
async firstFilterIsActive(): Promise<boolean> {
const value = await this.defaultActiveFilter.getAttribute('class');
return value.includes('adf-active');
}
firstFilterIsActive() {
return this.defaultActiveFilter.getAttribute('class').then((value) => value.includes('adf-active'));
async clickSettingsButton(): Promise<void> {
await BrowserActions.click(this.settingsButton);
await browser.sleep(400);
await BrowserVisibility.waitUntilElementIsVisible(this.multiSelectionToggle);
await BrowserVisibility.waitUntilElementIsClickable(this.modeDropDownArrow);
}
clickSettingsButton() {
BrowserActions.click(this.settingsButton);
browser.driver.sleep(400);
BrowserVisibility.waitUntilElementIsVisible(this.multiSelectionToggle);
BrowserVisibility.waitUntilElementIsVisible(this.modeDropDownArrow);
BrowserVisibility.waitUntilElementIsClickable(this.modeDropDownArrow);
return this;
async clickAppButton(): Promise<void> {
await BrowserActions.click(this.appButton);
}
clickAppButton() {
BrowserActions.click(this.appButton);
return this;
async selectSelectionMode(mode): Promise<void> {
await this.clickOnSelectionModeDropDownArrow();
const modeElement: ElementFinder = element.all(by.cssContainingText('mat-option span', mode)).first();
await BrowserActions.click(modeElement);
}
selectSelectionMode(mode) {
this.clickOnSelectionModeDropDownArrow();
const modeElement = element.all(by.cssContainingText('mat-option span', mode)).first();
BrowserActions.click(modeElement);
return this;
async clickOnSelectionModeDropDownArrow(): Promise<void> {
await BrowserActions.click(this.modeDropDownArrow);
await BrowserVisibility.waitUntilElementIsVisible(this.modeSelector);
}
clickOnSelectionModeDropDownArrow() {
BrowserActions.click(this.modeDropDownArrow);
BrowserVisibility.waitUntilElementIsVisible(this.modeSelector);
async checkSelectedRowsIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectedRows);
}
checkSelectedRowsIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.selectedRows);
return this;
async getNoOfSelectedRows(): Promise<number> {
await this.checkSelectedRowsIsDisplayed();
return await this.noOfSelectedRows.count();
}
getNoOfSelectedRows() {
this.checkSelectedRowsIsDisplayed();
return this.noOfSelectedRows.count();
}
getSelectedTaskRowText(rowNo: string) {
this.checkSelectedRowsIsDisplayed();
const row = element(by.xpath(`//div[text()=' Selected rows: ']//li[${rowNo}]`));
return row.getText();
async getSelectedTaskRowText(rowNo: string): Promise<string> {
await this.checkSelectedRowsIsDisplayed();
const row: ElementFinder = element(by.xpath(`//div[text()=' Selected rows: ']//li[${rowNo}]`));
return await BrowserActions.getText(row);
}
}
+6 -6
View File
@@ -15,20 +15,20 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
export class SocialPage {
nodeIdField = element(by.css(`input[id="nodeId"]`));
nodeIdField: ElementFinder = element(by.css(`input[id="nodeId"]`));
getNodeIdFieldValue() {
BrowserVisibility.waitUntilElementIsVisible(this.nodeIdField);
async getNodeIdFieldValue(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.nodeIdField);
return this.nodeIdField.getAttribute('value');
}
writeCustomNodeId(nodeId: string) {
return BrowserActions.clearSendKeys(this.nodeIdField, nodeId);
async writeCustomNodeId(nodeId: string): Promise<void> {
await BrowserActions.clearSendKeys(this.nodeIdField, nodeId);
}
}
+75 -78
View File
@@ -15,143 +15,140 @@
* limitations under the License.
*/
import { by, element, browser, protractor } from 'protractor';
import { by, element, browser, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class CreateLibraryDialog {
libraryDialog = element(by.css('[role="dialog"]'));
libraryTitle = element(by.css('.adf-library-dialog>h2'));
libraryNameField = element(by.css('input[formcontrolname="title"]'));
libraryIdField = element(by.css('input[formcontrolname="id"]'));
libraryDescriptionField = element(by.css('textarea[formcontrolname="description"]'));
publicRadioButton = element(by.css('[data-automation-id="PUBLIC"]>label'));
privateRadioButton = element(by.css('[data-automation-id="PRIVATE"]>label'));
moderatedRadioButton = element(by.css('[data-automation-id="MODERATED"]>label'));
cancelButton = element(by.css('button[data-automation-id="cancel-library-id"]'));
createButton = element(by.css('button[data-automation-id="create-library-id"]'));
errorMessage = element(by.css('.mat-dialog-content .mat-error'));
errorMessages = element.all(by.css('.mat-dialog-content .mat-error'));
libraryNameHint = element(by.css('adf-library-dialog .mat-hint'));
libraryDialog: ElementFinder = element(by.css('[role="dialog"]'));
libraryTitle: ElementFinder = element(by.css('.adf-library-dialog>h2'));
libraryNameField: ElementFinder = element(by.css('input[formcontrolname="title"]'));
libraryIdField: ElementFinder = element(by.css('input[formcontrolname="id"]'));
libraryDescriptionField: ElementFinder = element(by.css('textarea[formcontrolname="description"]'));
publicRadioButton: ElementFinder = element(by.css('[data-automation-id="PUBLIC"]>label'));
privateRadioButton: ElementFinder = element(by.css('[data-automation-id="PRIVATE"]>label'));
moderatedRadioButton: ElementFinder = element(by.css('[data-automation-id="MODERATED"]>label'));
cancelButton: ElementFinder = element(by.css('button[data-automation-id="cancel-library-id"]'));
createButton: ElementFinder = element(by.css('button[data-automation-id="create-library-id"]'));
errorMessage: ElementFinder = element(by.css('.mat-dialog-content .mat-error'));
errorMessages: ElementArrayFinder = element.all(by.css('.mat-dialog-content .mat-error'));
libraryNameHint: ElementFinder = element(by.css('adf-library-dialog .mat-hint'));
getSelectedRadio() {
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
return BrowserActions.getText(radio);
async getSelectedRadio(): Promise<string> {
const radio: ElementFinder = element(by.css('.mat-radio-button[class*="checked"]'));
return await BrowserActions.getText(radio);
}
waitForDialogToOpen() {
BrowserVisibility.waitUntilElementIsPresent(this.libraryDialog);
return this;
async waitForDialogToOpen(): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.libraryDialog);
}
waitForDialogToClose() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.libraryDialog);
return this;
async waitForDialogToClose(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotPresent(this.libraryDialog);
}
isDialogOpen() {
return browser.isElementPresent(this.libraryDialog);
async isDialogOpen(): Promise<any> {
return await browser.isElementPresent(this.libraryDialog);
}
getTitle() {
return BrowserActions.getText(this.libraryTitle);
async getTitle(): Promise<string> {
return await BrowserActions.getText(this.libraryTitle);
}
getLibraryIdText() {
return this.libraryIdField.getAttribute('value');
async getLibraryIdText(): Promise<string> {
return await this.libraryIdField.getAttribute('value');
}
isErrorMessageDisplayed() {
return this.errorMessage.isDisplayed();
async isErrorMessageDisplayed(): Promise<boolean> {
return await this.errorMessage.isDisplayed();
}
getErrorMessage() {
return BrowserActions.getText(this.errorMessage);
async getErrorMessage(): Promise<string> {
return await BrowserActions.getText(this.errorMessage);
}
getErrorMessages(position) {
return BrowserActions.getText(this.errorMessages.get(position));
async getErrorMessages(position): Promise<string> {
return await BrowserActions.getText(this.errorMessages.get(position));
}
waitForLibraryNameHint() {
BrowserVisibility.waitUntilElementIsVisible(this.libraryNameHint);
return this;
async waitForLibraryNameHint(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.libraryNameHint);
}
getLibraryNameHint() {
return BrowserActions.getText(this.libraryNameHint);
async getLibraryNameHint(): Promise<string> {
return await BrowserActions.getText(this.libraryNameHint);
}
isNameDisplayed() {
return this.libraryNameField.isDisplayed();
async isNameDisplayed(): Promise<boolean> {
return await this.libraryNameField.isDisplayed();
}
isLibraryIdDisplayed() {
return this.libraryIdField.isDisplayed();
async isLibraryIdDisplayed(): Promise<boolean> {
return await this.libraryIdField.isDisplayed();
}
isDescriptionDisplayed() {
return this.libraryDescriptionField.isDisplayed();
async isDescriptionDisplayed(): Promise<boolean> {
return await this.libraryDescriptionField.isDisplayed();
}
isPublicDisplayed() {
return this.publicRadioButton.isDisplayed();
async isPublicDisplayed(): Promise<boolean> {
return await this.publicRadioButton.isDisplayed();
}
isModeratedDisplayed() {
return this.moderatedRadioButton.isDisplayed();
async isModeratedDisplayed(): Promise<boolean> {
return await this.moderatedRadioButton.isDisplayed();
}
isPrivateDisplayed() {
return this.privateRadioButton.isDisplayed();
async isPrivateDisplayed(): Promise<boolean> {
return await this.privateRadioButton.isDisplayed();
}
isCreateEnabled() {
return this.createButton.isEnabled();
async isCreateEnabled(): Promise<boolean> {
return await this.createButton.isEnabled();
}
isCancelEnabled() {
return this.cancelButton.isEnabled();
async isCancelEnabled(): Promise<boolean> {
return await this.cancelButton.isEnabled();
}
clickCreate() {
BrowserActions.click(this.createButton);
async clickCreate(): Promise<void> {
await BrowserActions.click(this.createButton);
}
clickCancel() {
BrowserActions.click(this.cancelButton);
async clickCancel(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
typeLibraryName(libraryName: string) {
BrowserActions.clearSendKeys(this.libraryNameField, libraryName);
async typeLibraryName(libraryName: string): Promise<void> {
await BrowserActions.clearSendKeys(this.libraryNameField, libraryName);
}
typeLibraryId(libraryId) {
BrowserActions.clearSendKeys(this.libraryIdField, libraryId);
async typeLibraryId(libraryId): Promise<void> {
await BrowserActions.clearSendKeys(this.libraryIdField, libraryId);
}
typeLibraryDescription(libraryDescription) {
BrowserActions.clearSendKeys(this.libraryDescriptionField, libraryDescription);
async typeLibraryDescription(libraryDescription): Promise<void> {
await BrowserActions.clearSendKeys(this.libraryDescriptionField, libraryDescription);
}
clearLibraryName() {
this.libraryNameField.clear();
this.libraryNameField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
async clearLibraryName(): Promise<void> {
await this.libraryNameField.clear();
await this.libraryNameField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
}
clearLibraryId() {
this.libraryIdField.clear();
this.libraryIdField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
async clearLibraryId(): Promise<void> {
await this.libraryIdField.clear();
await this.libraryIdField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
}
selectPublic() {
BrowserActions.click(this.publicRadioButton);
async selectPublic(): Promise<void> {
await BrowserActions.click(this.publicRadioButton);
}
selectPrivate() {
BrowserActions.click(this.privateRadioButton);
async selectPrivate(): Promise<void> {
await BrowserActions.click(this.privateRadioButton);
}
selectModerated() {
BrowserActions.click(this.moderatedRadioButton);
async selectModerated(): Promise<void> {
await BrowserActions.click(this.moderatedRadioButton);
}
}
+42 -51
View File
@@ -15,87 +15,78 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class FolderDialog {
folderDialog = element(by.css('adf-folder-dialog'));
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
folderDialog: ElementFinder = element(by.css('adf-folder-dialog'));
folderNameField: ElementFinder = this.folderDialog.element(by.id('adf-folder-name-input'));
folderDescriptionField: ElementFinder = this.folderDialog.element(by.id('adf-folder-description-input'));
createUpdateButton: ElementFinder = this.folderDialog.element(by.id('adf-folder-create-button'));
cancelButton: ElementFinder = this.folderDialog.element(by.id('adf-folder-cancel-button'));
folderTitle: ElementFinder = this.folderDialog.element((by.css('h2.mat-dialog-title')));
validationMessage: ElementFinder = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
getDialogTitle() {
return BrowserActions.getText(this.folderTitle);
async getDialogTitle(): Promise<string> {
return await BrowserActions.getText(this.folderTitle);
}
checkFolderDialogIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
return this;
async checkFolderDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
}
checkFolderDialogIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
return this;
async checkFolderDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
}
clickOnCreateUpdateButton() {
BrowserActions.click(this.createUpdateButton);
async clickOnCreateUpdateButton(): Promise<void> {
await BrowserActions.click(this.createUpdateButton);
}
checkCreateUpdateBtnIsDisabled() {
BrowserActions.checkIsDisabled(this.createUpdateButton);
return this;
async checkCreateUpdateBtnIsDisabled(): Promise<void> {
await BrowserActions.checkIsDisabled(this.createUpdateButton);
}
checkCreateUpdateBtnIsEnabled() {
this.createUpdateButton.isEnabled();
return this;
async clickOnCancelButton(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
checkCancelBtnIsEnabled() {
this.cancelButton.isEnabled();
return this;
async addFolderName(folderName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.folderNameField);
await BrowserActions.clearSendKeys(this.folderNameField, folderName);
}
clickOnCancelButton() {
BrowserActions.click(this.cancelButton);
async addFolderDescription(folderDescription): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.folderDescriptionField);
await BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
}
addFolderName(folderName) {
BrowserVisibility.waitUntilElementIsVisible(this.folderNameField);
BrowserActions.clearSendKeys(this.folderNameField, folderName);
browser.driver.sleep(500);
return this;
async getFolderName(): Promise<string> {
return await this.folderNameField.getAttribute('value');
}
addFolderDescription(folderDescription) {
BrowserVisibility.waitUntilElementIsVisible(this.folderDescriptionField);
BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
return this;
async getValidationMessage(): Promise<string> {
return await BrowserActions.getText(this.validationMessage);
}
getFolderName() {
return this.folderNameField.getAttribute('value');
async checkValidationMessageIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
}
getValidationMessage() {
return BrowserActions.getText(this.validationMessage);
}
checkValidationMessageIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
return this;
}
getFolderNameField() {
getFolderNameField(): ElementFinder {
return this.folderNameField;
}
getFolderDescriptionField() {
getFolderDescriptionField(): ElementFinder {
return this.folderDescriptionField;
}
async checkCreateUpdateBtnIsEnabled(): Promise<void> {
await this.createUpdateButton.isEnabled();
}
async checkCancelBtnIsEnabled(): Promise<void> {
await this.cancelButton.isEnabled();
}
}
+47 -61
View File
@@ -15,102 +15,88 @@
* limitations under the License.
*/
import { browser, by, element, protractor } from 'protractor';
import { browser, by, element, ElementFinder, Locator, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class SearchDialog {
searchIcon = element(by.css(`button[class*='adf-search-button']`));
searchBar = element(by.css(`adf-search-control input`));
searchBarExpanded = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`));
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
rowsAuthor = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
completeName = by.css(`h4[class*='adf-search-fixed-text']`);
highlightName = by.css(`.adf-highlight`);
searchDialog = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
searchIcon: ElementFinder = element(by.css(`button[class*='adf-search-button']`));
searchBar: ElementFinder = element(by.css(`adf-search-control input`));
searchBarExpanded: ElementFinder = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`));
noResultMessage: ElementFinder = element(by.css(`p[class*='adf-search-fixed-text']`));
rowsAuthor: Locator = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
completeName: Locator = by.css(`h4[class*='adf-search-fixed-text']`);
highlightName: Locator = by.css(`.adf-highlight`);
searchDialog: ElementFinder = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
pressDownArrowAndEnter() {
element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN);
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
async pressDownArrowAndEnter(): Promise<void> {
await element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
clickOnSearchIcon() {
BrowserActions.click(this.searchIcon);
return this;
async clickOnSearchIcon(): Promise<void> {
await BrowserActions.click(this.searchIcon);
}
checkSearchIconIsVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.searchIcon);
return this;
async checkSearchIconIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchIcon);
}
checkSearchBarIsVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
return this;
async checkSearchBarIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
}
checkSearchBarIsNotVisible() {
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
BrowserVisibility.waitUntilElementIsNotVisible(this.searchBarExpanded);
return this;
async checkSearchBarIsNotVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.searchBarExpanded);
}
checkNoResultMessageIsDisplayed() {
browser.driver.sleep(500);
BrowserVisibility.waitUntilElementIsVisible(this.noResultMessage);
return this;
async checkNoResultMessageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noResultMessage);
}
checkNoResultMessageIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotOnPage(this.noResultMessage);
return this;
async checkNoResultMessageIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.noResultMessage);
}
enterText(text) {
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
BrowserActions.clickExecuteScript('adf-search-control input');
this.searchBar.sendKeys(text);
return this;
async enterText(text): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
await this.searchBar.sendKeys(text);
}
enterTextAndPressEnter(text) {
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
BrowserActions.clickExecuteScript('adf-search-control input');
this.searchBar.sendKeys(text);
this.searchBar.sendKeys(protractor.Key.ENTER);
return this;
async enterTextAndPressEnter(text): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
await this.searchBar.sendKeys(text);
await this.searchBar.sendKeys(protractor.Key.ENTER);
}
resultTableContainsRow(name) {
BrowserVisibility.waitUntilElementIsVisible(this.searchDialog);
BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name));
return this;
async resultTableContainsRow(name): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchDialog);
await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name));
}
clickOnSpecificRow(name) {
this.resultTableContainsRow(name);
this.getRowByRowName(name).click();
return this;
async clickOnSpecificRow(name): Promise<void> {
await this.resultTableContainsRow(name);
await BrowserActions.click(this.getRowByRowName(name));
}
getRowByRowName(name) {
getRowByRowName(name): ElementFinder {
return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`));
}
getSpecificRowsHighlightName(name) {
return BrowserActions.getText(this.getRowByRowName(name).element(this.highlightName));
async getSpecificRowsHighlightName(name): Promise<string> {
return await BrowserActions.getText(this.getRowByRowName(name).element(this.highlightName));
}
getSpecificRowsCompleteName(name) {
return BrowserActions.getText(this.getRowByRowName(name).element(this.completeName));
async getSpecificRowsCompleteName(name): Promise<string> {
return await BrowserActions.getText(this.getRowByRowName(name).element(this.completeName));
}
getSpecificRowsAuthor(name) {
return BrowserActions.getText(this.getRowByRowName(name).element(this.rowsAuthor));
async getSpecificRowsAuthor(name): Promise<string> {
return await BrowserActions.getText(this.getRowByRowName(name).element(this.rowsAuthor));
}
clearText() {
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
return this.searchBar.clear();
async clearText(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
await this.searchBar.clear();
}
}

Some files were not shown because too many files have changed in this diff Show More