mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[no-issue] Parallel run e2e and e2e common action refactoring (#4702)
This commit is contained in:
@@ -31,7 +31,6 @@ import { StringUtil } from '@alfresco/adf-testing';
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Comment Component', () => {
|
||||
|
||||
@@ -70,7 +69,6 @@ describe('Comment Component', () => {
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
done();
|
||||
@@ -86,7 +84,7 @@ describe('Comment Component', () => {
|
||||
|
||||
userFullName = pngUploadedFile.entry.createdByUser.displayName;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBar.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
@@ -95,21 +93,20 @@ describe('Comment Component', () => {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
try {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
} catch (error) {
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276947] Should be able to add a comment on ACS and view on ADF', () => {
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
await this.alfrescoJsApi.core.commentsApi.addComment(nodeId, {content: comments.test});
|
||||
});
|
||||
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();
|
||||
|
||||
@@ -125,6 +122,7 @@ describe('Comment Component', () => {
|
||||
|
||||
it('[C276948] Should be able to add a comment on a file', () => {
|
||||
viewerPage.viewFile(pngFileModel.name);
|
||||
viewerPage.checkImgViewerIsDisplayed();
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
viewerPage.clickOnCommentsTab();
|
||||
@@ -140,6 +138,7 @@ describe('Comment Component', () => {
|
||||
|
||||
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();
|
||||
@@ -163,6 +162,7 @@ describe('Comment Component', () => {
|
||||
|
||||
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();
|
||||
@@ -194,7 +194,7 @@ describe('Comment Component', () => {
|
||||
|
||||
pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, site.entry.guid);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBar.clickContentServicesButton();
|
||||
|
||||
@@ -202,7 +202,10 @@ describe('Comment Component', () => {
|
||||
});
|
||||
|
||||
afterAll((done) => {
|
||||
uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngUploadedFile.entry.id);
|
||||
try {
|
||||
uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngUploadedFile.entry.id);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -212,6 +215,7 @@ describe('Comment Component', () => {
|
||||
contentServicesPage.checkAcsContainer();
|
||||
|
||||
viewerPage.viewFile(pngUploadedFile.entry.name);
|
||||
viewerPage.checkImgViewerIsDisplayed();
|
||||
viewerPage.checkInfoButtonIsDisplayed();
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('Create folder directive', function () {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { CreateLibraryDialog } from '../../pages/adf/dialog/createLibraryDialog';
|
||||
import { CustomSources } from '../../pages/adf/demo-shell/customSourcesPage';
|
||||
@@ -23,7 +23,6 @@ import { CustomSources } from '../../pages/adf/demo-shell/customSourcesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { browser, Key } from 'protractor';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
|
||||
describe('Create library directive', function () {
|
||||
@@ -53,7 +52,7 @@ describe('Create library directive', function () {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
createSite = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
'title': StringUtil.generateRandomString(20).toLowerCase(),
|
||||
@@ -69,9 +68,8 @@ describe('Create library directive', function () {
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||
done();
|
||||
afterEach(() => {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C290158] Should display the Create Library defaults', () => {
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
/*!
|
||||
* @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 { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { LoginPage, FileBrowserUtil, BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
|
||||
describe('Version component actions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
|
||||
const txtFileComma = new FileModel({
|
||||
'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
|
||||
});
|
||||
|
||||
const file0BytesModel = new FileModel({
|
||||
'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
|
||||
});
|
||||
|
||||
const folderSecond = new FolderModel({
|
||||
'name': 'myrSecondFolder',
|
||||
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
const uploadActions = new UploadActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-');
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, file0BytesModel.location, file0BytesModel.name, '-my-');
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, txtFileComma.location, txtFileComma.name, '-my-');
|
||||
|
||||
const textFolderUploaded = await uploadActions.createFolder(this.alfrescoJsApi, folderInfo.name, '-my-');
|
||||
await uploadActions.uploadFolder(this.alfrescoJsApi, folderInfo.location, textFolderUploaded.entry.id);
|
||||
|
||||
await uploadActions.createFolder(this.alfrescoJsApi, folderSecond.name, '-my-');
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
BrowserVisibility.waitUntilDialogIsClose();
|
||||
});
|
||||
|
||||
it('[C260083] Download files - Different size values', () => {
|
||||
contentListPage.selectRow(txtFileModel.name);
|
||||
contentServicesPage.clickDownloadButton();
|
||||
FileBrowserUtil.isFileDownloaded(txtFileModel.name);
|
||||
BrowserVisibility.waitUntilDialogIsClose();
|
||||
|
||||
contentListPage.selectRow(file0BytesModel.name);
|
||||
contentServicesPage.clickDownloadButton();
|
||||
FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
|
||||
});
|
||||
|
||||
it('[C260084] Download folder', () => {
|
||||
contentListPage.selectRow(folderInfo.name);
|
||||
contentServicesPage.clickDownloadButton();
|
||||
FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
|
||||
});
|
||||
|
||||
it('[C261032] File and Folder', () => {
|
||||
contentServicesPage.clickMultiSelectToggle();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
contentListPage.dataTablePage().checkAllRows();
|
||||
contentServicesPage.clickDownloadButton();
|
||||
FileBrowserUtil.isFileDownloaded('archive.zip');
|
||||
});
|
||||
|
||||
it('[C261033] Folder and Folder', () => {
|
||||
contentListPage.selectRow(folderInfo.name);
|
||||
contentListPage.selectRow(folderSecond.name);
|
||||
|
||||
contentServicesPage.clickDownloadButton();
|
||||
|
||||
FileBrowserUtil.isFileDownloaded('archive.zip');
|
||||
BrowserVisibility.waitUntilDialogIsClose();
|
||||
});
|
||||
|
||||
it('[C277757] Download file - Comma in file name', () => {
|
||||
contentListPage.selectRow(txtFileComma.name);
|
||||
contentServicesPage.clickDownloadButton();
|
||||
FileBrowserUtil.isFileDownloaded(txtFileComma.name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { LoginPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
@@ -28,10 +28,6 @@ import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { Util } from '../../util/util';
|
||||
import { ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
|
||||
import { BreadCrumbDropdownPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
|
||||
import { InfinitePaginationPage } from '../../pages/adf/core/infinitePaginationPage';
|
||||
|
||||
describe('Document List Component - Actions', () => {
|
||||
|
||||
@@ -40,11 +36,7 @@ describe('Document List Component - Actions', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
|
||||
const breadCrumbPage = new BreadCrumbPage();
|
||||
const uploadActions = new UploadActions();
|
||||
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
|
||||
|
||||
const alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
@@ -75,7 +67,6 @@ describe('Document List Component - Actions', () => {
|
||||
};
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
acsUser = new AcsUserModel();
|
||||
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
@@ -89,13 +80,13 @@ describe('Document List Component - Actions', () => {
|
||||
fileNames = Util.generateSequenceFiles(1, nrOfFiles, files.base, files.extension);
|
||||
await uploadActions.createEmptyFiles(alfrescoJsApi, fileNames, uploadedFolder.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
browser.driver.sleep(10000);
|
||||
await browser.driver.sleep(15000);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
beforeEach((done) => {
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
done();
|
||||
});
|
||||
@@ -215,147 +206,4 @@ describe('Document List Component - Actions', () => {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('Folder Actions - Copy and Move', () => {
|
||||
|
||||
const folderModel1 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
const folderModel2 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
const folderModel3 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
const folderModel4 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
const folderModel5 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
const folderModel6 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||
|
||||
let folder1, folder2, folder3, folder4, folder5, folder6;
|
||||
|
||||
let folders;
|
||||
const contentServicesUser = new AcsUserModel();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
|
||||
await alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
|
||||
folder1 = await uploadActions.createFolder(alfrescoJsApi, 'A' + folderModel1.name, '-my-');
|
||||
folder2 = await uploadActions.createFolder(alfrescoJsApi, 'B' + folderModel2.name, '-my-');
|
||||
folder3 = await uploadActions.createFolder(alfrescoJsApi, 'C' + folderModel3.name, '-my-');
|
||||
folder4 = await uploadActions.createFolder(alfrescoJsApi, 'D' + folderModel4.name, '-my-');
|
||||
folder5 = await uploadActions.createFolder(alfrescoJsApi, 'E' + folderModel5.name, '-my-');
|
||||
folder6 = await uploadActions.createFolder(alfrescoJsApi, '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();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await folders.forEach(function (folder) {
|
||||
uploadActions.deleteFilesOrFolder(alfrescoJsApi, 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);
|
||||
|
||||
});
|
||||
|
||||
it('[C305051] Copy 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('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);
|
||||
|
||||
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);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,14 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import { LoginPage, ErrorPage, StringUtil } from '@alfresco/adf-testing';
|
||||
import { LoginPage, StringUtil } from '@alfresco/adf-testing';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
@@ -32,9 +30,6 @@ describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navBar = new NavigationBarPage();
|
||||
const errorPage = new ErrorPage();
|
||||
let privateSite;
|
||||
let uploadedFolder, uploadedFolderExtra;
|
||||
const uploadActions = new UploadActions();
|
||||
let acsUser = null;
|
||||
@@ -68,58 +63,6 @@ describe('Document List Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Permission Message', async () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
acsUser = new AcsUserModel();
|
||||
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
|
||||
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}`;
|
||||
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
privateSite = await this.alfrescoJsApi.core.sitesApi.createSite(privateSiteBody);
|
||||
|
||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, folderName, privateSite.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
|
||||
navBar.openLanguageMenu();
|
||||
navBar.chooseLanguage('English');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C217334] Should display a message when accessing file without permissions', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
browser.get(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('[C279924] Should display custom message when accessing a file without permissions', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.enableCustomPermissionMessage();
|
||||
browser.get(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(errorPage.getErrorCode()).toBe('403');
|
||||
});
|
||||
|
||||
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navBar.openLanguageMenu();
|
||||
navBar.chooseLanguage('Italiano');
|
||||
browser.sleep(2000);
|
||||
browser.get(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Custom Column', () => {
|
||||
|
||||
let folderName;
|
||||
@@ -252,7 +195,7 @@ describe('Document List Component', () => {
|
||||
fileBNode = await uploadActions.uploadFile(this.alfrescoJsApi, fakeFileB.location, fakeFileB.name, '-my-');
|
||||
fileCNode = await uploadActions.uploadFile(this.alfrescoJsApi, fakeFileC.location, fakeFileC.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(user);
|
||||
await loginPage.loginToContentServicesUsingUserModel(user);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
@@ -313,7 +256,7 @@ describe('Document List Component', () => {
|
||||
const folderName = 'BANANA';
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.createNewFolder(folderName);
|
||||
contentServicesPage.doubleClickRow(folderName);
|
||||
@@ -334,7 +277,7 @@ describe('Document List Component', () => {
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
|
||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||
@@ -347,7 +290,7 @@ describe('Document List Component', () => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.clickOnContentServices();
|
||||
contentServicesPage.checkRecentFileToBeShowed();
|
||||
const icon = await contentServicesPage.getRecentFileIcon();
|
||||
@@ -367,7 +310,7 @@ describe('Document List Component', () => {
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, folderNameA, '-my-');
|
||||
uploadedFolderExtra = await uploadActions.createFolder(this.alfrescoJsApi, folderNameB, '-my-');
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkContentIsDisplayed(folderNameA);
|
||||
contentServicesPage.checkContentIsDisplayed(folderNameB);
|
||||
@@ -391,7 +334,7 @@ describe('Document List Component', () => {
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
testFileNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFileA.location, testFileA.name, '-my-');
|
||||
pdfBFileNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFileB.location, testFileB.name, '-my-');
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkContentIsDisplayed(testFileA.name);
|
||||
contentServicesPage.checkContentIsDisplayed(testFileB.name);
|
||||
@@ -429,7 +372,7 @@ describe('Document List Component', () => {
|
||||
});
|
||||
|
||||
it('[C277093] Should sort files with Items per page set to default', async (done) => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkListIsSortedByNameColumn('asc');
|
||||
done();
|
||||
@@ -437,252 +380,6 @@ describe('Document List Component', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('Thumbnails and tooltips', () => {
|
||||
|
||||
const pdfFile = new FileModel({
|
||||
'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
|
||||
});
|
||||
|
||||
const docxFile = new FileModel({
|
||||
'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) => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
filePdfNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-');
|
||||
fileTestNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFile.location, testFile.name, '-my-');
|
||||
fileDocxNode = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-');
|
||||
folderNode = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
if (filePdfNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePdfNode.entry.id);
|
||||
}
|
||||
if (fileTestNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTestNode.entry.id);
|
||||
}
|
||||
if (fileDocxNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileDocxNode.entry.id);
|
||||
}
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folderNode.entry.id);
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
it('[C260108] Should display tooltip for file\'s name', () => {
|
||||
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
||||
});
|
||||
|
||||
it('[C260109] Should display tooltip for folder\'s name', () => {
|
||||
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
|
||||
});
|
||||
|
||||
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
|
||||
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
|
||||
expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280066] Should have a specific thumbnail PDF files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280067] Should have a specific thumbnail DOCX files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280068] Should have a specific thumbnail files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C274701] Should be able to enable thumbnails', async (done) => {
|
||||
contentServicesPage.enableThumbnails();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
|
||||
expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Gallery View', () => {
|
||||
|
||||
const cardProperties = {
|
||||
DISPLAY_NAME: 'Display name',
|
||||
SIZE: 'Size',
|
||||
LOCK: 'Lock',
|
||||
CREATED_BY: 'Created by',
|
||||
CREATED: 'Created'
|
||||
};
|
||||
|
||||
let funnyUser;
|
||||
|
||||
const pdfFile = new FileModel({
|
||||
'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
|
||||
});
|
||||
|
||||
const docxFile = new FileModel({
|
||||
'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) => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
funnyUser = await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
filePdfNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-');
|
||||
fileTestNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFile.location, testFile.name, '-my-');
|
||||
fileDocxNode = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-');
|
||||
folderNode = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
filePDFSubNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, folderNode.entry.id);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.clickGridViewButton();
|
||||
contentServicesPage.checkCardViewContainerIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C280016] Should be able to choose Gallery View', () => {
|
||||
expect(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('[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);
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
|
||||
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
|
||||
|
||||
expect(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(`702.76 KB`);
|
||||
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
|
||||
|
||||
expect(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}`);
|
||||
|
||||
expect(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}`);
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
it('[C280129] Should keep Gallery View when accessing a folder', () => {
|
||||
contentServicesPage.navigateToCardFolder(folderName);
|
||||
expect(contentServicesPage.getCardElementShowedInPage()).toBe(1);
|
||||
expect(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('[C261993] Should be able to sort Gallery Cards by display name', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
|
||||
contentServicesPage.checkListIsSortedByNameColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261994] Should be able to sort Gallery Cards by size', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
|
||||
contentServicesPage.checkListIsSortedBySizeColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261995] Should be able to sort Gallery Cards by author', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
|
||||
contentServicesPage.checkListIsSortedByAuthorColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261996] Should be able to sort Gallery Cards by created date', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
|
||||
contentServicesPage.checkListIsSortedByCreatedColumn('asc');
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
if (filePdfNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePdfNode.entry.id);
|
||||
}
|
||||
if (fileTestNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTestNode.entry.id);
|
||||
}
|
||||
if (fileDocxNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileDocxNode.entry.id);
|
||||
}
|
||||
if (filePDFSubNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePDFSubNode.entry.id);
|
||||
}
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folderNode.entry.id);
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Column Template', () => {
|
||||
|
||||
const file0BytesModel = new FileModel({
|
||||
@@ -700,7 +397,7 @@ describe('Document List Component', () => {
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
file = await uploadActions.uploadFile(this.alfrescoJsApi, file0BytesModel.location, file0BytesModel.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList()
|
||||
.waitForTableBody();
|
||||
done();
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/*!
|
||||
* @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 { by, element } from 'protractor';
|
||||
import { LoginPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
|
||||
import { BreadCrumbDropdownPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
|
||||
import { InfinitePaginationPage } from '../../pages/adf/core/infinitePaginationPage';
|
||||
|
||||
describe('Document List Component - Actions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
|
||||
const breadCrumbPage = new BreadCrumbPage();
|
||||
const uploadActions = new UploadActions();
|
||||
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
|
||||
|
||||
const alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
describe('Folder Actions - Copy and Move', () => {
|
||||
|
||||
const folderModel1 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
const folderModel2 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
const folderModel3 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
const folderModel4 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
const folderModel5 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
const folderModel6 = new FolderModel({ 'name': StringUtil.generateRandomString() });
|
||||
|
||||
let folder1, folder2, folder3, folder4, folder5, folder6;
|
||||
|
||||
let folders;
|
||||
const contentServicesUser = new AcsUserModel();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
|
||||
await alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
|
||||
folder1 = await uploadActions.createFolder(alfrescoJsApi, 'A' + folderModel1.name, '-my-');
|
||||
folder2 = await uploadActions.createFolder(alfrescoJsApi, 'B' + folderModel2.name, '-my-');
|
||||
folder3 = await uploadActions.createFolder(alfrescoJsApi, 'C' + folderModel3.name, '-my-');
|
||||
folder4 = await uploadActions.createFolder(alfrescoJsApi, 'D' + folderModel4.name, '-my-');
|
||||
folder5 = await uploadActions.createFolder(alfrescoJsApi, 'E' + folderModel5.name, '-my-');
|
||||
folder6 = await uploadActions.createFolder(alfrescoJsApi, 'F' + folderModel6.name, '-my-');
|
||||
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage('5');
|
||||
contentServicesPage.checkAcsContainer();
|
||||
contentListPage.waitForTableBody();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await folders.forEach(function (folder) {
|
||||
uploadActions.deleteFilesOrFolder(alfrescoJsApi, 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);
|
||||
|
||||
});
|
||||
|
||||
it('[C305051] Copy 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('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);
|
||||
|
||||
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);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,195 @@
|
||||
/*!
|
||||
* @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 { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import { LoginPage, StringUtil } from '@alfresco/adf-testing';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const uploadActions = new UploadActions();
|
||||
let acsUser = null;
|
||||
const navBar = new NavigationBarPage();
|
||||
|
||||
beforeAll(() => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
});
|
||||
|
||||
describe('Gallery View', () => {
|
||||
|
||||
const cardProperties = {
|
||||
DISPLAY_NAME: 'Display name',
|
||||
SIZE: 'Size',
|
||||
LOCK: 'Lock',
|
||||
CREATED_BY: 'Created by',
|
||||
CREATED: 'Created'
|
||||
};
|
||||
|
||||
let funnyUser;
|
||||
|
||||
const pdfFile = new FileModel({
|
||||
'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
|
||||
});
|
||||
|
||||
const docxFile = new FileModel({
|
||||
'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) => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
funnyUser = await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
filePdfNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-');
|
||||
fileTestNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFile.location, testFile.name, '-my-');
|
||||
fileDocxNode = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-');
|
||||
folderNode = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
filePDFSubNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, folderNode.entry.id);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
navBar.clickHomeButton();
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.clickGridViewButton();
|
||||
contentServicesPage.checkCardViewContainerIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C280016] Should be able to choose Gallery View', () => {
|
||||
expect(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('[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);
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
|
||||
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
|
||||
|
||||
expect(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}`);
|
||||
|
||||
expect(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}`);
|
||||
|
||||
expect(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}`);
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
it('[C280129] Should keep Gallery View when accessing a folder', () => {
|
||||
contentServicesPage.navigateToCardFolder(folderName);
|
||||
|
||||
expect(contentServicesPage.getCardElementShowedInPage()).toBe(1);
|
||||
expect(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('[C261993] Should be able to sort Gallery Cards by display name', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
|
||||
contentServicesPage.checkListIsSortedByNameColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261994] Should be able to sort Gallery Cards by size', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
|
||||
contentServicesPage.checkListIsSortedBySizeColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261995] Should be able to sort Gallery Cards by author', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
|
||||
contentServicesPage.checkListIsSortedByAuthorColumn('asc');
|
||||
});
|
||||
|
||||
it('[C261996] Should be able to sort Gallery Cards by created date', () => {
|
||||
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
|
||||
contentServicesPage.checkListIsSortedByCreatedColumn('asc');
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
if (filePdfNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePdfNode.entry.id);
|
||||
}
|
||||
if (fileTestNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTestNode.entry.id);
|
||||
}
|
||||
if (fileDocxNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileDocxNode.entry.id);
|
||||
}
|
||||
if (filePDFSubNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePDFSubNode.entry.id);
|
||||
}
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folderNode.entry.id);
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -86,16 +86,12 @@ describe('Document List - Pagination', function () {
|
||||
|
||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, secondSetOfFiles, folderThreeUploadedModel.entry.id);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260062] Should use default pagination settings', function () {
|
||||
it('[C260062] Should use default pagination settings', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
@@ -110,7 +106,7 @@ describe('Document List - Pagination', function () {
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('[C274713] Should be able to set Items per page to 20', function () {
|
||||
it('[C274713] Should be able to set Items per page to 20', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
@@ -132,7 +128,7 @@ describe('Document List - Pagination', function () {
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
});
|
||||
|
||||
it('[C260069] Should be able to set Items per page to 5', function () {
|
||||
it('[C260069] Should be able to set Items per page to 5', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
@@ -183,7 +179,7 @@ describe('Document List - Pagination', function () {
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('[C260067] Should be able to set Items per page to 10', function () {
|
||||
it('[C260067] Should be able to set Items per page to 10', () => {
|
||||
currentPage = 1;
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
@@ -214,7 +210,7 @@ describe('Document List - Pagination', function () {
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('[C260065] Should be able to set Items per page to 15', function () {
|
||||
it('[C260065] Should be able to set Items per page to 15', () => {
|
||||
currentPage = 1;
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
@@ -246,7 +242,7 @@ describe('Document List - Pagination', function () {
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
it('[C91320] Pagination should preserve sorting', function () {
|
||||
it('[C91320] Pagination should preserve sorting', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(newFolderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
@@ -286,7 +282,7 @@ describe('Document List - Pagination', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260107] Should not display pagination bar when a folder is empty', function () {
|
||||
it('[C260107] Should not display pagination bar when a folder is empty', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
@@ -302,7 +298,7 @@ describe('Document List - Pagination', function () {
|
||||
contentServicesPage.checkPaginationIsNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C260071] Should be able to change pagination when having 25 files', function () {
|
||||
it('[C260071] Should be able to change pagination when having 25 files', () => {
|
||||
currentPage = 1;
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.doubleClickRow(folderThreeModel.name);
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { LoginPage, ErrorPage, StringUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navBar = new NavigationBarPage();
|
||||
const errorPage = new ErrorPage();
|
||||
let privateSite;
|
||||
let acsUser = null;
|
||||
|
||||
beforeAll(() => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
});
|
||||
|
||||
describe('Permission Message', async () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
acsUser = new AcsUserModel();
|
||||
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
|
||||
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
privateSite = await this.alfrescoJsApi.core.sitesApi.createSite(privateSiteBody);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
|
||||
navBar.openLanguageMenu();
|
||||
navBar.chooseLanguage('English');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C217334] Should display a message when accessing file without permissions', () => {
|
||||
BrowserActions.getUrl(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('[C279924] Should display custom message when accessing a file without permissions', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.enableCustomPermissionMessage();
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(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(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -65,7 +65,7 @@ describe('Document List Component - Properties', () => {
|
||||
|
||||
subFolder = await uploadActions.createFolder(this.alfrescoJsApi, 'subFolder', parentFolder.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
/*!
|
||||
* @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 { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import { LoginPage, StringUtil } from '@alfresco/adf-testing';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
let uploadedFolder, uploadedFolderExtra;
|
||||
const uploadActions = new UploadActions();
|
||||
let acsUser = null;
|
||||
let testFileNode, pdfBFileNode;
|
||||
|
||||
beforeAll(() => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
if (uploadedFolder) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, uploadedFolder.entry.id);
|
||||
uploadedFolder = null;
|
||||
}
|
||||
if (uploadedFolderExtra) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, uploadedFolderExtra.entry.id);
|
||||
uploadedFolderExtra = null;
|
||||
}
|
||||
if (testFileNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, testFileNode.entry.id);
|
||||
testFileNode = null;
|
||||
}
|
||||
if (pdfBFileNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, 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
|
||||
});
|
||||
|
||||
const testFile = new FileModel({
|
||||
'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
|
||||
});
|
||||
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
|
||||
let filePdfNode, fileTestNode, fileDocxNode, folderNode;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
acsUser = new AcsUserModel();
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
filePdfNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-');
|
||||
fileTestNode = await uploadActions.uploadFile(this.alfrescoJsApi, testFile.location, testFile.name, '-my-');
|
||||
fileDocxNode = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-');
|
||||
folderNode = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
if (filePdfNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, filePdfNode.entry.id);
|
||||
}
|
||||
if (fileTestNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTestNode.entry.id);
|
||||
}
|
||||
if (fileDocxNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileDocxNode.entry.id);
|
||||
}
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folderNode.entry.id);
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
it('[C260108] Should display tooltip for file\'s name', () => {
|
||||
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
||||
});
|
||||
|
||||
it('[C260109] Should display tooltip for folder\'s name', () => {
|
||||
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
|
||||
});
|
||||
|
||||
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
|
||||
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
|
||||
expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280066] Should have a specific thumbnail PDF files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280067] Should have a specific thumbnail DOCX files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280068] Should have a specific thumbnail files', async (done) => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
|
||||
expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C274701] Should be able to enable thumbnails', async (done) => {
|
||||
contentServicesPage.enableThumbnails();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
|
||||
expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -98,34 +98,42 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary);
|
||||
try {
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary);
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
await loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
await navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
|
||||
await navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
contentServices.waitForTableBody();
|
||||
contentServices.waitForTableBody();
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
try {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
try {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
|
||||
await this.alfrescoJsApi.core.nodesApi.unlockNode(lockedFileNodeId);
|
||||
await this.alfrescoJsApi.core.nodesApi.unlockNode(lockedFileNodeId);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, lockedFileNodeId);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, lockedFileNodeId);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -181,9 +189,9 @@ describe('Lock File', () => {
|
||||
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
await navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -191,23 +199,24 @@ describe('Lock File', () => {
|
||||
afterEach(async (done) => {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
|
||||
await this.alfrescoJsApi.core.nodesApi.unlockNode(nodeId);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.unlockNode(nodeId);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C286610] Should not be able to delete a locked file', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.deleteNode(nodeId);
|
||||
|
||||
} catch (error) {
|
||||
expect(error.status).toEqual(409);
|
||||
}
|
||||
@@ -215,11 +224,11 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286611] Should not be able to rename a locked file', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
|
||||
@@ -231,11 +240,11 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286612] Should not be able to move a locked file', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
|
||||
@@ -246,11 +255,11 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286613] Should not be able to update a new version on a locked file', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
|
||||
@@ -267,73 +276,85 @@ describe('Lock File', () => {
|
||||
let pngFileToBeLocked;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||
|
||||
lockedFileNodeId = pngFileToBeLocked.entry.id;
|
||||
|
||||
try {
|
||||
pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||
lockedFileNodeId = pngFileToBeLocked.entry.id;
|
||||
} catch (error) {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary);
|
||||
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
|
||||
try {
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary);
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
await loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
} catch (error) {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
try {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickAllowOwnerCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickAllowOwnerCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
const response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
|
||||
try {
|
||||
const response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
|
||||
expect(response.entry.name).toEqual('My new name');
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
expect(response.entry.name).toEqual('My new name');
|
||||
});
|
||||
|
||||
it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickAllowOwnerCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickAllowOwnerCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
const response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
|
||||
try {
|
||||
const response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
|
||||
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
|
||||
});
|
||||
|
||||
it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => {
|
||||
await contentServices.lockContent(pngFileModel.name);
|
||||
contentServices.lockContent(pngFileModel.name);
|
||||
|
||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
await lockFilePage.clickLockFileCheckbox();
|
||||
await lockFilePage.clickAllowOwnerCheckbox();
|
||||
await lockFilePage.clickSaveButton();
|
||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||
lockFilePage.clickLockFileCheckbox();
|
||||
lockFilePage.clickAllowOwnerCheckbox();
|
||||
lockFilePage.clickSaveButton();
|
||||
|
||||
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
|
||||
try {
|
||||
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
|
||||
|
||||
const movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId);
|
||||
const movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId);
|
||||
|
||||
expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
|
||||
expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
const uploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
const aspects = await this.alfrescoJsApi.core.nodesApi.getNode(uploadedFile.entry.id);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('CardView Component - properties', () => {
|
||||
|
||||
pngFileModel.update(pdfUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
|
||||
import { LoginPage, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
@@ -65,8 +63,6 @@ describe('Metadata component', () => {
|
||||
|
||||
const uploadActions = new UploadActions();
|
||||
|
||||
let fileUrl;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
@@ -86,16 +82,16 @@ describe('Metadata component', () => {
|
||||
|
||||
pngFileModel.update(pngUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Viewer Metadata', () => {
|
||||
|
||||
beforeAll(async() => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
|
||||
presets: {
|
||||
default: {
|
||||
@@ -108,7 +104,6 @@ describe('Metadata component', () => {
|
||||
beforeEach(async (done) => {
|
||||
viewerPage.viewFile(pngFileModel.name);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
fileUrl = await browser.getCurrentUrl();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -171,90 +166,56 @@ describe('Metadata component', () => {
|
||||
|
||||
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
await metadataViewPage.editIconClick();
|
||||
metadataViewPage.editPropertyIconIsDisplayed('name');
|
||||
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
|
||||
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
|
||||
metadataViewPage.editIconClick();
|
||||
metadataViewPage.editPropertyIconIsDisplayed('name');
|
||||
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
|
||||
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');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
|
||||
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.updatePropertyIconIsDisplayed('name');
|
||||
metadataViewPage.clearPropertyIconIsDisplayed('name');
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.updatePropertyIconIsDisplayed('name');
|
||||
metadataViewPage.clearPropertyIconIsDisplayed('name');
|
||||
|
||||
metadataViewPage.enterPropertyText('name', 'exampleText');
|
||||
await metadataViewPage.clickClearPropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
metadataViewPage.enterPropertyText('name', 'exampleText');
|
||||
metadataViewPage.clickClearPropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'exampleText.png');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'exampleText.png');
|
||||
metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
|
||||
metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
|
||||
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
|
||||
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');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
|
||||
metadataViewPage.enterDescriptionText('example description');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
|
||||
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
|
||||
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
|
||||
metadataViewPage.enterDescriptionText('example description');
|
||||
metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
|
||||
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
viewerPage.viewFile('exampleText.png');
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
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 metadataViewPage.editIconClick();
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
await metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C279960] Should show the last username modifier when modify a File', () => {
|
||||
loginPage.loginToContentServices(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
browser.get(fileUrl);
|
||||
viewerPage.clickCloseButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
viewerPage.viewFile('exampleText.png');
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
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');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
await metadataViewPage.editIconClick();
|
||||
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
|
||||
metadataViewPage.enterDescriptionText('check author example description');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
|
||||
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
await browser.get(fileUrl);
|
||||
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
expect(metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
|
||||
});
|
||||
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);
|
||||
});
|
||||
|
||||
it('[C260181] Should be possible edit all the metadata aspect', () => {
|
||||
@@ -269,24 +230,22 @@ describe('Metadata component', () => {
|
||||
|
||||
metadataViewPage.clickMetadataGroup('EXIF');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
await metadataViewPage.editIconClick();
|
||||
metadataViewPage.editIconClick();
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('properties.exif:software');
|
||||
metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
|
||||
expect(metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
|
||||
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');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
|
||||
metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
|
||||
expect(metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
|
||||
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');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
|
||||
metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
|
||||
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
|
||||
expect(metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
|
||||
});
|
||||
metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
|
||||
metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
|
||||
metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
|
||||
expect(metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -295,11 +254,11 @@ describe('Metadata component', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.get(TestConfig.adf.url + '/files');
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -308,31 +267,65 @@ describe('Metadata component', () => {
|
||||
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
|
||||
expect(metadataViewPage.getPropertyText('createdByUser.displayName')).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C261158] Should be possible edit the metadata When the node is a Folder', () => {
|
||||
contentServicesPage.metadataContent(folderName);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
await metadataViewPage.editIconClick();
|
||||
metadataViewPage.editIconClick();
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'newnameFolder');
|
||||
await metadataViewPage.clickClearPropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'newnameFolder');
|
||||
metadataViewPage.clickClearPropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'newnameFolder');
|
||||
await metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', 'newnameFolder');
|
||||
metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
|
||||
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', folderName);
|
||||
await metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
|
||||
});
|
||||
metadataViewPage.clickEditPropertyIcons('name');
|
||||
metadataViewPage.enterPropertyText('name', folderName);
|
||||
metadataViewPage.clickUpdatePropertyIcon('name');
|
||||
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('[C279960] Should show the last username modifier when modify a File', async () => {
|
||||
await loginPage.loginToContentServices(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
BrowserActions.getUrl(TestConfig.adf.url + `/(overlay:files/${pngFileModel.id}/view)`);
|
||||
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
metadataViewPage.editIconIsDisplayed();
|
||||
|
||||
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
|
||||
|
||||
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');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
viewerPage.viewFile(pngFileModel.name);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
expect(metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
|
||||
|
||||
viewerPage.clickCloseButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ describe('Notifications Component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
notificationPage.goToNotificationsPage();
|
||||
|
||||
@@ -98,6 +98,8 @@ describe('Notifications Component', () => {
|
||||
notificationPage.clickActionToggle();
|
||||
notificationPage.clickNotificationButton();
|
||||
notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
|
||||
notificationPage.checkNotificationSnackBarIsNotDisplayed();
|
||||
notificationPage.clickNotificationButton();
|
||||
notificationPage.clickActionButton();
|
||||
notificationPage.checkActionEvent();
|
||||
notificationPage.clickActionToggle();
|
||||
|
||||
@@ -24,8 +24,8 @@ import resources = require('../../util/resources');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { StringUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||
@@ -176,13 +176,12 @@ describe('Permissions Component', function () {
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await folders.forEach(function (folder) {
|
||||
uploadActions.deleteFilesOrFolder(alfrescoJsApi, folder.entry.id);
|
||||
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Inherit and assigning permissions', function () {
|
||||
describe('Inherit and assigning permissions', () => {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
|
||||
@@ -190,7 +189,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
file = await uploadActions.uploadFile(alfrescoJsApi, fileModel.location, fileModel.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkContentIsDisplayed(fileModel.name);
|
||||
@@ -206,27 +205,25 @@ describe('Permissions Component', function () {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(alfrescoJsApi, file.entry.id);
|
||||
try {
|
||||
await uploadActions.deleteFilesOrFolder(alfrescoJsApi, file.entry.id);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
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');
|
||||
@@ -236,66 +233,43 @@ describe('Permissions Component', function () {
|
||||
});
|
||||
|
||||
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('[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('[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');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Changing and duplicate Permissions', function () {
|
||||
describe('Changing and duplicate Permissions', () => {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
|
||||
@@ -303,12 +277,10 @@ describe('Permissions Component', function () {
|
||||
|
||||
file = await uploadActions.uploadFile(alfrescoJsApi, fileModel.location, fileModel.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
contentServicesPage.checkContentIsDisplayed(fileModel.name);
|
||||
|
||||
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
|
||||
|
||||
contentList.rightClickOnRow(fileModel.name);
|
||||
@@ -316,17 +288,11 @@ describe('Permissions Component', function () {
|
||||
contentServicesPage.pressContextMenuActionNamed('Permission');
|
||||
|
||||
permissionsPage.checkAddPermissionButtonIsDisplayed();
|
||||
|
||||
permissionsPage.clickAddPermissionButton();
|
||||
|
||||
permissionsPage.checkAddPermissionDialogIsDisplayed();
|
||||
|
||||
permissionsPage.checkSearchUserInputIsDisplayed();
|
||||
|
||||
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
|
||||
|
||||
permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
|
||||
|
||||
permissionsPage.checkUserOrGroupIsAdded(filePermissionUser.getId());
|
||||
|
||||
done();
|
||||
@@ -345,38 +311,30 @@ describe('Permissions Component', function () {
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
|
||||
|
||||
permissionsPage.clickRoleDropdown();
|
||||
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.clickRoleDropdown();
|
||||
|
||||
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
|
||||
permissionsPage.selectOption('Coordinator');
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Coordinator');
|
||||
|
||||
permissionsPage.clickRoleDropdown();
|
||||
|
||||
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
|
||||
permissionsPage.selectOption('Editor');
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Editor');
|
||||
|
||||
permissionsPage.clickRoleDropdown();
|
||||
|
||||
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
|
||||
permissionsPage.selectOption('Consumer');
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Consumer');
|
||||
@@ -384,17 +342,12 @@ describe('Permissions Component', function () {
|
||||
});
|
||||
|
||||
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);
|
||||
@@ -402,7 +355,6 @@ describe('Permissions Component', function () {
|
||||
});
|
||||
|
||||
it('[C276982] Should be able to remove User or Group from the locally set permissions', () => {
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
|
||||
|
||||
permissionsPage.clickDeletePermissionButton();
|
||||
@@ -413,11 +365,11 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', function () {
|
||||
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => {
|
||||
|
||||
it('[C276993] Role Consumer', () => {
|
||||
it('[C276993] Role Consumer', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
|
||||
|
||||
@@ -432,7 +384,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('RoleConsumer' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
contentList.checkActionMenuIsNotDisplayed();
|
||||
|
||||
@@ -446,9 +398,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C276996] Role Contributor', () => {
|
||||
it('[C276996] Role Contributor', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleContributorFolder.entry.id);
|
||||
|
||||
@@ -463,7 +415,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('RoleContributor' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
contentList.checkActionMenuIsNotDisplayed();
|
||||
|
||||
@@ -478,9 +430,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C277000] Role Editor', () => {
|
||||
it('[C277000] Role Editor', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleEditorFolder.entry.id);
|
||||
|
||||
@@ -495,7 +447,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('RoleEditor' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
|
||||
@@ -525,9 +477,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C277003] Role Collaborator', () => {
|
||||
it('[C277003] Role Collaborator', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleCollaboratorFolder.entry.id);
|
||||
|
||||
@@ -542,7 +494,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('RoleCollaborator' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
|
||||
@@ -573,9 +525,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C277004] Role Coordinator', () => {
|
||||
it('[C277004] Role Coordinator', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleCoordinatorFolder.entry.id);
|
||||
|
||||
@@ -618,9 +570,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C279881] No Permission User', () => {
|
||||
it('[C279881] No Permission User', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { PermissionsPage } from '../../pages/adf/permissionsPage';
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../../test.config');
|
||||
@@ -25,7 +25,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
@@ -160,12 +160,15 @@ describe('Permissions Component', function () {
|
||||
|
||||
describe('Role Site Dropdown', function () {
|
||||
|
||||
it('[C277002] Should display the Role Site dropdown', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(folderOwnerUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(folderOwnerUser);
|
||||
await BrowserActions.getUrl(TestConfig.adf.url + '/files/' + publicSite.entry.guid);
|
||||
|
||||
browser.get(TestConfig.adf.url + '/files/' + publicSite.entry.guid);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277002] Should display the Role Site dropdown', async () => {
|
||||
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||
|
||||
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
|
||||
@@ -188,7 +191,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
expect(permissionsPage.getRoleCellValue(consumerUser.getId())).toEqual('SiteCollaborator');
|
||||
|
||||
permissionsPage.clickRoleDropdown();
|
||||
permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());
|
||||
|
||||
expect(permissionsPage.getRoleDropdownOptions().count()).toBe(4);
|
||||
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe('SiteCollaborator');
|
||||
@@ -201,9 +204,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', function () {
|
||||
|
||||
it('[C276994] Role SiteConsumer', () => {
|
||||
it('[C276994] Role SiteConsumer', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(siteConsumerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(siteConsumerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
|
||||
|
||||
@@ -218,7 +221,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
contentList.checkActionMenuIsNotDisplayed();
|
||||
|
||||
@@ -232,8 +235,8 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C276997] Role SiteContributor', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(contributorUser);
|
||||
it('[C276997] Role SiteContributor', async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
|
||||
|
||||
@@ -248,7 +251,7 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
contentList.checkActionMenuIsNotDisplayed();
|
||||
|
||||
@@ -263,9 +266,9 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C277005] Role SiteCollaborator', () => {
|
||||
it('[C277005] Role SiteCollaborator', async () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
|
||||
|
||||
@@ -280,7 +283,8 @@ describe('Permissions Component', function () {
|
||||
|
||||
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
|
||||
contentList.checkActionMenuIsNotDisplayed();
|
||||
@@ -308,8 +312,8 @@ describe('Permissions Component', function () {
|
||||
|
||||
});
|
||||
|
||||
it('[C277006] Role SiteManager', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
it('[C277006] Role SiteManager', async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
|
||||
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
@@ -29,7 +29,6 @@ import resources = require('../../util/resources');
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Share file', () => {
|
||||
|
||||
@@ -57,80 +56,61 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
|
||||
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
try {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
} catch (error) {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Shared link dialog', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
beforeAll(() => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.refresh();
|
||||
contentServicesPage.waitForTableBody();
|
||||
done();
|
||||
afterEach(() => {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C286549] Should check automatically toggle button in Share dialog', () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.shareToggleButtonIsChecked();
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286544] Should display notification when clicking URL copy button', () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickShareLinkButton();
|
||||
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
|
||||
shareDialog.waitForNotificationToClose();
|
||||
shareDialog.clickShareLinkButton();
|
||||
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286543] Should be possible to close Share dialog', () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.checkShareLinkIsDisplayed();
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
});
|
||||
|
||||
it('[C286578] Should disable today option in expiration day calendar', () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
@@ -138,7 +118,6 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
it('[C286548] Should be possible to set expiry date for link', async () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
@@ -152,12 +131,10 @@ describe('Share file', () => {
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.expirationDateInputHasValue(value);
|
||||
shareDialog.clickCloseButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C286578] Should disable today option in expiration day calendar', () => {
|
||||
contentListPage.selectRow(pngFileModel.name);
|
||||
contentServicesPage.clickShareButton();
|
||||
shareDialog.checkDialogIsDisplayed();
|
||||
shareDialog.clickDateTimePickerButton();
|
||||
@@ -166,18 +143,16 @@ describe('Share file', () => {
|
||||
});
|
||||
|
||||
describe('Shared link preview', () => {
|
||||
afterEach( (done) => {
|
||||
afterEach((done) => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
done();
|
||||
@@ -190,7 +165,7 @@ describe('Share file', () => {
|
||||
shareDialog.clickShareLinkButton();
|
||||
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
|
||||
const sharedLink = await shareDialog.getShareLink();
|
||||
browser.get(sharedLink);
|
||||
BrowserActions.getUrl(sharedLink);
|
||||
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
|
||||
});
|
||||
|
||||
@@ -208,7 +183,7 @@ describe('Share file', () => {
|
||||
shareDialog.checkNotificationWithMessage('Link copied to the clipboard');
|
||||
const secondSharedLink = await shareDialog.getShareLink();
|
||||
expect(sharedLink).toEqual(secondSharedLink);
|
||||
browser.get(sharedLink);
|
||||
BrowserActions.getUrl(sharedLink);
|
||||
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
|
||||
});
|
||||
|
||||
@@ -220,7 +195,7 @@ describe('Share file', () => {
|
||||
const sharedLink = await shareDialog.getShareLink();
|
||||
shareDialog.clickCloseButton();
|
||||
navigationBarPage.clickLogoutButton();
|
||||
browser.get(sharedLink);
|
||||
BrowserActions.getUrl(sharedLink);
|
||||
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { StringUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { LoginPage, ErrorPage } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
@@ -99,7 +99,7 @@ describe('Unshare file', () => {
|
||||
const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
|
||||
nodeId = pngUploadedFile.entry.id;
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navBar.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
done();
|
||||
@@ -153,7 +153,7 @@ describe('Unshare file', () => {
|
||||
shareDialog.confirmationDialogIsDisplayed();
|
||||
shareDialog.clickConfirmationDialogRemoveButton();
|
||||
shareDialog.dialogIsClosed();
|
||||
browser.get(sharedLink);
|
||||
BrowserActions.getUrl(sharedLink);
|
||||
errorPage.checkErrorCode();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -92,8 +92,10 @@ describe('Tag component', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pdfUploadedFile.entry.id);
|
||||
browser.refresh();
|
||||
try {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pdfUploadedFile.entry.id);
|
||||
} catch (error) {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -125,17 +127,6 @@ describe('Tag component', () => {
|
||||
expect(tagPage.getErrorMessage()).toEqual('Tag already exists');
|
||||
});
|
||||
|
||||
it('[C260378] Should be possible to add multiple tags', () => {
|
||||
tagPage.insertNodeId(pdfFileModel.id);
|
||||
tagPage.addTag(tagList[2]);
|
||||
|
||||
browser.driver.sleep(5000); // wait CS return tags
|
||||
|
||||
tagPage.checkTagListIsOrderedAscending();
|
||||
tagPage.checkTagListByNodeIdIsOrderedAscending();
|
||||
tagPage.checkTagListContentServicesIsOrderedAscending();
|
||||
});
|
||||
|
||||
it('[C91326] Should be possible to create a tag with different characters', () => {
|
||||
tagPage.insertNodeId(pdfFileModel.id);
|
||||
|
||||
@@ -214,4 +205,15 @@ describe('Tag component', () => {
|
||||
tagPage.checkShowLessButtonIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C260378] Should be possible to add multiple tags', () => {
|
||||
tagPage.insertNodeId(pdfFileModel.id);
|
||||
tagPage.addTag(tagList[2]);
|
||||
|
||||
browser.driver.sleep(5000); // wait CS return tags
|
||||
|
||||
tagPage.checkTagListIsOrderedAscending();
|
||||
tagPage.checkTagListByNodeIdIsOrderedAscending();
|
||||
tagPage.checkTagListContentServicesIsOrderedAscending();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('Trashcan - Pagination', () => {
|
||||
});
|
||||
});
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navigationBarPage.clickTrashcanButton();
|
||||
trashcanPage.waitForTableBody();
|
||||
|
||||
|
||||
@@ -58,12 +58,24 @@ describe('Tree View Component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
treeFolder = await this.alfrescoJsApi.nodes.addNode(nodeNames.parentFolder, {name: nodeNames.folder, nodeType: 'cm:folder'});
|
||||
secondTreeFolder = await this.alfrescoJsApi.nodes.addNode(nodeNames.parentFolder, {name: nodeNames.secondFolder, nodeType: 'cm:folder'});
|
||||
thirdTreeFolder = await this.alfrescoJsApi.nodes.addNode(secondTreeFolder.entry.id, {name: nodeNames.thirdFolder, nodeType: 'cm:folder'});
|
||||
await this.alfrescoJsApi.nodes.addNode(thirdTreeFolder.entry.id, {name: nodeNames.document, nodeType: 'cm:content'});
|
||||
treeFolder = await this.alfrescoJsApi.nodes.addNode(nodeNames.parentFolder, {
|
||||
name: nodeNames.folder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
secondTreeFolder = await this.alfrescoJsApi.nodes.addNode(nodeNames.parentFolder, {
|
||||
name: nodeNames.secondFolder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
thirdTreeFolder = await this.alfrescoJsApi.nodes.addNode(secondTreeFolder.entry.id, {
|
||||
name: nodeNames.thirdFolder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
await this.alfrescoJsApi.nodes.addNode(thirdTreeFolder.entry.id, {
|
||||
name: nodeNames.document,
|
||||
nodeType: 'cm:content'
|
||||
});
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickTreeViewButton();
|
||||
|
||||
@@ -71,11 +83,13 @@ describe('Tree View Component', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, treeFolder.entry.id);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, secondTreeFolder.entry.id);
|
||||
try {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, treeFolder.entry.id);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, secondTreeFolder.entry.id);
|
||||
} catch (error) {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ describe('Upload component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
@@ -80,18 +80,6 @@ describe('Upload component', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
|
||||
|
||||
nodesPromise.forEach(async (currentNode) => {
|
||||
if (currentNode && currentNode !== 'Node id') {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, currentNode);
|
||||
}
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
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)');
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ describe('Upload component - Excluded Files', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
@@ -80,7 +80,8 @@ describe('Upload component - Excluded Files', () => {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.refresh();
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -119,19 +120,10 @@ describe('Upload component - Excluded Files', () => {
|
||||
});
|
||||
|
||||
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', async () => {
|
||||
|
||||
const filesConfig = {
|
||||
'excluded': [
|
||||
'.DS_Store',
|
||||
'desktop.ini',
|
||||
'*.txt'
|
||||
],
|
||||
'match-options': {
|
||||
'nocase': true
|
||||
}
|
||||
};
|
||||
|
||||
await LocalStorageUtil.setConfigField('files', JSON.stringify(filesConfig));
|
||||
await LocalStorageUtil.setConfigField('files', JSON.stringify({
|
||||
excluded: ['.DS_Store', 'desktop.ini', '*.txt'],
|
||||
'match-options': { 'nocase': true }
|
||||
}));
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
@@ -141,21 +133,10 @@ describe('Upload component - Excluded Files', () => {
|
||||
});
|
||||
|
||||
it('[C274688] Should extension type added as excluded and accepted not be uploaded', async () => {
|
||||
|
||||
browser.refresh();
|
||||
|
||||
const filesConfig = {
|
||||
'excluded': [
|
||||
'.DS_Store',
|
||||
'desktop.ini',
|
||||
'*.png'
|
||||
],
|
||||
'match-options': {
|
||||
'nocase': true
|
||||
}
|
||||
};
|
||||
|
||||
await LocalStorageUtil.setConfigField('files', JSON.stringify(filesConfig));
|
||||
await LocalStorageUtil.setConfigField('files', JSON.stringify({
|
||||
excluded: ['.DS_Store', 'desktop.ini', '*.png'],
|
||||
'match-options': { 'nocase': true }
|
||||
}));
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
@@ -60,18 +60,13 @@ describe('Upload component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
it('should remove uploaded file', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.uploadFile(docxFileModel.location);
|
||||
uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
uploadDialog
|
||||
@@ -81,12 +76,13 @@ describe('Upload component', () => {
|
||||
});
|
||||
|
||||
it('should not have remove action if uploaded file is a file version', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.uploadFile(docxFileModel.location);
|
||||
uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
|
||||
|
||||
contentServicesPage.versionManagerContent(docxFileModel.name);
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
versionManagePage.uploadNewVersionFile(
|
||||
fileModelVersion.location
|
||||
);
|
||||
|
||||
@@ -73,7 +73,7 @@ describe('Upload component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
|
||||
@@ -92,14 +92,11 @@ describe('Upload component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
const pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
|
||||
|
||||
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -109,19 +106,17 @@ describe('Upload component', () => {
|
||||
|
||||
describe('', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
contentServicesPage.getElementsDisplayedId().then(async (nodeList) => {
|
||||
for (let i = 0; i < nodeList.length; i++) {
|
||||
try {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeList[i]);
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
contentServicesPage.getElementsDisplayedId().then((nodeList) => {
|
||||
nodeList.forEach(async (currentNode) => {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, currentNode);
|
||||
});
|
||||
done();
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272788] Should display upload button', () => {
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('Upload - User permission', () => {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUserTwo);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
this.consumerSite = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(),
|
||||
@@ -253,7 +253,7 @@ describe('Upload - User permission', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260175] Should two different user upload files in the proper User Home', () => {
|
||||
it('[C260175] Should two different user upload files in the proper User Home', async () => {
|
||||
contentServicesPage.uploadFile(emptyFile.location);
|
||||
|
||||
uploadDialog.fileIsUploaded(emptyFile.name);
|
||||
@@ -261,7 +261,7 @@ describe('Upload - User permission', () => {
|
||||
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
|
||||
|
||||
navigationBarPage.clickLoginButton();
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
|
||||
@@ -271,7 +271,7 @@ describe('Upload - User permission', () => {
|
||||
contentServicesPage.checkContentIsDisplayed(pngFile.name);
|
||||
|
||||
navigationBarPage.clickLoginButton();
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
|
||||
|
||||
@@ -34,7 +34,6 @@ import path = require('path');
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
import { TrashcanPage } from '../../pages/adf/trashcanPage';
|
||||
|
||||
describe('Version component actions', () => {
|
||||
|
||||
@@ -42,7 +41,6 @@ describe('Version component actions', () => {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const trashcanPage = new TrashcanPage();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
|
||||
@@ -82,7 +80,7 @@ describe('Version component actions', () => {
|
||||
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
@@ -166,9 +164,7 @@ describe('Version component actions', () => {
|
||||
|
||||
await expect(new UploadDialog().getTitleText()).toEqual('Upload canceled');
|
||||
|
||||
navigationBarPage.clickTrashcanButton();
|
||||
await trashcanPage.waitForTableBody();
|
||||
trashcanPage.checkTrashcanIsEmpty();
|
||||
await browser.refresh();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||
@@ -145,7 +145,7 @@ describe('Version component permissions', () => {
|
||||
const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
@@ -160,7 +160,7 @@ describe('Version component permissions', () => {
|
||||
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);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
@@ -188,7 +188,7 @@ describe('Version component permissions', () => {
|
||||
describe('Consumer', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
loginPage.loginToContentServicesUsingUserModel(consumerUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
@@ -223,7 +223,7 @@ describe('Version component permissions', () => {
|
||||
const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(contributorUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
@@ -238,7 +238,7 @@ describe('Version component permissions', () => {
|
||||
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', () => {
|
||||
contentServices.versionManagerContent(sameCreatorFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
@@ -283,7 +283,7 @@ describe('Version component permissions', () => {
|
||||
const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
@@ -298,7 +298,7 @@ describe('Version component permissions', () => {
|
||||
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', () => {
|
||||
contentServices.versionManagerContent(sameCreatorFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
@@ -319,7 +319,7 @@ describe('Version component permissions', () => {
|
||||
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);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import resources = require('../../util/resources');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
describe('Version Properties', () => {
|
||||
|
||||
@@ -72,7 +72,7 @@ describe('Version Properties', () => {
|
||||
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
@@ -104,7 +104,8 @@ describe('Version Properties', () => {
|
||||
it('[C269085] Should show/hide comments when showComments true/false', () => {
|
||||
versionManagePage.enableComments();
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.enterCommentText('Example comment text');
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ describe('Version component', () => {
|
||||
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ErrorPage, LoginSSOPage, SettingsPage } from '@alfresco/adf-testing';
|
||||
import { ErrorPage, LoginSSOPage, SettingsPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { browser } from 'protractor';
|
||||
|
||||
@@ -29,7 +29,8 @@ describe('Auth Guard SSO', () => {
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false, true, 'alfresco');
|
||||
loginSSOPage.clickOnSSOButton();
|
||||
await loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
browser.get(TestConfig.adf.url + '/cloud/simple-app');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/cloud/simple-app');
|
||||
browser.driver.sleep(1000);
|
||||
expect(errorPage.getErrorCode()).toBe('403');
|
||||
});
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ describe('Datatable component - selection', () => {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.navigateToDatatable();
|
||||
await navigationBarPage.navigateToDatatable();
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -52,14 +52,10 @@ describe('Datatable component - selection', () => {
|
||||
it('[C213258] Should be possible change the selection modes when change the selectionMode property', () => {
|
||||
dataTablePage.selectRow('2');
|
||||
dataTableComponent.checkRowIsSelected('Id', '2');
|
||||
dataTablePage.getNumberOfSelectedRows().then((result) => {
|
||||
expect(result).toEqual(1);
|
||||
});
|
||||
expect(dataTablePage.getNumberOfSelectedRows()).toEqual(1);
|
||||
dataTablePage.selectRow('3');
|
||||
dataTableComponent.checkRowIsSelected('Id', '3');
|
||||
dataTablePage.getNumberOfSelectedRows().then((result) => {
|
||||
expect(result).toEqual(1);
|
||||
});
|
||||
expect(dataTablePage.getNumberOfSelectedRows()).toEqual(1);
|
||||
dataTablePage.selectSelectionMode('Multiple');
|
||||
dataTablePage.selectRow('1');
|
||||
dataTableComponent.checkRowIsSelected('Id', '1');
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('Datatable component', () => {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, ErrorPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, ErrorPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../test.config');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
@@ -34,24 +34,22 @@ describe('Error Component', () => {
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
it('[C277302] Should display the error 403 when access to unauthorized page - My Change', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/403');
|
||||
BrowserActions.getUrl(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('[C280563] Should back home button navigate to the home page', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/404');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/error/404');
|
||||
|
||||
errorPage.clickBackButton();
|
||||
|
||||
@@ -59,7 +57,7 @@ describe('Error Component', () => {
|
||||
});
|
||||
|
||||
it('[C280564] Should secondary button by default redirect to report-issue URL', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/403');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/error/403');
|
||||
|
||||
errorPage.clickSecondButton();
|
||||
|
||||
@@ -67,14 +65,14 @@ describe('Error Component', () => {
|
||||
});
|
||||
|
||||
it('[C277304] Should display the error 404 when access to not found page', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/404');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/error/404');
|
||||
expect(errorPage.getErrorCode()).toBe('404');
|
||||
expect(errorPage.getErrorTitle()).toBe('An error occurred.');
|
||||
expect(errorPage.getErrorDescription()).toBe('We couldn’t find the page you were looking for.');
|
||||
});
|
||||
|
||||
it('[C307029] Should display Unknown message when error is undefined', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/501');
|
||||
BrowserActions.getUrl(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.');
|
||||
|
||||
@@ -62,23 +62,19 @@ describe('Header Component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async(done) => {
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
navigationBarPage.clickHeaderDataButton();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async(done) => {
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -94,33 +90,23 @@ describe('Header Component', () => {
|
||||
|
||||
it('[C279996] Should be able to show/hide menu button', () => {
|
||||
headerPage.clickShowMenuButton();
|
||||
|
||||
navigationBarPage.checkMenuButtonIsNotDisplayed();
|
||||
|
||||
headerPage.clickShowMenuButton();
|
||||
|
||||
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('[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('[C279997] Should be able to change the title of the app', () => {
|
||||
@@ -137,23 +123,18 @@ describe('Header Component', () => {
|
||||
|
||||
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('[C286517] Should be able to set a hyperlink to the logo text', () => {
|
||||
headerPage.addLogoHyperlink(names.urlPath_logo_link);
|
||||
|
||||
navigationBarPage.clickAppLogoText();
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
|
||||
@@ -37,10 +37,8 @@ describe('Universal Icon component', function () {
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
import { InfinitePaginationPage } from '../pages/adf/core/infinitePaginationPage';
|
||||
import { ConfigEditorPage } from '../pages/adf/configEditorPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
@@ -35,7 +34,6 @@ describe('Enable infinite scrolling', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const infinitePaginationPage = new InfinitePaginationPage();
|
||||
const configEditorPage = new ConfigEditorPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
@@ -66,7 +64,7 @@ describe('Enable infinite scrolling', () => {
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
fileNames = Util.generateSequenceFiles(1, nrOfFiles, files.base, files.extension);
|
||||
deleteFileNames = Util.generateSequenceFiles(1, nrOfDeletedFiles, files.base, files.extension);
|
||||
@@ -133,14 +131,11 @@ describe('Enable infinite scrolling', () => {
|
||||
});
|
||||
|
||||
it('[C299202] Should not display load more button when all the files are already displayed', () => {
|
||||
navigationBarPage.clickConfigEditorButton();
|
||||
configEditorPage.clickInfinitePaginationConfiguration();
|
||||
configEditorPage.clickClearButton();
|
||||
configEditorPage.enterConfiguration('30');
|
||||
configEditorPage.clickSaveButton();
|
||||
LocalStorageUtil.setUserPreference('paginationSize', '30');
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
|
||||
contentServicesPage.doubleClickRow(folderModel.name);
|
||||
|
||||
contentServicesPage.enableInfiniteScrolling();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { LoginPage, SettingsPage, ErrorPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, SettingsPage, ErrorPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { ProcessServicesPage } from '../../pages/adf/process-services/processServicesPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
@@ -72,20 +72,20 @@ describe('Login component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276746] Should display the right information in user-info when a different users logs in', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(userA);
|
||||
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);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(userB);
|
||||
await loginPage.loginToContentServicesUsingUserModel(userB);
|
||||
userInfoPage.clickUserProfile();
|
||||
expect(userInfoPage.getContentHeaderTitle()).toEqual(userB.firstName + ' ' + userB.lastName);
|
||||
expect(userInfoPage.getContentEmail()).toEqual(userB.email);
|
||||
});
|
||||
|
||||
it('[C299206] Should redirect the user without the right access role on a forbidden page', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(userA);
|
||||
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.');
|
||||
@@ -177,6 +177,7 @@ describe('Login component', () => {
|
||||
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();
|
||||
@@ -188,17 +189,19 @@ describe('Login component', () => {
|
||||
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(TestConfig.adf.adminUser, TestConfig.adf.adminPassword);
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
navigationBarPage.navigateToProcessServicesPage();
|
||||
loginPage.waitForElements();
|
||||
});
|
||||
|
||||
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();
|
||||
@@ -210,16 +213,18 @@ describe('Login component', () => {
|
||||
});
|
||||
|
||||
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");').then(async () => {
|
||||
await browser.get(TestConfig.adf.url + '/files');
|
||||
loginPage.waitForElements();
|
||||
});
|
||||
|
||||
browser.executeScript('window.localStorage.removeItem("ticket-ECM");');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/files');
|
||||
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');
|
||||
@@ -228,15 +233,18 @@ describe('Login component', () => {
|
||||
});
|
||||
|
||||
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");').then(async () => {
|
||||
await browser.get(TestConfig.adf.url + '/activiti');
|
||||
loginPage.waitForElements();
|
||||
});
|
||||
browser.executeScript('window.localStorage.removeItem("ticket-BPM");');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/activiti');
|
||||
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);
|
||||
|
||||
@@ -245,15 +253,17 @@ describe('Login component', () => {
|
||||
browser.getAllWindowHandles().then((handles) => {
|
||||
|
||||
browser.switchTo().window(handles[1]).then(() => {
|
||||
browser.get(TestConfig.adf.url + '/activiti');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/activiti');
|
||||
processServicesPage.checkApsContainer();
|
||||
browser.get(TestConfig.adf.url + '/files');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/files');
|
||||
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');
|
||||
@@ -261,7 +271,7 @@ describe('Login component', () => {
|
||||
});
|
||||
|
||||
it('[C291854] Should be possible login in valid credentials', () => {
|
||||
browser.get(TestConfig.adf.url);
|
||||
BrowserActions.getUrl(TestConfig.adf.url);
|
||||
loginPage.waitForElements();
|
||||
expect(loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
loginPage.enterUsername(invalidUsername);
|
||||
|
||||
@@ -52,10 +52,10 @@ describe('Login component - SSO', () => {
|
||||
|
||||
describe('SSO Login Error for login component', () => {
|
||||
|
||||
it('[C299205] Should display the login error message when the SSO identity service is wrongly configured', () => {
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, 'http://aps22/auth/realms/alfresco', TestConfig.adf.hostIdentity, false, true, 'alfresco');
|
||||
loginSSOPage.clickOnSSOButton();
|
||||
loginSSOPage.checkLoginErrorIsDisplayed();
|
||||
it('[C299205] Should display the login error message when the SSO identity service is wrongly configured', async() => {
|
||||
await settingsPage.setProviderEcmSso(TestConfig.adf.url, 'http://aps22/auth/realms/alfresco', TestConfig.adf.hostIdentity, false, true, 'alfresco');
|
||||
await loginSSOPage.clickOnSSOButton();
|
||||
await loginSSOPage.checkLoginErrorIsDisplayed();
|
||||
expect(loginSSOPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -68,6 +68,8 @@ describe('Login component - Redirect', () => {
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
@@ -80,6 +82,8 @@ describe('Login component - Redirect', () => {
|
||||
});
|
||||
|
||||
it('[C260085] Should after login in PS be redirect to Login page when try to access to CS', () => {
|
||||
loginPage.goToLoginPage();
|
||||
loginPage.clickSettingsIcon();
|
||||
settingsPage.setProviderBpm();
|
||||
|
||||
loginPage.enableSuccessRouteSwitch();
|
||||
@@ -96,6 +100,9 @@ describe('Login component - Redirect', () => {
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
settingsPage.setProviderEcmBpm();
|
||||
|
||||
loginPage.login(adminUserModel.id, adminUserModel.password);
|
||||
@@ -108,71 +115,66 @@ describe('Login component - Redirect', () => {
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
navigationBarPage.clickLogoutButton();
|
||||
|
||||
navigationBarPage.clickLogoutButton();
|
||||
logoutPage.checkLogoutSectionIsDisplayed();
|
||||
|
||||
logoutPage.checkLogoutSectionIsDisplayed();
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
loginPage.waitForElements();
|
||||
|
||||
loginPage.waitForElements();
|
||||
loginPage.enterUsername(user.id);
|
||||
loginPage.enterPassword(user.password);
|
||||
loginPage.clickSignInButton();
|
||||
loginPage.login(user.id, user.password);
|
||||
|
||||
navigationBarPage.checkMenuButtonIsDisplayed();
|
||||
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(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);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
||||
contentServicesPage.waitForTableBody();
|
||||
navigationBarPage.clickLogoutButton();
|
||||
|
||||
navigationBarPage.clickLogoutButton();
|
||||
logoutPage.checkLogoutSectionIsDisplayed();
|
||||
|
||||
logoutPage.checkLogoutSectionIsDisplayed();
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
loginPage.waitForElements();
|
||||
browser.refresh();
|
||||
loginPage.waitForElements();
|
||||
|
||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||
loginPage.waitForElements();
|
||||
browser.refresh();
|
||||
loginPage.waitForElements();
|
||||
loginPage.enterUsername(user.id);
|
||||
loginPage.enterPassword(user.password);
|
||||
loginPage.clickSignInButton();
|
||||
|
||||
loginPage.enterUsername(user.id);
|
||||
loginPage.enterPassword(user.password);
|
||||
loginPage.clickSignInButton();
|
||||
navigationBarPage.checkMenuButtonIsDisplayed();
|
||||
|
||||
navigationBarPage.checkMenuButtonIsDisplayed();
|
||||
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
browser.getCurrentUrl().then((actualUrl) => {
|
||||
expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -23,6 +23,8 @@ describe('Login component - Remember Me', () => {
|
||||
const loginPage = new LoginPage();
|
||||
|
||||
beforeAll((done) => {
|
||||
loginPage.goToLoginPage();
|
||||
loginPage.clickSettingsIcon();
|
||||
settingsPage.setProviderEcmBpm();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
|
||||
pngFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileInfo.location, pngFileInfo.name, lastFolderResponse.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, SettingsPage } from '@alfresco/adf-testing';
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { LoginPage, SettingsPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { protractor } from 'protractor';
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage';
|
||||
@@ -49,7 +49,7 @@ describe('Settings component', () => {
|
||||
loginPage.waitForElements();
|
||||
});
|
||||
|
||||
it('[C291946] Should not save BPM Settings changes when User clicks Back button', () => {
|
||||
xit('[C291946] Should not save BPM Settings changes when User clicks Back button', () => {
|
||||
settingsPage.setProvider(settingsPage.getBpmOption(), 'BPM');
|
||||
settingsPage.setProcessServicesURL('http://myenvUrl.co.uk');
|
||||
settingsPage.clickBackButton();
|
||||
@@ -60,7 +60,7 @@ describe('Settings component', () => {
|
||||
|
||||
});
|
||||
|
||||
it('[C291947] Should not save ECM Settings changes when User clicks Back button', () => {
|
||||
xit('[C291947] Should not save ECM Settings changes when User clicks Back button', () => {
|
||||
settingsPage.setProvider(settingsPage.getEcmOption(), 'ECM');
|
||||
settingsPage.setContentServicesURL('http://myenvUrl.co.uk');
|
||||
settingsPage.clickBackButton();
|
||||
@@ -72,6 +72,8 @@ describe('Settings component', () => {
|
||||
});
|
||||
|
||||
it('[C291948] Should save ALL Settings changes when User clicks Apply button', () => {
|
||||
loginPage.goToLoginPage();
|
||||
loginPage.clickSettingsIcon();
|
||||
settingsPage.setProviderEcmBpm();
|
||||
loginPage.waitForElements();
|
||||
settingsPage.goToSettingsPage();
|
||||
@@ -170,7 +172,7 @@ describe('Settings component', () => {
|
||||
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
|
||||
settingsPage.clickBackButton();
|
||||
loginPage.waitForElements();
|
||||
browser.get(TestConfig.adf.url + '/activiti');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/activiti');
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.checkAppIsDisplayed('Task App');
|
||||
});
|
||||
@@ -197,7 +199,7 @@ describe('Settings component', () => {
|
||||
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
|
||||
settingsPage.clickBackButton();
|
||||
loginPage.waitForElements();
|
||||
browser.get(TestConfig.adf.url + '/files');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/files');
|
||||
contentServicesPage.checkAcsContainer();
|
||||
});
|
||||
|
||||
@@ -227,9 +229,9 @@ describe('Settings component', () => {
|
||||
expect(settingsPage.getApplyButton().isEnabled()).toBe(true);
|
||||
settingsPage.clickBackButton();
|
||||
loginPage.waitForElements();
|
||||
browser.get(TestConfig.adf.url + '/files');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/files');
|
||||
contentServicesPage.checkAcsContainer();
|
||||
browser.get(TestConfig.adf.url + '/activiti');
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/activiti');
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.checkAppIsDisplayed('Task App');
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('User Info - SSO', () => {
|
||||
let silentLogin, identityUser;
|
||||
let identityService: IdentityService;
|
||||
|
||||
beforeAll(async () => {
|
||||
beforeAll(async (done) => {
|
||||
const apiService = new ApiService('alfresco', TestConfig.adf.url, TestConfig.adf.hostSso, 'ECM');
|
||||
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
@@ -39,17 +39,21 @@ describe('User Info - SSO', () => {
|
||||
|
||||
silentLogin = false;
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin, true, 'alfresco');
|
||||
|
||||
loginSSOPage.clickOnSSOButton();
|
||||
|
||||
loginSSOPage.loginSSOIdentityService(identityUser.email, identityUser.password);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await identityService.deleteIdentityUser(identityUser.idIdentityService);
|
||||
if (identityService) {
|
||||
await identityService.deleteIdentityUser(identityUser.idIdentityService);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C290066] Should display UserInfo when login using SSO', () => {
|
||||
|
||||
navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
userInfoPage.clickUserProfile();
|
||||
expect(userInfoPage.getSsoHeaderTitle()).toEqual(identityUser.firstName + ' ' + identityUser.lastName);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, SettingsPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { UserInfoPage } from '@alfresco/adf-testing';
|
||||
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
@@ -28,11 +28,9 @@ import resources = require('../util/resources');
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('User Info component', () => {
|
||||
|
||||
const settingsPage = new SettingsPage();
|
||||
const loginPage = new LoginPage();
|
||||
const userInfoPage = new UserInfoPage();
|
||||
let processUserModel, contentUserModel;
|
||||
@@ -71,10 +69,9 @@ describe('User Info component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
xit('[C260111] Should display UserInfo when Process Services and Content Services are enabled', () => {
|
||||
loginPage.goToLoginPage();
|
||||
settingsPage.setProviderEcmBpm();
|
||||
loginPage.login(contentUserModel.id, contentUserModel.password);
|
||||
xit('[C260111] Should display UserInfo when Process Services and Content Services are enabled', async () => {
|
||||
await loginPage.loginToAllUsingUserModel(contentUserModel);
|
||||
|
||||
userInfoPage.clickUserProfile();
|
||||
|
||||
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
@@ -108,10 +105,8 @@ describe('User Info component', () => {
|
||||
userInfoPage.closeUserProfile();
|
||||
});
|
||||
|
||||
it('[C260113] Should display UserInfo when Content Services is enabled and Process Services is disabled', () => {
|
||||
loginPage.goToLoginPage();
|
||||
settingsPage.setProviderEcm();
|
||||
loginPage.login(contentUserModel.id, contentUserModel.password);
|
||||
it('[C260113] Should display UserInfo when Content Services is enabled and Process Services is disabled', async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
|
||||
|
||||
userInfoPage.clickUserProfile();
|
||||
userInfoPage.dialogIsDisplayed();
|
||||
@@ -128,10 +123,8 @@ describe('User Info component', () => {
|
||||
userInfoPage.dialogIsNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C260115] Should display UserInfo when Process Services is enabled and Content Services is disabled', () => {
|
||||
loginPage.goToLoginPage();
|
||||
settingsPage.setProviderBpm();
|
||||
loginPage.login(processUserModel.email, processUserModel.password);
|
||||
it('[C260115] Should display UserInfo when Process Services is enabled and Content Services is disabled', async () => {
|
||||
await loginPage.loginToProcessServicesUsingUserModel(contentUserModel);
|
||||
|
||||
userInfoPage.clickUserProfile();
|
||||
|
||||
@@ -147,22 +140,18 @@ describe('User Info component', () => {
|
||||
userInfoPage.closeUserProfile();
|
||||
});
|
||||
|
||||
it('[C260117] Should display UserInfo with profile image uploaded in ACS', async(done) => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
await PeopleAPI.updateAvatarViaAPI(contentUserModel, acsAvatarFileModel, '-me-');
|
||||
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function () {});
|
||||
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 () {
|
||||
});
|
||||
|
||||
loginPage.goToLoginPage();
|
||||
settingsPage.setProviderEcm();
|
||||
loginPage.login(contentUserModel.id, contentUserModel.password);
|
||||
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
|
||||
|
||||
userInfoPage.clickUserProfile();
|
||||
|
||||
userInfoPage.checkACSProfileImage();
|
||||
userInfoPage.APSProfileImageNotDisplayed();
|
||||
userInfoPage.closeUserProfile();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260118] Should display UserInfo with profile image uploaded in APS', async () => {
|
||||
@@ -170,9 +159,8 @@ describe('User Info component', () => {
|
||||
await this.alfrescoJsApi.login(contentUserModel.email, contentUserModel.password);
|
||||
await users.changeProfilePictureAps(this.alfrescoJsApi, apsAvatarFileModel.getLocation());
|
||||
|
||||
loginPage.goToLoginPage();
|
||||
settingsPage.setProviderBpm();
|
||||
loginPage.login(processUserModel.email, processUserModel.password);
|
||||
await loginPage.loginToProcessServicesUsingUserModel(contentUserModel);
|
||||
|
||||
userInfoPage.clickUserProfile();
|
||||
|
||||
userInfoPage.checkAPSProfileImage();
|
||||
@@ -181,13 +169,11 @@ describe('User Info component', () => {
|
||||
userInfoPage.closeUserProfile();
|
||||
});
|
||||
|
||||
it('[C260120] Should not display profile image in UserInfo when deleted in ACS', () => {
|
||||
PeopleAPI.deleteAvatarViaAPI(contentUserModel, '-me-');
|
||||
it('[C260120] Should not display profile image in UserInfo when deleted in ACS', async () => {
|
||||
await PeopleAPI.deleteAvatarViaAPI(contentUserModel, '-me-');
|
||||
|
||||
loginPage.goToLoginPage();
|
||||
await loginPage.loginToContentServicesUsingUserModel(contentUserModel);
|
||||
|
||||
settingsPage.setProviderEcm();
|
||||
loginPage.login(contentUserModel.id, contentUserModel.password);
|
||||
userInfoPage.clickUserProfile();
|
||||
|
||||
userInfoPage.checkInitialImage();
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedArchives = await uploadActions.uploadFolder(this.alfrescoJsApi, archiveFolderInfo.location, archiveFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
|
||||
@@ -80,8 +80,8 @@ describe('Viewer', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272813] Should be redirected to site when opening and closing a file in a site', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
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();
|
||||
@@ -103,7 +103,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedOthers = await uploadActions.uploadFolder(this.alfrescoJsApi, otherFolderInfo.location, otherFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedExcels = await uploadActions.uploadFolder(this.alfrescoJsApi, excelFolderInfo.location, excelFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
@@ -96,7 +96,7 @@ describe('Viewer', () => {
|
||||
uploadedExcels.forEach((currentFile) => {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
viewerPage.checkFileIsLoaded(currentFile.entry.name);
|
||||
viewerPage.clickCloseButton();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -89,7 +89,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedImgRenditionFolderInfo = await uploadActions.uploadFolder(this.alfrescoJsApi, imgRenditionFolderInfo.location, imgFolderRenditionUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
|
||||
@@ -30,6 +30,7 @@ import { AcsUserModel } from '../../../models/ACS/acsUserModel';
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Viewer', () => {
|
||||
|
||||
@@ -80,9 +81,11 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedPpt = await uploadActions.uploadFolder(this.alfrescoJsApi, pptFolderInfo.location, pptFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
browser.driver.sleep(15000);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -97,7 +100,7 @@ describe('Viewer', () => {
|
||||
uploadedPpt.forEach((currentFile) => {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
viewerPage.checkFileIsLoaded(currentFile.entry.name);
|
||||
viewerPage.clickCloseButton();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedTexts = await uploadActions.uploadFolder(this.alfrescoJsApi, textFolderInfo.location, textFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('Viewer', () => {
|
||||
|
||||
uploadedWords = await uploadActions.uploadFolder(this.alfrescoJsApi, wordFolderInfo.location, wordFolderUploaded.entry.id);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
done();
|
||||
|
||||
@@ -80,8 +80,8 @@ describe('Info Drawer', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
beforeEach(async() => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
navigationBarPage.goToSite(site);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
|
||||
@@ -111,7 +111,7 @@ describe('Content Services Viewer', () => {
|
||||
const unsupportedFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, unsupportedFile.location, unsupportedFile.name, '-my-');
|
||||
Object.assign(unsupportedFile, unsupportedFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
@@ -383,11 +383,9 @@ describe('Content Services Viewer', () => {
|
||||
viewerPage.clickCloseButton();
|
||||
});
|
||||
|
||||
it('[C269109] Should not be able to open thumbnail pane before the pdf is loaded', () => {
|
||||
it('[C269109] Should not be able to open thumbnail panel before the pdf is loaded', () => {
|
||||
viewerPage.viewFile(pdfFile.name);
|
||||
|
||||
browser.driver.sleep(3000); // wait open file
|
||||
|
||||
viewerPage.checkThumbnailsBtnIsDisabled();
|
||||
|
||||
viewerPage.checkCloseButtonIsDisplayed();
|
||||
|
||||
@@ -57,7 +57,7 @@ describe('Viewer', () => {
|
||||
|
||||
txtFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileInfo.location, txtFileInfo.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('Viewer', () => {
|
||||
|
||||
jsFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, jsFileInfo.location, jsFileInfo.name, '-my-');
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -88,7 +88,6 @@ describe('Viewer', () => {
|
||||
describe('Viewer extension', () => {
|
||||
|
||||
it('[C297698] Should be able to add an extension for code editor viewer', () => {
|
||||
navigationBarPage.checkAboutButtonIsDisplayed();
|
||||
navigationBarPage.clickAboutButton();
|
||||
|
||||
monacoExtensionPage.checkMonacoPluginIsDisplayed();
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('Viewer - properties', () => {
|
||||
pngFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, fileForOverlay.location, fileForOverlay.name, '-my-');
|
||||
Object.assign(fileForOverlay, pngFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import resources = require('../../util/resources');
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { StringUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
@@ -98,16 +98,16 @@ describe('Viewer', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
beforeEach(async () => {
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
});
|
||||
|
||||
it('[C260105] Should be able to open an image file shared via API', () => {
|
||||
browser.get(TestConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
|
||||
viewerPage.checkImgContainerIsDisplayed();
|
||||
browser.get(TestConfig.adf.url);
|
||||
BrowserActions.getUrl(TestConfig.adf.url);
|
||||
navigationBarPage.clickLogoutButton();
|
||||
browser.get(TestConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
|
||||
BrowserActions.getUrl(TestConfig.adf.url + '/preview/s/' + pngFileShared.entry.id);
|
||||
viewerPage.checkImgContainerIsDisplayed();
|
||||
});
|
||||
|
||||
@@ -122,13 +122,13 @@ describe('Viewer', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
const sharedLink = await shareDialog.getShareLink();
|
||||
|
||||
await browser.get(sharedLink);
|
||||
await BrowserActions.getUrl(sharedLink);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
|
||||
|
||||
await browser.get(TestConfig.adf.url);
|
||||
await BrowserActions.getUrl(TestConfig.adf.url);
|
||||
navigationBarPage.clickLogoutButton();
|
||||
await browser.get(sharedLink);
|
||||
await BrowserActions.getUrl(sharedLink);
|
||||
viewerPage.checkFileIsLoaded();
|
||||
viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('Analytics Smoke Test', () => {
|
||||
|
||||
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(procUserModel);
|
||||
await loginPage.loginToProcessServicesUsingUserModel(procUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { ElementFinder } from 'protractor/built/element';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
@@ -33,134 +34,111 @@ export class CardViewComponentPage {
|
||||
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`));
|
||||
selectedValue = element(by.css('.mat-select-value-text span'));
|
||||
listContent = element(by.css('.mat-select-panel'));
|
||||
editableSwitch = element(by.id('adf-toggle-editable'));
|
||||
|
||||
clickOnAddButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.addButton);
|
||||
this.addButton.click();
|
||||
BrowserActions.click(this.addButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnResetButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.resetButton);
|
||||
this.resetButton.click();
|
||||
BrowserActions.click(this.resetButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnTextField() {
|
||||
const toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
BrowserActions.click(toggleText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.textField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnTextClearIcon() {
|
||||
const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
clickOnTextSaveIcon() {
|
||||
const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
getTextFieldText() {
|
||||
const textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
enterTextField(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.textField);
|
||||
this.textField.sendKeys('');
|
||||
this.textField.clear();
|
||||
this.textField.sendKeys(text);
|
||||
BrowserActions.clearSendKeys(this.textField, text);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnIntField() {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
BrowserActions.click(toggleText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnIntClearIcon() {
|
||||
const clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
clickOnIntSaveIcon() {
|
||||
const saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
enterIntField(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
this.intField.sendKeys('');
|
||||
this.intField.clear();
|
||||
this.intField.sendKeys(text);
|
||||
BrowserActions.clearSendKeys(this.intField, text);
|
||||
return this;
|
||||
}
|
||||
|
||||
getIntFieldText() {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt() {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
clickOnFloatField() {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(toggleText);
|
||||
toggleText.click();
|
||||
BrowserActions.click(toggleText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnFloatClearIcon() {
|
||||
const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(clearIcon);
|
||||
return clearIcon.click();
|
||||
BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
clickOnFloatSaveIcon() {
|
||||
const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(saveIcon);
|
||||
return saveIcon.click();
|
||||
BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
enterFloatField(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
this.floatField.sendKeys('');
|
||||
this.floatField.clear();
|
||||
this.floatField.sendKeys(text);
|
||||
BrowserActions.clearSendKeys(this.floatField, text);
|
||||
return this;
|
||||
}
|
||||
|
||||
getFloatFieldText() {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat() {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(errorElement);
|
||||
return errorElement.getText();
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
setName(name) {
|
||||
@@ -181,48 +159,29 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getOutputText(index) {
|
||||
return this.consoleLog.all(by.css('p')).get(index).getText();
|
||||
return BrowserActions.getText(this.consoleLog.all(by.css('p')).get(index));
|
||||
}
|
||||
|
||||
deletePairsValues() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.deleteButton);
|
||||
this.deleteButton.click();
|
||||
BrowserActions.click(this.deleteButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkNameAndValueVisibility(index) {
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(this.getKeyValueRow(index));
|
||||
return this;
|
||||
}
|
||||
|
||||
getKeyValueRow(index) {
|
||||
return element.all(by.css(this.keyValueRow)).get(index);
|
||||
|
||||
}
|
||||
|
||||
getMatSelectValue(index) {
|
||||
return element.all(by.className(this.selectValue)).get(index);
|
||||
}
|
||||
|
||||
clickSelectBox() {
|
||||
this.select.click();
|
||||
BrowserActions.click(this.select);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.listContent);
|
||||
}
|
||||
|
||||
checkboxClick() {
|
||||
this.checkbox.click();
|
||||
BrowserActions.click(this.checkbox);
|
||||
}
|
||||
|
||||
selectValueFromComboBox(index) {
|
||||
const value = this.getMatSelectValue(index).click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(value);
|
||||
const value: ElementFinder = element.all(by.className(this.selectValue)).get(index);
|
||||
BrowserActions.click(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
getSelectionValue() {
|
||||
return this.selectedValue.getText();
|
||||
}
|
||||
|
||||
disableEdit() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.editableSwitch);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import { TabsPage } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
@@ -32,28 +32,25 @@ export class CommentsPage {
|
||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
|
||||
getTotalNumberOfComments() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.numberOfComments);
|
||||
return this.numberOfComments.getText();
|
||||
return BrowserActions.getText(this.numberOfComments);
|
||||
}
|
||||
|
||||
checkUserIconIsDisplayed(position) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon.first());
|
||||
return this.commentUserIcon.get(position);
|
||||
}
|
||||
|
||||
getUserName(position) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentUserName);
|
||||
return this.commentUserName.get(position).getText();
|
||||
return BrowserActions.getText(this.commentUserName.get(position));
|
||||
}
|
||||
|
||||
getMessage(position) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentMessage);
|
||||
return this.commentMessage.get(position).getText();
|
||||
return BrowserActions.getText(this.commentMessage.get(position));
|
||||
|
||||
}
|
||||
|
||||
getTime(position) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentTime);
|
||||
return this.commentTime.get(position).getText();
|
||||
return BrowserActions.getText(this.commentTime.get(position));
|
||||
}
|
||||
|
||||
checkCommentInputIsNotDisplayed() {
|
||||
@@ -63,7 +60,7 @@ export class CommentsPage {
|
||||
addComment(comment) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.commentInput);
|
||||
this.commentInput.sendKeys(comment);
|
||||
return this.addCommentButton.click();
|
||||
BrowserActions.click(this.addCommentButton);
|
||||
}
|
||||
|
||||
checkCommentsTabIsSelected() {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class ConfigEditorPage {
|
||||
|
||||
@@ -27,74 +27,13 @@ export class ConfigEditorPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
enterBigConfigurationText(text) {
|
||||
const textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(textField);
|
||||
|
||||
browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + text + '`)');
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSaveButton() {
|
||||
const saveButton = element(by.id('adf-configuration-save'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(saveButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(saveButton);
|
||||
return saveButton.click();
|
||||
BrowserActions.click(saveButton);
|
||||
}
|
||||
|
||||
clickClearButton() {
|
||||
const clearButton = element(by.id('adf-configuration-clear'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(clearButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(clearButton);
|
||||
return clearButton.click();
|
||||
}
|
||||
|
||||
clickFileConfiguration() {
|
||||
const button = element(by.id('adf-file-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickSearchConfiguration() {
|
||||
const button = element(by.id('adf-search-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickProcessListCloudConfiguration() {
|
||||
const button = element(by.id('adf-process-list-cloud-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickEditProcessCloudConfiguration() {
|
||||
const button = element(by.id('adf-edit-process-filter-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickEditTaskConfiguration() {
|
||||
const button = element(by.id('adf-edit-task-filter-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickTaskListCloudConfiguration() {
|
||||
const button = element(by.id('adf-task-list-cloud-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickInfinitePaginationConfiguration() {
|
||||
const button = element(by.id('adf-infinite-pagination-conf'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(button);
|
||||
BrowserVisibility.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
BrowserActions.click(clearButton);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class BreadCrumbDropdownPage {
|
||||
|
||||
@@ -27,13 +27,12 @@ export class BreadCrumbDropdownPage {
|
||||
choosePath(pathName) {
|
||||
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
|
||||
pathName));
|
||||
BrowserVisibility.waitUntilElementIsVisible(path);
|
||||
return path.click();
|
||||
BrowserActions.click(path);
|
||||
|
||||
}
|
||||
|
||||
clickParentFolder() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentFolder);
|
||||
return this.parentFolder.click();
|
||||
BrowserActions.click(this.parentFolder);
|
||||
}
|
||||
|
||||
checkBreadCrumbDropdownIsDisplayed() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class BreadCrumbPage {
|
||||
|
||||
@@ -24,9 +24,7 @@ export class BreadCrumbPage {
|
||||
|
||||
chooseBreadCrumb(breadCrumbItem) {
|
||||
const path = this.breadCrumb.element(by.css(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(path);
|
||||
return path.click();
|
||||
|
||||
BrowserActions.click(path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { by, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class NumberRangeFilterPage {
|
||||
|
||||
@@ -32,6 +32,7 @@ export class NumberRangeFilterPage {
|
||||
constructor(filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
clearFromField() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.fromInput));
|
||||
this.filter.element(this.fromInput).getAttribute('value').then((value) => {
|
||||
@@ -41,9 +42,11 @@ export class NumberRangeFilterPage {
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
getFromNumber() {
|
||||
return this.filter.element(this.fromInput).getAttribute('value');
|
||||
}
|
||||
|
||||
putFromNumber(value) {
|
||||
this.checkFromFieldIsDisplayed();
|
||||
this.filter.element(this.fromInput).clear();
|
||||
@@ -51,26 +54,33 @@ export class NumberRangeFilterPage {
|
||||
this.filter.element(this.fromInput).sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
}
|
||||
|
||||
getFromErrorRequired() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorRequired));
|
||||
return this.filter.element(this.fromErrorRequired).getText();
|
||||
return BrowserActions.getText(this.filter.element(this.fromErrorRequired));
|
||||
|
||||
}
|
||||
|
||||
checkFromErrorRequiredIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorRequired));
|
||||
return this;
|
||||
}
|
||||
|
||||
getFromErrorInvalid() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorInvalid));
|
||||
return this.filter.element(this.fromErrorInvalid).getText();
|
||||
return BrowserActions.getText(this.filter.element(this.fromErrorInvalid));
|
||||
}
|
||||
|
||||
checkFromErrorInvalidIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorInvalid));
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFromFieldIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromInput));
|
||||
return this;
|
||||
}
|
||||
|
||||
clearToField() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.toInput));
|
||||
this.filter.element(this.toInput).getAttribute('value').then((value) => {
|
||||
@@ -80,9 +90,11 @@ export class NumberRangeFilterPage {
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
getToNumber() {
|
||||
return this.filter.element(this.toInput).getAttribute('value');
|
||||
}
|
||||
|
||||
putToNumber(value) {
|
||||
this.checkToFieldIsDisplayed();
|
||||
this.filter.element(this.toInput).clear();
|
||||
@@ -90,47 +102,58 @@ export class NumberRangeFilterPage {
|
||||
this.filter.element(this.toInput).sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
}
|
||||
|
||||
getToErrorRequired() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorRequired));
|
||||
return this.filter.element(this.toErrorRequired).getText();
|
||||
return BrowserActions.getText(this.filter.element(this.toErrorRequired));
|
||||
}
|
||||
|
||||
checkToErrorRequiredIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorRequired));
|
||||
return this;
|
||||
}
|
||||
|
||||
getToErrorInvalid() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorInvalid));
|
||||
return this.filter.element(this.toErrorInvalid).getText();
|
||||
return BrowserActions.getText(this.filter.element(this.toErrorInvalid));
|
||||
}
|
||||
|
||||
checkToErrorInvalidIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorInvalid));
|
||||
return this;
|
||||
}
|
||||
|
||||
checkToFieldIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toInput));
|
||||
return this;
|
||||
}
|
||||
|
||||
clickApplyButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.applyButton));
|
||||
this.filter.element(this.applyButton).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkApplyButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.applyButton));
|
||||
return this;
|
||||
}
|
||||
|
||||
checkApplyButtonIsEnabled() {
|
||||
return this.filter.element(this.applyButton).isEnabled();
|
||||
}
|
||||
|
||||
clickClearButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.clearButton));
|
||||
this.filter.element(this.clearButton).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkClearButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.clearButton));
|
||||
return this;
|
||||
}
|
||||
|
||||
checkNoErrorMessageIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorInvalid));
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorRequired));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchCheckListPage {
|
||||
|
||||
@@ -33,9 +33,7 @@ export class SearchCheckListPage {
|
||||
clickCheckListOption(option) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='${option}'] .mat-checkbox-inner-container`)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(result);
|
||||
BrowserVisibility.waitUntilElementIsClickable(result);
|
||||
result.click();
|
||||
BrowserActions.click(result);
|
||||
}
|
||||
|
||||
checkChipIsDisplayed(option) {
|
||||
@@ -50,8 +48,7 @@ export class SearchCheckListPage {
|
||||
|
||||
removeFilterOption(option) {
|
||||
const cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon'));
|
||||
BrowserVisibility.waitUntilElementIsClickable(cancelChipButton);
|
||||
cancelChipButton.click();
|
||||
BrowserActions.click(cancelChipButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -161,7 +158,8 @@ export class SearchCheckListPage {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const result = this.filter.element(this.clearAllButton);
|
||||
BrowserVisibility.waitUntilElementIsVisible(result);
|
||||
return result.click();
|
||||
return BrowserActions.click(result);
|
||||
|
||||
}
|
||||
|
||||
getCheckListOptionsNumberOnPage() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchRadioPage {
|
||||
|
||||
@@ -64,13 +64,11 @@ export class SearchRadioPage {
|
||||
}
|
||||
|
||||
clickShowMoreButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.showMoreButton);
|
||||
return this.showMoreButton.click();
|
||||
return BrowserActions.click(this.showMoreButton);
|
||||
}
|
||||
|
||||
clickShowLessButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.showLessButton);
|
||||
return this.showLessButton.click();
|
||||
return BrowserActions.click(this.showLessButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchSortingPickerPage {
|
||||
|
||||
@@ -25,12 +25,9 @@ export class SearchSortingPickerPage {
|
||||
optionsDropdown = element(by.css('div[class*="mat-select-panel"]'));
|
||||
|
||||
sortBy(sortOrder, sortType) {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.sortingSelector);
|
||||
this.sortingSelector.click();
|
||||
|
||||
BrowserActions.click(this.sortingSelector);
|
||||
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType));
|
||||
BrowserVisibility.waitUntilElementIsClickable(selectedSortingOption);
|
||||
selectedSortingOption.click();
|
||||
BrowserActions.click(selectedSortingOption);
|
||||
|
||||
this.sortByOrder(sortOrder);
|
||||
}
|
||||
@@ -52,14 +49,12 @@ export class SearchSortingPickerPage {
|
||||
|
||||
clickSortingOption(option) {
|
||||
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
BrowserVisibility.waitUntilElementIsClickable(selectedSortingOption);
|
||||
selectedSortingOption.click();
|
||||
BrowserActions.click(selectedSortingOption);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSortingSelector() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.sortingSelector);
|
||||
this.sortingSelector.click();
|
||||
BrowserActions.click(this.sortingSelector);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { SearchRadioPage } from './components/search-radio';
|
||||
import { DateRangeFilterPage } from './components/dateRangeFilterPage';
|
||||
import { NumberRangeFilterPage } from './components/numberRangeFilterPage';
|
||||
import { SearchSliderPage } from './components/search-slider.page';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchCategoriesPage {
|
||||
|
||||
@@ -64,7 +64,7 @@ export class SearchCategoriesPage {
|
||||
clickFilterHeader(filter: ElementFinder) {
|
||||
const fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
||||
BrowserVisibility.waitUntilElementIsClickable(fileSizeFilterHeader);
|
||||
fileSizeFilterHeader.click();
|
||||
BrowserActions.click(fileSizeFilterHeader);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TreeViewPage {
|
||||
|
||||
@@ -36,8 +36,7 @@ export class TreeViewPage {
|
||||
|
||||
clickNode(nodeName) {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
BrowserVisibility.waitUntilElementIsClickable(node);
|
||||
return node.click();
|
||||
return BrowserActions.click(node);
|
||||
}
|
||||
|
||||
checkNodeIsDisplayedAsClosed(nodeName) {
|
||||
@@ -74,8 +73,7 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
addNodeId(nodeId) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.nodeIdInput);
|
||||
this.nodeIdInput.click();
|
||||
BrowserActions.click(this.nodeIdInput);
|
||||
this.nodeIdInput.clear();
|
||||
this.nodeIdInput.sendKeys(nodeId + ' ');
|
||||
this.nodeIdInput.sendKeys(protractor.Key.BACK_SPACE);
|
||||
|
||||
@@ -24,7 +24,8 @@ import { by, element, protractor, $$, browser } from 'protractor';
|
||||
|
||||
import path = require('path');
|
||||
import { DateUtil } from '../../util/dateUtil';
|
||||
import { BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, DocumentListPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from './navigationBarPage';
|
||||
|
||||
export class ContentServicesPage {
|
||||
|
||||
@@ -85,8 +86,7 @@ export class ContentServicesPage {
|
||||
multiSelectToggle = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
|
||||
|
||||
pressContextMenuActionNamed(actionName) {
|
||||
const actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
@@ -101,7 +101,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
closeActionContext() {
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -123,29 +123,29 @@ export class ContentServicesPage {
|
||||
deleteContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.deleteContentElement.click();
|
||||
BrowserActions.click(this.deleteContentElement);
|
||||
}
|
||||
|
||||
metadataContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.metadataAction.click();
|
||||
BrowserActions.click(this.metadataAction);
|
||||
}
|
||||
|
||||
versionManagerContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
this.versionManagerAction.click();
|
||||
BrowserActions.click(this.versionManagerAction);
|
||||
}
|
||||
|
||||
copyContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.copyContentElement.click();
|
||||
BrowserActions.click(this.copyContentElement);
|
||||
}
|
||||
|
||||
lockContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.lockContentElement.click();
|
||||
BrowserActions.click(this.lockContentElement);
|
||||
}
|
||||
|
||||
waitForContentOptions() {
|
||||
@@ -158,8 +158,7 @@ export class ContentServicesPage {
|
||||
clickFileHyperlink(fileName) {
|
||||
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
|
||||
|
||||
BrowserVisibility.waitUntilElementIsClickable(hyperlink);
|
||||
hyperlink.click();
|
||||
BrowserActions.click(hyperlink);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -171,8 +170,7 @@ export class ContentServicesPage {
|
||||
|
||||
clickHyperlinkNavigationToggle() {
|
||||
const hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(hyperlinkToggle);
|
||||
hyperlinkToggle.click();
|
||||
BrowserActions.click(hyperlinkToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -273,14 +271,14 @@ export class ContentServicesPage {
|
||||
expandRecentFiles() {
|
||||
this.checkRecentFileToBeShowed();
|
||||
this.checkRecentFileToBeClosed();
|
||||
this.recentFilesClosed.click();
|
||||
BrowserActions.click(this.recentFilesClosed);
|
||||
this.checkRecentFileToBeOpened();
|
||||
}
|
||||
|
||||
closeRecentFiles() {
|
||||
this.checkRecentFileToBeShowed();
|
||||
this.checkRecentFileToBeOpened();
|
||||
this.recentFilesExpanded.click();
|
||||
BrowserActions.click(this.recentFilesExpanded);
|
||||
this.checkRecentFileToBeClosed();
|
||||
}
|
||||
|
||||
@@ -293,29 +291,25 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getRecentFileIcon() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFileIcon);
|
||||
return this.recentFileIcon.getText();
|
||||
return BrowserActions.getText(this.recentFileIcon);
|
||||
}
|
||||
|
||||
checkAcsContainer() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
|
||||
return this;
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
this.contentList.waitForTableBody();
|
||||
async waitForTableBody() {
|
||||
await this.contentList.waitForTableBody();
|
||||
}
|
||||
|
||||
goToDocumentList() {
|
||||
this.clickOnContentServices();
|
||||
this.checkAcsContainer();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnContentServices() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.contentServices);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.contentServices);
|
||||
this.contentServices.click();
|
||||
BrowserActions.click(this.contentServices);
|
||||
}
|
||||
|
||||
numberOfResultsDisplayed() {
|
||||
@@ -396,14 +390,12 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
clickOnCreateNewFolder() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createFolderButton);
|
||||
this.createFolderButton.click();
|
||||
BrowserActions.click(this.createFolderButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
openCreateLibraryDialog() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createLibraryButton);
|
||||
this.createLibraryButton.click();
|
||||
BrowserActions.click(this.createLibraryButton);
|
||||
this.createLibraryDialog.waitForDialogToOpen();
|
||||
return this.createLibraryDialog;
|
||||
}
|
||||
@@ -500,29 +492,25 @@ export class ContentServicesPage {
|
||||
|
||||
enableInfiniteScrolling() {
|
||||
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(infiniteScrollButton);
|
||||
infiniteScrollButton.click();
|
||||
BrowserActions.click(infiniteScrollButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableCustomPermissionMessage() {
|
||||
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(customPermissionMessage);
|
||||
customPermissionMessage.click();
|
||||
BrowserActions.click(customPermissionMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableMediumTimeFormat() {
|
||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(mediumTimeFormat);
|
||||
mediumTimeFormat.click();
|
||||
BrowserActions.click(mediumTimeFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableThumbnails() {
|
||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(thumbnailSlide);
|
||||
thumbnailSlide.click();
|
||||
BrowserActions.click(thumbnailSlide);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -616,7 +604,7 @@ export class ContentServicesPage {
|
||||
|
||||
clickGridViewButton() {
|
||||
this.checkGridViewButtonIsVisible();
|
||||
this.gridViewButton.click();
|
||||
BrowserActions.click(this.gridViewButton);
|
||||
}
|
||||
|
||||
checkCardViewContainerIsDisplayed() {
|
||||
@@ -641,7 +629,7 @@ export class ContentServicesPage {
|
||||
|
||||
getAttributeValueForElement(elementName, propertyName) {
|
||||
const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
|
||||
return elementSize.getText();
|
||||
return BrowserActions.getText(elementSize);
|
||||
}
|
||||
|
||||
checkMenuIsShowedForElementIndex(elementIndex) {
|
||||
@@ -650,6 +638,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
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`));
|
||||
@@ -664,11 +653,11 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
selectGridSortingFromDropdown(sortingChosen) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const dropdownSorting = this.getGridViewSortingDropdown();
|
||||
dropdownSorting.click();
|
||||
BrowserActions.click(dropdownSorting);
|
||||
const optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
|
||||
BrowserVisibility.waitUntilElementIsPresent(optionToClick);
|
||||
optionToClick.click();
|
||||
BrowserActions.click(optionToClick);
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName) {
|
||||
@@ -677,8 +666,8 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
clickShareButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.shareNodeButton);
|
||||
this.shareNodeButton.click();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.shareNodeButton);
|
||||
}
|
||||
|
||||
checkSelectedSiteIsDisplayed(siteName) {
|
||||
@@ -686,13 +675,13 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
clickDownloadButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.downloadButton);
|
||||
this.downloadButton.click();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.downloadButton);
|
||||
}
|
||||
|
||||
clickMultiSelectToggle() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.multiSelectToggle);
|
||||
this.multiSelectToggle.click();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.multiSelectToggle);
|
||||
}
|
||||
|
||||
getRowByName(rowName) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class HeaderPage {
|
||||
|
||||
@@ -50,14 +50,14 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
clickShowMenuButton() {
|
||||
const checkBox = element.all(by.css('mat-checkbox'));
|
||||
const checkBox = element(by.css('mat-checkbox'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(checkBox);
|
||||
return checkBox.get(0).click();
|
||||
}
|
||||
|
||||
changeHeaderColor(color) {
|
||||
const headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
return headerColor.click();
|
||||
BrowserActions.click(headerColor);
|
||||
}
|
||||
|
||||
checkAppTitle(name) {
|
||||
@@ -66,8 +66,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addTitle(title) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
|
||||
this.titleInput.click();
|
||||
BrowserActions.click(this.titleInput);
|
||||
this.titleInput.sendKeys(title);
|
||||
this.titleInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
@@ -78,8 +77,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addIcon(url) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
|
||||
this.iconInput.click();
|
||||
BrowserActions.click(this.iconInput);
|
||||
this.iconInput.sendKeys(url);
|
||||
this.iconInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
@@ -97,35 +95,29 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addHexCodeColor(hexCode) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
|
||||
this.hexColorInput.click();
|
||||
BrowserActions.click(this.hexColorInput);
|
||||
this.hexColorInput.sendKeys(hexCode);
|
||||
return this.hexColorInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
addLogoHyperlink(hyperlink) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.logoHyperlinkInput);
|
||||
this.logoHyperlinkInput.click();
|
||||
BrowserActions.click(this.logoHyperlinkInput);
|
||||
this.logoHyperlinkInput.sendKeys(hyperlink);
|
||||
return this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
addLogoTooltip(tooltip) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
|
||||
this.logoTooltipInput.click();
|
||||
BrowserActions.click(this.logoTooltipInput);
|
||||
this.logoTooltipInput.sendKeys(tooltip);
|
||||
return this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
sideBarPositionStart() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.positionStart);
|
||||
return this.positionStart.click();
|
||||
BrowserActions.click(this.positionStart);
|
||||
}
|
||||
|
||||
sideBarPositionEnd() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.positionEnd);
|
||||
return this.positionEnd.click();
|
||||
BrowserActions.click(this.positionEnd);
|
||||
}
|
||||
|
||||
checkSidebarPositionStart() {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { element, by } from 'protractor';
|
||||
import { ElementFinder } from 'protractor/built/element';
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class InfinitePaginationPage {
|
||||
|
||||
@@ -31,16 +31,10 @@ export class InfinitePaginationPage {
|
||||
}
|
||||
|
||||
clickLoadMoreButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loadMoreButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.loadMoreButton);
|
||||
this.loadMoreButton.click();
|
||||
BrowserActions.click(this.loadMoreButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkLoadMoreButtonIsDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.loadMoreButton);
|
||||
}
|
||||
|
||||
checkLoadMoreButtonIsNotDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsNotOnPage(this.loadMoreButton);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { DataTableComponentPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../navigationBarPage';
|
||||
|
||||
const source = {
|
||||
@@ -57,13 +57,14 @@ export class CustomSources {
|
||||
this.navigationBarPage.navigateToCustomSources();
|
||||
this.waitForToolbarToBeVisible();
|
||||
}
|
||||
|
||||
clickOnSourceType() {
|
||||
return this.sourceTypeDropdown.click();
|
||||
BrowserActions.click(this.sourceTypeDropdown);
|
||||
}
|
||||
|
||||
selectMySitesSourceType() {
|
||||
this.clickOnSourceType();
|
||||
this.getSourceType(source.mySites).click();
|
||||
BrowserActions.click(this.getSourceType(source.mySites));
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName) {
|
||||
@@ -72,8 +73,7 @@ export class CustomSources {
|
||||
|
||||
getStatusCell(rowName) {
|
||||
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
|
||||
BrowserVisibility.waitUntilElementIsVisible(cell);
|
||||
return cell.getText();
|
||||
return BrowserActions.getText(cell);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
@@ -63,31 +63,27 @@ export class DataTablePage {
|
||||
}
|
||||
|
||||
addRow() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.addRowElement);
|
||||
this.addRowElement.click();
|
||||
BrowserActions.click(this.addRowElement);
|
||||
}
|
||||
|
||||
replaceRows(id) {
|
||||
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
|
||||
BrowserVisibility.waitUntilElementIsVisible(rowID);
|
||||
this.replaceRowsElement.click();
|
||||
BrowserActions.click(this.replaceRowsElement);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(rowID);
|
||||
}
|
||||
|
||||
replaceColumns() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.replaceColumnsElement);
|
||||
this.replaceColumnsElement.click();
|
||||
BrowserActions.click(this.replaceColumnsElement);
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(this.createdOnColumn);
|
||||
}
|
||||
|
||||
clickMultiSelect() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.multiSelect);
|
||||
this.multiSelect.click();
|
||||
BrowserActions.click(this.multiSelect);
|
||||
}
|
||||
|
||||
clickReset() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.reset);
|
||||
this.reset.click();
|
||||
BrowserActions.click(this.reset);
|
||||
}
|
||||
|
||||
checkRowIsNotSelected(rowNumber) {
|
||||
@@ -101,8 +97,7 @@ export class DataTablePage {
|
||||
}
|
||||
|
||||
checkAllRows() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectAll);
|
||||
this.selectAll.click();
|
||||
BrowserActions.click(this.selectAll);
|
||||
}
|
||||
|
||||
checkRowIsChecked(rowNumber) {
|
||||
@@ -118,17 +113,14 @@ export class DataTablePage {
|
||||
}
|
||||
|
||||
clickCheckbox(rowNumber) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
|
||||
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(checkbox);
|
||||
checkbox.click();
|
||||
BrowserActions.click(checkbox);
|
||||
}
|
||||
|
||||
selectRow(rowNumber) {
|
||||
const locator = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
BrowserVisibility.waitUntilElementIsClickable(locator);
|
||||
locator.click();
|
||||
async selectRow(rowNumber) {
|
||||
BrowserActions.clickExecuteScript(`div[title="${this.columns.id}"] div[data-automation-id="text_${rowNumber}"] span`);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -139,9 +131,8 @@ export class DataTablePage {
|
||||
|
||||
selectSelectionMode(selectionMode) {
|
||||
const selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
|
||||
this.selectionButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectMode.click();
|
||||
BrowserActions.clickExecuteScript('div[class="mat-select-arrow"]');
|
||||
BrowserActions.click(selectMode);
|
||||
}
|
||||
|
||||
getRowCheckbox(rowNumber) {
|
||||
@@ -194,8 +185,7 @@ export class DataTablePage {
|
||||
|
||||
pasteClipboard() {
|
||||
this.pasteClipboardInput.clear();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.pasteClipboardInput);
|
||||
this.pasteClipboardInput.click();
|
||||
BrowserActions.click(this.pasteClipboardInput);
|
||||
this.pasteClipboardInput.sendKeys(protractor.Key.chord(protractor.Key.SHIFT, protractor.Key.INSERT));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ export class LogoutPage {
|
||||
logoutSection = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
|
||||
checkLogoutSectionIsDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
*/
|
||||
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class PeopleGroupCloudComponentPage {
|
||||
|
||||
peopleCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"]'));
|
||||
peopleCloudSingleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="adf-people-single-mode"][class*="mat-radio-checked"]'));
|
||||
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"]'));
|
||||
@@ -32,7 +31,6 @@ export class PeopleGroupCloudComponentPage {
|
||||
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"]'));
|
||||
groupPreselect = element(by.css('input[data-automation-id="adf-group-preselect-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'));
|
||||
@@ -51,13 +49,7 @@ export class PeopleGroupCloudComponentPage {
|
||||
}
|
||||
|
||||
clickPeopleCloudMultipleSelection() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudMultipleSelection);
|
||||
this.peopleCloudMultipleSelection.click();
|
||||
}
|
||||
|
||||
clickPeopleCloudSingleSelection() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSingleSelection);
|
||||
this.peopleCloudSingleSelection.click();
|
||||
BrowserActions.click(this.peopleCloudMultipleSelection);
|
||||
}
|
||||
|
||||
checkPeopleCloudSingleSelectionIsSelected() {
|
||||
@@ -65,13 +57,11 @@ export class PeopleGroupCloudComponentPage {
|
||||
}
|
||||
|
||||
clickPeopleCloudFilterRole() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudFilterRole);
|
||||
this.peopleCloudFilterRole.click();
|
||||
BrowserActions.click(this.peopleCloudFilterRole);
|
||||
}
|
||||
|
||||
clickGroupCloudFilterRole() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.groupCloudFilterRole);
|
||||
this.groupCloudFilterRole.click();
|
||||
BrowserActions.click(this.groupCloudFilterRole);
|
||||
}
|
||||
|
||||
enterPeopleRoles(roles) {
|
||||
@@ -98,13 +88,11 @@ export class PeopleGroupCloudComponentPage {
|
||||
}
|
||||
|
||||
clickGroupCloudSingleSelection() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.groupCloudSingleSelection);
|
||||
this.groupCloudSingleSelection.click();
|
||||
BrowserActions.click(this.groupCloudSingleSelection);
|
||||
}
|
||||
|
||||
clickGroupCloudMultipleSelection() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.groupCloudMultipleSelection);
|
||||
this.groupCloudMultipleSelection.click();
|
||||
BrowserActions.click(this.groupCloudMultipleSelection);
|
||||
}
|
||||
|
||||
enterGroupRoles(roles) {
|
||||
@@ -115,8 +103,7 @@ export class PeopleGroupCloudComponentPage {
|
||||
}
|
||||
|
||||
clickPreselectValidation() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.preselectValidation);
|
||||
this.preselectValidation.click();
|
||||
BrowserActions.click(this.preselectValidation);
|
||||
}
|
||||
|
||||
getPreselectValidationStatus() {
|
||||
@@ -125,13 +112,11 @@ export class PeopleGroupCloudComponentPage {
|
||||
}
|
||||
|
||||
clickPeopleFilerByApp() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleFilterByAppName);
|
||||
return this.peopleFilterByAppName.click();
|
||||
return BrowserActions.click(this.peopleFilterByAppName);
|
||||
}
|
||||
|
||||
clickGroupFilerByApp() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.groupFilterByAppName);
|
||||
return this.groupFilterByAppName.click();
|
||||
return BrowserActions.click(this.groupFilterByAppName);
|
||||
}
|
||||
|
||||
enterPeopleAppName(appName) {
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersCloudComponentPage, EditProcessFilterCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ProcessFiltersCloudComponentPage,
|
||||
EditProcessFilterCloudComponentPage,
|
||||
ProcessListCloudComponentPage,
|
||||
BrowserActions
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class ProcessCloudDemoPage {
|
||||
|
||||
@@ -33,10 +38,6 @@ export class ProcessCloudDemoPage {
|
||||
processListCloud = new ProcessListCloudComponentPage();
|
||||
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
||||
|
||||
processFiltersCloudComponent(filter) {
|
||||
return new ProcessFiltersCloudComponentPage(filter);
|
||||
}
|
||||
|
||||
editProcessFilterCloudComponent() {
|
||||
return this.editProcessFilterCloud;
|
||||
}
|
||||
@@ -66,25 +67,17 @@ export class ProcessCloudDemoPage {
|
||||
}
|
||||
|
||||
getActiveFilterName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
||||
return this.activeFilter.getText();
|
||||
return BrowserActions.getText(this.activeFilter);
|
||||
}
|
||||
|
||||
clickOnProcessFilters() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processFilters);
|
||||
return this.processFilters.click();
|
||||
return BrowserActions.click(this.processFilters);
|
||||
}
|
||||
|
||||
openNewProcessForm() {
|
||||
this.createButtonIsDisplayed();
|
||||
this.clickOnCreateButton();
|
||||
this.newProcessButtonIsDisplayed();
|
||||
this.newProcessButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
createButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createButton);
|
||||
BrowserActions.click(this.newProcessButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -94,8 +87,7 @@ export class ProcessCloudDemoPage {
|
||||
}
|
||||
|
||||
clickOnCreateButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.createButton);
|
||||
this.createButton.click();
|
||||
BrowserActions.click(this.createButton);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { DataTableComponentPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
@@ -36,34 +36,29 @@ export class ProcessListDemoPage {
|
||||
}
|
||||
|
||||
selectSorting(sort) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
|
||||
this.sortSelector.click();
|
||||
BrowserActions.click(this.sortSelector);
|
||||
const sortLocator = element(by.cssContainingText('mat-option span', sort));
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortLocator);
|
||||
sortLocator.click();
|
||||
BrowserActions.click(sortLocator);
|
||||
return this;
|
||||
}
|
||||
|
||||
selectStateFilter(state) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
|
||||
this.stateSelector.click();
|
||||
BrowserActions.click(this.stateSelector);
|
||||
const stateLocator = element(by.cssContainingText('mat-option span', state));
|
||||
BrowserVisibility.waitUntilElementIsVisible(stateLocator);
|
||||
stateLocator.click();
|
||||
BrowserActions.click(stateLocator);
|
||||
return this;
|
||||
}
|
||||
|
||||
addAppId(appId) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.appIdInput);
|
||||
this.appIdInput.click();
|
||||
BrowserActions.click(this.appIdInput);
|
||||
this.appIdInput.sendKeys(protractor.Key.ENTER);
|
||||
this.appIdInput.clear();
|
||||
return this.appIdInput.sendKeys(appId);
|
||||
}
|
||||
|
||||
clickResetButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.resetButton);
|
||||
return this.resetButton.click();
|
||||
return BrowserActions.click(this.resetButton);
|
||||
|
||||
}
|
||||
|
||||
checkErrorMessageIsDisplayed(error) {
|
||||
@@ -104,15 +99,13 @@ export class ProcessListDemoPage {
|
||||
}
|
||||
|
||||
addProcessDefinitionId(procDefinitionId) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processDefinitionInput);
|
||||
this.processDefinitionInput.click();
|
||||
BrowserActions.click(this.processDefinitionInput);
|
||||
this.processDefinitionInput.clear();
|
||||
return this.processDefinitionInput.sendKeys(procDefinitionId);
|
||||
}
|
||||
|
||||
addProcessInstanceId(procInstanceId) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processInstanceInput);
|
||||
this.processInstanceInput.click();
|
||||
BrowserActions.click(this.processInstanceInput);
|
||||
this.processInstanceInput.clear();
|
||||
return this.processInstanceInput.sendKeys(procInstanceId);
|
||||
}
|
||||
|
||||
@@ -15,22 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { TaskHeaderCloudPage, TaskFormCloudComponent } from '@alfresco/adf-testing';
|
||||
import { TaskFormCloudComponent } from '@alfresco/adf-testing';
|
||||
|
||||
export class TaskDetailsCloudDemoPage {
|
||||
|
||||
taskHeaderCloudPage = new TaskHeaderCloudPage();
|
||||
taskFormCloudPage = new TaskFormCloudComponent();
|
||||
|
||||
taskDetailsHeader = element(by.css(`h4[data-automation-id='task-details-header']`));
|
||||
releaseButton = element(by.css('button[adf-cloud-unclaim-task]'));
|
||||
|
||||
taskHeaderCloud() {
|
||||
return this.taskHeaderCloudPage;
|
||||
}
|
||||
|
||||
taskFormCloud() {
|
||||
return this.taskFormCloudPage;
|
||||
}
|
||||
@@ -41,12 +36,10 @@ export class TaskDetailsCloudDemoPage {
|
||||
}
|
||||
|
||||
getTaskDetailsHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.taskDetailsHeader);
|
||||
return this.taskDetailsHeader.getText();
|
||||
return BrowserActions.getText(this.taskDetailsHeader);
|
||||
}
|
||||
|
||||
getReleaseButtonText() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.releaseButton);
|
||||
return this.releaseButton.getText();
|
||||
return BrowserActions.getText(this.releaseButton);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { TaskFiltersPage } from '../../process-services/taskFiltersPage';
|
||||
|
||||
@@ -28,10 +27,6 @@ export class TaskFiltersDemoPage {
|
||||
involvedTask = element(by.css('span[data-automation-id="Involved Tasks_filter"]'));
|
||||
activeFilter = element(by.css("mat-list-item[class*='active']"));
|
||||
|
||||
taskFiltersPage(filter) {
|
||||
return new TaskFiltersPage(filter);
|
||||
}
|
||||
|
||||
myTasksFilter() {
|
||||
return new TaskFiltersPage(this.myTasks);
|
||||
}
|
||||
@@ -53,8 +48,7 @@ export class TaskFiltersDemoPage {
|
||||
}
|
||||
|
||||
checkActiveFilterActive () {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
||||
return this.activeFilter.getText();
|
||||
return BrowserActions.getText(this.activeFilter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { TasksListPage } from '../../process-services/tasksListPage';
|
||||
import { PaginationPage } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TaskListDemoPage {
|
||||
|
||||
@@ -56,8 +56,7 @@ export class TaskListDemoPage {
|
||||
}
|
||||
|
||||
clickAppId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.appId);
|
||||
this.appId.click();
|
||||
BrowserActions.click(this.appId);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -97,11 +96,6 @@ export class TaskListDemoPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
getItemsPerPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPage);
|
||||
return this.itemsPerPage.getAttribute('value');
|
||||
}
|
||||
|
||||
typeProcessDefinitionId(input) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processDefinitionId);
|
||||
this.clearText(this.processDefinitionId);
|
||||
@@ -129,8 +123,7 @@ export class TaskListDemoPage {
|
||||
getItemsPerPageFieldErrorMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
|
||||
const errorMessage = this.itemsPerPageForm.element(by.css('mat-error'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(errorMessage);
|
||||
return errorMessage.getText();
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
typePage(input) {
|
||||
@@ -148,8 +141,7 @@ export class TaskListDemoPage {
|
||||
getPageFieldErrorMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
|
||||
const errorMessage = this.pageForm.element(by.css('mat-error'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(errorMessage);
|
||||
return errorMessage.getText();
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
typeDueAfter(input) {
|
||||
@@ -172,23 +164,19 @@ export class TaskListDemoPage {
|
||||
}
|
||||
|
||||
clickResetButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.resetButton);
|
||||
this.resetButton.click();
|
||||
BrowserActions.click(this.resetButton);
|
||||
}
|
||||
|
||||
selectSort(sort) {
|
||||
this.clickOnSortDropDownArrow();
|
||||
|
||||
const sortElement = element.all(by.cssContainingText('mat-option span', sort)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(sortElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortElement);
|
||||
sortElement.click();
|
||||
BrowserActions.click(sortElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnSortDropDownArrow() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.sortDropDownArrow);
|
||||
this.sortDropDownArrow.click();
|
||||
BrowserActions.click(this.sortDropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.sortSelector);
|
||||
}
|
||||
|
||||
@@ -196,15 +184,12 @@ export class TaskListDemoPage {
|
||||
this.clickOnStateDropDownArrow();
|
||||
|
||||
const stateElement = element.all(by.cssContainingText('mat-option span', state)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(stateElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(stateElement);
|
||||
stateElement.click();
|
||||
BrowserActions.click(stateElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnStateDropDownArrow() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.stateDropDownArrow);
|
||||
this.stateDropDownArrow.click();
|
||||
BrowserActions.click(this.stateDropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,14 @@
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { FormControllersPage, TaskFiltersCloudComponentPage, EditTaskFilterCloudComponentPage, BrowserVisibility, TaskListCloudComponentPage } from '@alfresco/adf-testing';
|
||||
import {
|
||||
FormControllersPage,
|
||||
TaskFiltersCloudComponentPage,
|
||||
EditTaskFilterCloudComponentPage,
|
||||
BrowserVisibility,
|
||||
TaskListCloudComponentPage,
|
||||
BrowserActions
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class TasksCloudDemoPage {
|
||||
|
||||
@@ -24,7 +31,6 @@ export class TasksCloudDemoPage {
|
||||
completedTasks = element(by.css('span[data-automation-id="completed-tasks-filter"]'));
|
||||
activeFilter = element(by.css("mat-list-item[class*='active'] span"));
|
||||
|
||||
taskFilters = element(by.css("mat-expansion-panel[data-automation-id='Task Filters']"));
|
||||
defaultActiveFilter = element.all(by.css('.adf-filters__entry')).first();
|
||||
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
@@ -77,49 +83,30 @@ export class TasksCloudDemoPage {
|
||||
}
|
||||
|
||||
getActiveFilterName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
||||
return this.activeFilter.getText();
|
||||
return BrowserActions.getText(this.activeFilter);
|
||||
}
|
||||
|
||||
customTaskFilter(filterName) {
|
||||
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
|
||||
}
|
||||
|
||||
clickOnTaskFilters() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.taskFilters);
|
||||
return this.taskFilters.click();
|
||||
}
|
||||
|
||||
openNewTaskForm() {
|
||||
this.createButtonIsDisplayed();
|
||||
this.clickOnCreateButton();
|
||||
this.newTaskButtonIsDisplayed();
|
||||
this.newTaskButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
createButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
newTaskButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.newTaskButton);
|
||||
BrowserActions.click(this.createButton);
|
||||
BrowserActions.click(this.newTaskButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnCreateButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.createButton);
|
||||
this.createButton.click();
|
||||
BrowserActions.click(this.createButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
firstFilterIsActive () {
|
||||
firstFilterIsActive() {
|
||||
return this.defaultActiveFilter.getAttribute('class').then((value) => value.includes('adf-active'));
|
||||
}
|
||||
|
||||
clickSettingsButton() {
|
||||
this.settingsButton.click();
|
||||
BrowserActions.click(this.settingsButton);
|
||||
browser.driver.sleep(400);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.multiSelectionToggle);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.modeDropDownArrow);
|
||||
@@ -128,8 +115,7 @@ export class TasksCloudDemoPage {
|
||||
}
|
||||
|
||||
clickAppButton() {
|
||||
this.appButton.click();
|
||||
this.createButtonIsDisplayed();
|
||||
BrowserActions.click(this.appButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -137,16 +123,12 @@ export class TasksCloudDemoPage {
|
||||
this.clickOnSelectionModeDropDownArrow();
|
||||
|
||||
const modeElement = element.all(by.cssContainingText('mat-option span', mode)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(modeElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(modeElement);
|
||||
modeElement.click();
|
||||
BrowserActions.click(modeElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnSelectionModeDropDownArrow() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.modeDropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.modeDropDownArrow);
|
||||
this.modeDropDownArrow.click();
|
||||
BrowserActions.click(this.modeDropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.modeSelector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateFolderDialog {
|
||||
folderNameField = element(by.id('adf-folder-name-input'));
|
||||
@@ -25,9 +25,7 @@ export class CreateFolderDialog {
|
||||
cancelButton = element(by.id('adf-folder-cancel-button'));
|
||||
|
||||
clickOnCreateButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createButton);
|
||||
this.createButton.click();
|
||||
return this;
|
||||
BrowserActions.click(this.createButton);
|
||||
}
|
||||
|
||||
checkCreateBtnIsDisabled() {
|
||||
@@ -42,23 +40,19 @@ export class CreateFolderDialog {
|
||||
}
|
||||
|
||||
clickOnCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
this.cancelButton.click();
|
||||
return this;
|
||||
BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
addFolderName(folderName) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.folderNameField);
|
||||
this.folderNameField.clear();
|
||||
this.folderNameField.sendKeys(folderName);
|
||||
BrowserActions.clearSendKeys(this.folderNameField, folderName);
|
||||
browser.driver.sleep(500);
|
||||
return this;
|
||||
}
|
||||
|
||||
addFolderDescription(folderDescription) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.folderDescriptionField);
|
||||
this.folderDescriptionField.clear();
|
||||
this.folderDescriptionField.sendKeys(folderDescription);
|
||||
BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { by, element, browser, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialog {
|
||||
libraryDialog = element(by.css('[role="dialog"]'));
|
||||
@@ -35,8 +35,7 @@ export class CreateLibraryDialog {
|
||||
|
||||
getSelectedRadio() {
|
||||
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(radio);
|
||||
return radio.getText();
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
waitForDialogToOpen() {
|
||||
@@ -54,7 +53,7 @@ export class CreateLibraryDialog {
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
return this.libraryTitle.getText();
|
||||
return BrowserActions.getText(this.libraryTitle);
|
||||
}
|
||||
|
||||
getLibraryIdText() {
|
||||
@@ -66,22 +65,20 @@ export class CreateLibraryDialog {
|
||||
}
|
||||
|
||||
getErrorMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorMessage);
|
||||
return this.errorMessage.getText();
|
||||
return BrowserActions.getText(this.errorMessage);
|
||||
}
|
||||
|
||||
getErrorMessages(position) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorMessages);
|
||||
return this.errorMessages.get(position).getText();
|
||||
return BrowserActions.getText(this.errorMessages.get(position));
|
||||
}
|
||||
|
||||
waitForLibraryNameHint() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.libraryNameHint);
|
||||
return this;
|
||||
}
|
||||
|
||||
getLibraryNameHint() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.libraryNameHint);
|
||||
return this.libraryNameHint.getText();
|
||||
return BrowserActions.getText(this.libraryNameHint);
|
||||
}
|
||||
|
||||
isNameDisplayed() {
|
||||
@@ -117,27 +114,23 @@ export class CreateLibraryDialog {
|
||||
}
|
||||
|
||||
clickCreate() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.createButton);
|
||||
this.createButton.click();
|
||||
BrowserActions.click(this.createButton);
|
||||
}
|
||||
|
||||
clickCancel() {
|
||||
this.cancelButton.click();
|
||||
BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
typeLibraryName(libraryName: string) {
|
||||
this.libraryNameField.clear();
|
||||
this.libraryNameField.sendKeys(libraryName);
|
||||
BrowserActions.clearSendKeys(this.libraryNameField, libraryName);
|
||||
}
|
||||
|
||||
typeLibraryId(libraryId) {
|
||||
this.libraryIdField.clear();
|
||||
this.libraryIdField.sendKeys(libraryId);
|
||||
BrowserActions.clearSendKeys(this.libraryIdField, libraryId);
|
||||
}
|
||||
|
||||
typeLibraryDescription(libraryDescription) {
|
||||
this.libraryDescriptionField.clear();
|
||||
this.libraryDescriptionField.sendKeys(libraryDescription);
|
||||
BrowserActions.clearSendKeys(this.libraryDescriptionField, libraryDescription);
|
||||
}
|
||||
|
||||
clearLibraryName() {
|
||||
@@ -150,20 +143,15 @@ export class CreateLibraryDialog {
|
||||
this.libraryIdField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
}
|
||||
|
||||
clearLibraryDescription() {
|
||||
this.libraryDescriptionField.clear();
|
||||
this.libraryDescriptionField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
}
|
||||
|
||||
selectPublic() {
|
||||
this.publicRadioButton.click();
|
||||
BrowserActions.click(this.publicRadioButton);
|
||||
}
|
||||
|
||||
selectPrivate() {
|
||||
this.privateRadioButton.click();
|
||||
BrowserActions.click(this.privateRadioButton);
|
||||
}
|
||||
|
||||
selectModerated() {
|
||||
this.moderatedRadioButton.click();
|
||||
BrowserActions.click(this.moderatedRadioButton);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchDialog {
|
||||
|
||||
@@ -35,8 +35,7 @@ export class SearchDialog {
|
||||
}
|
||||
|
||||
clickOnSearchIcon() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.searchIcon);
|
||||
this.searchIcon.click();
|
||||
BrowserActions.click(this.searchIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -69,14 +68,14 @@ export class SearchDialog {
|
||||
|
||||
enterText(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
browser.executeScript(`document.querySelector("adf-search-control input").click();`);
|
||||
BrowserActions.clickExecuteScript('adf-search-control input');
|
||||
this.searchBar.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
enterTextAndPressEnter(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
browser.executeScript(`document.querySelector("adf-search-control input").click();`);
|
||||
BrowserActions.clickExecuteScript('adf-search-control input');
|
||||
this.searchBar.sendKeys(text);
|
||||
this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
@@ -99,15 +98,15 @@ export class SearchDialog {
|
||||
}
|
||||
|
||||
getSpecificRowsHighlightName(name) {
|
||||
return this.getRowByRowName(name).element(this.highlightName).getText();
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.highlightName));
|
||||
}
|
||||
|
||||
getSpecificRowsCompleteName(name) {
|
||||
return this.getRowByRowName(name).element(this.completeName).getText();
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.completeName));
|
||||
}
|
||||
|
||||
getSpecificRowsAuthor(name) {
|
||||
return this.getRowByRowName(name).element(this.rowsAuthor).getText();
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.rowsAuthor));
|
||||
}
|
||||
|
||||
clearText() {
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, FormControllersPage } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, FormControllersPage, BrowserActions } from '@alfresco/adf-testing';
|
||||
import moment = require('moment');
|
||||
|
||||
export class ShareDialog {
|
||||
|
||||
@@ -25,7 +26,6 @@ export class ShareDialog {
|
||||
dialogTitle = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
shareToggleChecked = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
||||
shareToggleUnchecked = element(by.css('mat-dialog-container mat-slide-toggle:not(.mat-checked)'));
|
||||
shareToggleDisabled = element(by.css('mat-dialog-container mat-slide-toggle.mat-disabled'));
|
||||
shareLink = element(by.css('[data-automation-id="adf-share-link"]'));
|
||||
closeButton = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
||||
@@ -50,13 +50,11 @@ export class ShareDialog {
|
||||
}
|
||||
|
||||
clickConfirmationDialogCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.confirmationCancelButton);
|
||||
this.confirmationCancelButton.click();
|
||||
BrowserActions.click(this.confirmationCancelButton);
|
||||
}
|
||||
|
||||
clickConfirmationDialogRemoveButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.confirmationRemoveButton);
|
||||
this.confirmationRemoveButton.click();
|
||||
BrowserActions.click(this.confirmationRemoveButton);
|
||||
}
|
||||
|
||||
checkShareLinkIsDisplayed() {
|
||||
@@ -69,13 +67,12 @@ export class ShareDialog {
|
||||
}
|
||||
|
||||
clickCloseButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.closeButton);
|
||||
return this.closeButton.click();
|
||||
return BrowserActions.click(this.closeButton);
|
||||
|
||||
}
|
||||
|
||||
clickShareLinkButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.copySharedLinkButton);
|
||||
return this.copySharedLinkButton.click();
|
||||
return BrowserActions.click(this.copySharedLinkButton);
|
||||
}
|
||||
|
||||
shareToggleButtonIsChecked() {
|
||||
@@ -86,39 +83,35 @@ export class ShareDialog {
|
||||
BrowserVisibility.waitUntilElementIsPresent(this.shareToggleDisabled);
|
||||
}
|
||||
|
||||
shareToggleButtonIsUnchecked() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.shareToggleUnchecked);
|
||||
}
|
||||
|
||||
checkNotificationWithMessage(message) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(
|
||||
BrowserVisibility.waitUntilElementIsPresent(
|
||||
element(by.cssContainingText('simple-snack-bar', message))
|
||||
);
|
||||
}
|
||||
|
||||
waitForNotificationToClose() {
|
||||
BrowserVisibility.waitUntilElementIsStale(element(by.css('simple-snack-bar')));
|
||||
}
|
||||
|
||||
dialogIsClosed() {
|
||||
BrowserVisibility.waitUntilElementIsStale(this.shareDialog);
|
||||
}
|
||||
|
||||
clickDateTimePickerButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.timeDatePickerButton);
|
||||
this.timeDatePickerButton.click();
|
||||
BrowserActions.click(this.timeDatePickerButton);
|
||||
}
|
||||
|
||||
calendarTodayDayIsDisabled() {
|
||||
const today: any = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
|
||||
BrowserVisibility.waitUntilElementIsPresent(element(by.cssContainingText('.mat-datetimepicker-calendar-body-disabled', today)));
|
||||
const tomorrow = moment().add(1, 'days').format('D');
|
||||
|
||||
if (tomorrow !== '1') {
|
||||
const today: any = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
|
||||
BrowserVisibility.waitUntilElementIsPresent(element(by.cssContainingText('.mat-datetimepicker-calendar-body-disabled', today)));
|
||||
}
|
||||
}
|
||||
|
||||
setDefaultDay() {
|
||||
const selector = '.mat-datetimepicker-calendar-body-cell:not(.mat-datetimepicker-calendar-body-disabled)';
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dayPicker);
|
||||
const tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDate().toString();
|
||||
this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click();
|
||||
|
||||
const tomorrow = moment().add(1, 'days').format('MMM D, YYYY');
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.dayPicker.element(by.css(`td[aria-label="${tomorrow}"]`)));
|
||||
this.dayPicker.element(by.css(`td[aria-label="${tomorrow}"]`)).click();
|
||||
}
|
||||
|
||||
setDefaultHour() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadDialog {
|
||||
|
||||
@@ -31,7 +31,6 @@ export class UploadDialog {
|
||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
||||
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
||||
sizeUploaded = by.css('span[class="adf-file-uploading-row__status"]');
|
||||
canUploadConfirmationTitle = element(by.css('p[class="upload-dialog__confirmation--title"]'));
|
||||
canUploadConfirmationDescription = element(by.css('p[class="upload-dialog__confirmation--text"]'));
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
@@ -40,7 +39,7 @@ export class UploadDialog {
|
||||
|
||||
clickOnCloseButton() {
|
||||
this.checkCloseButtonIsDisplayed();
|
||||
this.closeButton.click();
|
||||
BrowserActions.click(this.closeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -97,8 +96,7 @@ export class UploadDialog {
|
||||
}
|
||||
|
||||
cancelUploads() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadsElement);
|
||||
this.cancelUploadsElement.click();
|
||||
BrowserActions.click(this.cancelUploadsElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -141,14 +139,12 @@ export class UploadDialog {
|
||||
}
|
||||
|
||||
clickOnConfirmationDialogYesButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialogYesButton);
|
||||
this.confirmationDialogYesButton.click();
|
||||
BrowserActions.click(this.confirmationDialogYesButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnConfirmationDialogNoButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialogNoButton);
|
||||
this.confirmationDialogNoButton.click();
|
||||
BrowserActions.click(this.confirmationDialogNoButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -173,14 +169,12 @@ export class UploadDialog {
|
||||
}
|
||||
|
||||
minimizeUploadDialog() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.minimizeButton);
|
||||
this.minimizeButton.click();
|
||||
BrowserActions.click(this.minimizeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
maximizeUploadDialog() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.maximizeButton);
|
||||
this.maximizeButton.click();
|
||||
BrowserActions.click(this.maximizeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -190,8 +184,7 @@ export class UploadDialog {
|
||||
}
|
||||
|
||||
getTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorTooltip);
|
||||
return this.errorTooltip.getText();
|
||||
return BrowserActions.getText(this.errorTooltip);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FilePreviewPage {
|
||||
|
||||
@@ -44,111 +44,23 @@ export class FilePreviewPage {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
checkCloseButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`i[id='viewer-close-button']`)));
|
||||
}
|
||||
|
||||
checkOriginalSizeButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`div[id='viewer-scale-page-button'] > i `, `zoom_out_map`)));
|
||||
}
|
||||
|
||||
checkZoomInButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-in-button']`)));
|
||||
|
||||
}
|
||||
|
||||
checkZoomOutButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-out-button']`)));
|
||||
}
|
||||
|
||||
checkPreviousPageButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[id='viewer-previous-page-button']`)));
|
||||
}
|
||||
|
||||
checkNextPageButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[id='viewer-next-page-button']`)));
|
||||
}
|
||||
|
||||
checkDownloadButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`button[id='viewer-download-button']`)));
|
||||
}
|
||||
|
||||
checkCurrentPageNumber(pageNumber) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`input[id='viewer-pagenumber-input'][ng-reflect-value="${pageNumber}"]`)));
|
||||
}
|
||||
|
||||
checkText(pageNumber, text) {
|
||||
const allPages = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
const pageLoaded = element(by.css(`div[id="pageContainer${pageNumber}"][data-loaded='true']`));
|
||||
const textLayerLoaded = element(by.css(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`));
|
||||
const specificText = element(by.cssContainingText(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`, text));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(allPages);
|
||||
BrowserVisibility.waitUntilElementIsVisible(pageLoaded);
|
||||
BrowserVisibility.waitUntilElementIsVisible(textLayerLoaded);
|
||||
BrowserVisibility.waitUntilElementIsVisible(specificText);
|
||||
}
|
||||
|
||||
goToNextPage() {
|
||||
const nextPageIcon = element(by.css(`div[id='viewer-next-page-button']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(nextPageIcon);
|
||||
nextPageIcon.click();
|
||||
}
|
||||
|
||||
goToPreviousPage() {
|
||||
const previousPageIcon = element(by.css(`div[id='viewer-previous-page-button']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(previousPageIcon);
|
||||
previousPageIcon.click();
|
||||
}
|
||||
|
||||
goToPage(page) {
|
||||
const pageInput = element(by.css(`input[id='viewer-pagenumber-input']`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(pageInput);
|
||||
pageInput.clear();
|
||||
pageInput.sendKeys(page);
|
||||
pageInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
closePreviewWithButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.closeButton);
|
||||
this.closeButton.click();
|
||||
}
|
||||
|
||||
closePreviewWithEsc(fileName) {
|
||||
const filePreview = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="text_${fileName}"]`, fileName)));
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(filePreview);
|
||||
}
|
||||
|
||||
clickDownload(fileName) {
|
||||
const downloadButton = element(by.css(`button[id='viewer-download-button']`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(downloadButton);
|
||||
downloadButton.click();
|
||||
BrowserActions.clickExecuteScript('button[data-automation-id="adf-toolbar-back"]');
|
||||
}
|
||||
|
||||
clickZoomIn() {
|
||||
const zoomInButton = element(by.css(`div[id='viewer-zoom-in-button']`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(zoomInButton);
|
||||
zoomInButton.click();
|
||||
BrowserActions.click(zoomInButton);
|
||||
}
|
||||
|
||||
clickZoomOut() {
|
||||
const zoomOutButton = element(by.css(`div[id='viewer-zoom-out-button']`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(zoomOutButton);
|
||||
zoomOutButton.click();
|
||||
BrowserActions.click(zoomOutButton);
|
||||
}
|
||||
|
||||
clickActualSize() {
|
||||
const actualSizeButton = element(by.css(`div[id='viewer-scale-page-button']`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(actualSizeButton);
|
||||
actualSizeButton.click();
|
||||
BrowserActions.click(actualSizeButton);
|
||||
}
|
||||
|
||||
checkCanvasWidth() {
|
||||
@@ -182,7 +94,7 @@ export class FilePreviewPage {
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then( (height) => {
|
||||
this.checkCanvasHeight().then((height) => {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
@@ -198,7 +110,7 @@ export class FilePreviewPage {
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then( (height) => {
|
||||
this.checkCanvasHeight().then((height) => {
|
||||
zoomedInHeight = height;
|
||||
if (actualHeight && zoomedInHeight) {
|
||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||
@@ -256,48 +168,4 @@ export class FilePreviewPage {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
zoomOut() {
|
||||
const canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||
const textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(canvasLayer);
|
||||
BrowserVisibility.waitUntilElementIsVisible(textLayer);
|
||||
|
||||
let actualWidth;
|
||||
let zoomedOutWidth;
|
||||
let actualHeight;
|
||||
let zoomedOutHeight;
|
||||
|
||||
this.checkCanvasWidth().then((width) => {
|
||||
actualWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then((height) => {
|
||||
actualHeight = height;
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
|
||||
this.clickZoomOut();
|
||||
|
||||
this.checkCanvasWidth().then((width) => {
|
||||
zoomedOutWidth = width;
|
||||
if (actualWidth && zoomedOutWidth) {
|
||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||
}
|
||||
});
|
||||
|
||||
this.checkCanvasHeight().then(() => {
|
||||
if (actualHeight && zoomedOutHeight) {
|
||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class LockFilePage {
|
||||
|
||||
cancelButton = element(by.css('button[data-automation-id="lock-dialog-btn-cancel"]'));
|
||||
cancelButton = element(by.css('button[data-automation-id="lock-dialog-btn-cancel"]'));
|
||||
saveButton = element(by.cssContainingText('button span', 'Save'));
|
||||
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
||||
lockFileCheckbox = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));
|
||||
@@ -39,22 +39,18 @@ export class LockFilePage {
|
||||
}
|
||||
|
||||
clickCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.cancelButton);
|
||||
return this.cancelButton.click();
|
||||
BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
clickLockFileCheckbox() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.lockFileCheckbox);
|
||||
return this.lockFileCheckbox.click();
|
||||
BrowserActions.click(this.lockFileCheckbox);
|
||||
}
|
||||
|
||||
clickSaveButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.saveButton);
|
||||
return this.saveButton.click();
|
||||
BrowserActions.click(this.saveButton);
|
||||
}
|
||||
|
||||
clickAllowOwnerCheckbox() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.allowOwnerCheckbox);
|
||||
return this.allowOwnerCheckbox.click();
|
||||
BrowserActions.click(this.allowOwnerCheckbox);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { DateUtil } from '../../../util/dateUtil';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class DatePickerPage {
|
||||
|
||||
@@ -56,15 +56,12 @@ export class DatePickerPage {
|
||||
selectTodayDate() {
|
||||
this.checkDatePickerIsDisplayed();
|
||||
const todayDate = element(by.css('.mat-calendar-body-today'));
|
||||
BrowserVisibility.waitUntilElementIsClickable(todayDate);
|
||||
todayDate.click();
|
||||
BrowserActions.click(todayDate);
|
||||
return this;
|
||||
}
|
||||
|
||||
closeDatePicker() {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
});
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
this.checkDatePickerIsNotDisplayed();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, by, element, promise } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
@@ -37,7 +37,6 @@ export class MetadataViewPage {
|
||||
informationButton = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
||||
informationSpan = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
||||
informationIcon = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`));
|
||||
rightChevron = element(by.css(`div[class*='header-pagination-after']`));
|
||||
displayEmptySwitch = element(by.id(`adf-metadata-empty`));
|
||||
readonlySwitch = element(by.id(`adf-metadata-readonly`));
|
||||
multiSwitch = element(by.id(`adf-metadata-multi`));
|
||||
@@ -48,77 +47,63 @@ export class MetadataViewPage {
|
||||
applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
|
||||
|
||||
getTitle(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.title);
|
||||
return this.title.getText();
|
||||
return BrowserActions.getText(this.title);
|
||||
}
|
||||
|
||||
getExpandedAspectName(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.expandedAspect);
|
||||
return this.expandedAspect.element(this.aspectTitle).getText();
|
||||
return BrowserActions.getText(this.expandedAspect.element(this.aspectTitle));
|
||||
}
|
||||
|
||||
getName(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.name);
|
||||
return this.name.getText();
|
||||
return BrowserActions.getText(this.name);
|
||||
}
|
||||
|
||||
getCreator(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.creator);
|
||||
return this.creator.getText();
|
||||
return BrowserActions.getText(this.creator);
|
||||
}
|
||||
|
||||
getCreatedDate(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createdDate);
|
||||
return this.createdDate.getText();
|
||||
return BrowserActions.getText(this.createdDate);
|
||||
}
|
||||
|
||||
getModifier(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.modifier);
|
||||
return this.modifier.getText();
|
||||
return BrowserActions.getText(this.modifier);
|
||||
}
|
||||
|
||||
getModifiedDate(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.modifiedDate);
|
||||
return this.modifiedDate.getText();
|
||||
return BrowserActions.getText(this.modifiedDate);
|
||||
}
|
||||
|
||||
getMimetypeName(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.mimetypeName);
|
||||
return this.mimetypeName.getText();
|
||||
return BrowserActions.getText(this.mimetypeName);
|
||||
}
|
||||
|
||||
getSize(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.size);
|
||||
return this.size.getText();
|
||||
return BrowserActions.getText(this.size);
|
||||
}
|
||||
|
||||
getDescription(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.description);
|
||||
return this.description.getText();
|
||||
return BrowserActions.getText(this.description);
|
||||
}
|
||||
|
||||
getAuthor(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.author);
|
||||
return this.author.getText();
|
||||
return BrowserActions.getText(this.author);
|
||||
}
|
||||
|
||||
getTitleProperty(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.titleProperty);
|
||||
return this.titleProperty.getText();
|
||||
getTitleProperty() {
|
||||
BrowserActions.getText(this.titleProperty);
|
||||
}
|
||||
|
||||
editIconIsDisplayed(): promise.Promise<boolean> {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconIsNotDisplayed(): promise.Promise<any> {
|
||||
return BrowserVisibility.waitUntilElementIsNotVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconClick(): promise.Promise<void> {
|
||||
editIconIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.editIcon);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.editIcon);
|
||||
return this.editIcon.click();
|
||||
}
|
||||
|
||||
editIconIsNotDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.editIcon);
|
||||
}
|
||||
|
||||
editIconClick() {
|
||||
BrowserActions.clickExecuteScript('button[data-automation-id="meta-data-card-toggle-edit"]');
|
||||
}
|
||||
|
||||
informationButtonIsDisplayed() {
|
||||
@@ -133,30 +118,22 @@ export class MetadataViewPage {
|
||||
clickOnInformationButton(): MetadataViewPage {
|
||||
this.informationButtonIsDisplayed();
|
||||
browser.sleep(600);
|
||||
this.informationButton.click();
|
||||
BrowserActions.click(this.informationButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
getInformationButtonText(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.informationSpan);
|
||||
return this.informationSpan.getText();
|
||||
return BrowserActions.getText(this.informationSpan);
|
||||
}
|
||||
|
||||
getInformationIconText(): promise.Promise<string> {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.informationIcon);
|
||||
return this.informationIcon.getText();
|
||||
return BrowserActions.getText(this.informationIcon);
|
||||
}
|
||||
|
||||
clickOnPropertiesTab(): MetadataViewPage {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(propertiesTab);
|
||||
propertiesTab.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickRightChevron(): MetadataViewPage {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.rightChevron);
|
||||
this.rightChevron.click();
|
||||
BrowserActions.click(propertiesTab);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -164,10 +141,6 @@ export class MetadataViewPage {
|
||||
return this.editIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
getInformationButtonTooltip(): promise.Promise<string> {
|
||||
return this.informationSpan.getAttribute('title');
|
||||
}
|
||||
|
||||
editPropertyIconIsDisplayed(propertyName: string) {
|
||||
const editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon);
|
||||
@@ -180,14 +153,12 @@ export class MetadataViewPage {
|
||||
|
||||
clickUpdatePropertyIcon(propertyName: string): promise.Promise<void> {
|
||||
const updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(updatePropertyIcon);
|
||||
return updatePropertyIcon.click();
|
||||
return BrowserActions.click(updatePropertyIcon);
|
||||
}
|
||||
|
||||
clickClearPropertyIcon(propertyName: string): promise.Promise<void> {
|
||||
const clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(clearPropertyIcon);
|
||||
return clearPropertyIcon.click();
|
||||
return BrowserActions.click(clearPropertyIcon);
|
||||
}
|
||||
|
||||
enterPropertyText(propertyName: string, text: string | number): MetadataViewPage {
|
||||
@@ -206,7 +177,7 @@ export class MetadataViewPage {
|
||||
presetField.clear();
|
||||
presetField.sendKeys(text);
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
applyButton.click();
|
||||
BrowserActions.click(applyButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -223,8 +194,7 @@ export class MetadataViewPage {
|
||||
const propertyType = type || 'textitem';
|
||||
const textField = element(by.css('span[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
|
||||
BrowserVisibility.waitUntilElementIsVisible(textField);
|
||||
return textField.getText();
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
clearPropertyIconIsDisplayed(propertyName: string) {
|
||||
@@ -234,8 +204,7 @@ export class MetadataViewPage {
|
||||
|
||||
clickEditPropertyIcons(propertyName: string) {
|
||||
const editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsClickable(editPropertyIcon);
|
||||
editPropertyIcon.click();
|
||||
BrowserActions.click(editPropertyIcon);
|
||||
}
|
||||
|
||||
getPropertyIconTooltip(propertyName: string): promise.Promise<string> {
|
||||
@@ -245,8 +214,7 @@ export class MetadataViewPage {
|
||||
|
||||
clickMetadataGroup(groupName: string) {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
group.click();
|
||||
BrowserActions.click(group);
|
||||
}
|
||||
|
||||
checkMetadataGroupIsPresent(groupName: string): promise.Promise<boolean> {
|
||||
@@ -273,8 +241,7 @@ export class MetadataViewPage {
|
||||
|
||||
getMetadataGroupTitle(groupName: string): promise.Promise<string> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
BrowserVisibility.waitUntilElementIsPresent(group);
|
||||
return group.getText();
|
||||
return BrowserActions.getText(group);
|
||||
}
|
||||
|
||||
checkPropertyIsVisible(propertyName: string, type: string) {
|
||||
@@ -288,8 +255,7 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
clickCloseButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.closeButton);
|
||||
this.closeButton.click();
|
||||
BrowserActions.click(this.closeButton);
|
||||
}
|
||||
|
||||
typeAspectName(aspectName) {
|
||||
@@ -299,7 +265,6 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
clickApplyAspect() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.applyAspect);
|
||||
this.applyAspect.click();
|
||||
BrowserActions.click(this.applyAspect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,24 +20,18 @@ import { ProcessServicesPage } from './process-services/processServicesPage';
|
||||
import { AppListCloudPage } from '@alfresco/adf-testing';
|
||||
import TestConfig = require('../../test.config');
|
||||
import { PeopleGroupCloudComponentPage } from './demo-shell/process-services/peopleGroupCloudComponentPage';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class NavigationBarPage {
|
||||
|
||||
linkListContainer = element(by.css('.adf-sidenav-linklist'));
|
||||
contentServicesButton = element(by.css('a[data-automation-id="Content Services"]'));
|
||||
dataTableButton = element(by.css('a[data-automation-id="Datatable"]'));
|
||||
dataTableNestedButton = element(by.css('button[data-automation-id="Datatable"]'));
|
||||
dataTableCopyContentButton = element(by.css('button[data-automation-id="Copy Content"]'));
|
||||
dataTableDragAndDropButton = element(by.css('button[data-automation-id="Drag and Drop"]'));
|
||||
taskListButton = element(by.css("a[data-automation-id='Task List']"));
|
||||
configEditorButton = element(by.css('a[data-automation-id="Configuration Editor"]'));
|
||||
processServicesButton = element(by.css('a[data-automation-id="Process Services"]'));
|
||||
processServicesNestedButton = element(by.css('button[data-automation-id="App"]'));
|
||||
processServicesCloudButton = element(by.css('a[data-automation-id="Process Cloud"]'));
|
||||
processServicesCloudHomeButton = element(by.css('button[data-automation-id="Home"]'));
|
||||
loginButton = element(by.css('a[data-automation-id="Login"]'));
|
||||
trashcanButton = element(by.css('a[data-automation-id="Trashcan"]'));
|
||||
overlayViewerButton = element(by.css('a[data-automation-id="Overlay Viewer"]'));
|
||||
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
|
||||
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
|
||||
@@ -45,156 +39,138 @@ export class NavigationBarPage {
|
||||
cardViewButton = element(by.cssContainingText('.adf-sidenav-menu-label', 'CardView'));
|
||||
languageMenuButton = element(by.css('button[data-automation-id="language-menu-button"]'));
|
||||
appTitle = element(by.css('.adf-app-title'));
|
||||
headerDataButton = element(by.css('a[data-automation-id="Header Data"]'));
|
||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
formButton = element(by.css('button[data-automation-id="Form"]'));
|
||||
treeViewButton = element(by.css('a[data-automation-id="Tree View"]'));
|
||||
iconsButton = element(by.css('a[data-automation-id="Icons"]'));
|
||||
customSourcesButton = element(by.css('a[data-automation-id="Custom Sources"]'));
|
||||
settingsButton = element(by.css('a[data-automation-id="Settings"]'));
|
||||
peopleGroupCloudButton = element(by.css('button[data-automation-id="People/Group Cloud"]'));
|
||||
aboutButton = element(by.css('a[data-automation-id="About"]'));
|
||||
tagButton = element.all(by.css('a[data-automation-id="Tag"]'));
|
||||
|
||||
clickTagButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.tagButton);
|
||||
this.tagButton.click();
|
||||
clickMenuButton(title) {
|
||||
BrowserActions.clickExecuteScript(`a[data-automation-id="${title}"]`);
|
||||
}
|
||||
|
||||
navigateToDatatable() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableButton);
|
||||
this.dataTableButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableNestedButton);
|
||||
this.dataTableNestedButton.click();
|
||||
async clickTagButton() {
|
||||
this.clickMenuButton('Tag');
|
||||
}
|
||||
|
||||
navigateToCopyContentDatatable() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableButton);
|
||||
this.dataTableButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableCopyContentButton);
|
||||
this.dataTableCopyContentButton.click();
|
||||
async navigateToDatatable() {
|
||||
this.clickMenuButton('Datatable');
|
||||
BrowserActions.click(this.dataTableNestedButton);
|
||||
}
|
||||
|
||||
navigateToDragAndDropDatatable() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableButton);
|
||||
this.dataTableButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dataTableDragAndDropButton);
|
||||
this.dataTableDragAndDropButton.click();
|
||||
async navigateToCopyContentDatatable() {
|
||||
this.clickMenuButton('Datatable');
|
||||
BrowserActions.click(this.dataTableCopyContentButton);
|
||||
}
|
||||
|
||||
clickContentServicesButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.contentServicesButton);
|
||||
this.contentServicesButton.click();
|
||||
async navigateToDragAndDropDatatable() {
|
||||
this.clickMenuButton('Datatable');
|
||||
BrowserActions.click(this.dataTableDragAndDropButton);
|
||||
}
|
||||
|
||||
clickTaskListButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.taskListButton);
|
||||
this.taskListButton.click();
|
||||
async clickContentServicesButton() {
|
||||
this.clickMenuButton('Content Services');
|
||||
}
|
||||
|
||||
clickConfigEditorButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.configEditorButton);
|
||||
this.configEditorButton.click();
|
||||
async clickTaskListButton() {
|
||||
this.clickMenuButton('Task List');
|
||||
}
|
||||
|
||||
async clickHomeButton() {
|
||||
this.clickMenuButton('Home');
|
||||
}
|
||||
|
||||
async clickConfigEditorButton() {
|
||||
this.clickMenuButton('Configuration Editor');
|
||||
}
|
||||
|
||||
navigateToProcessServicesPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesButton);
|
||||
this.processServicesButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesNestedButton);
|
||||
this.processServicesNestedButton.click();
|
||||
this.clickMenuButton('Process Services');
|
||||
BrowserActions.click(this.processServicesNestedButton);
|
||||
return new ProcessServicesPage();
|
||||
}
|
||||
|
||||
navigateToProcessServicesCloudPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesCloudButton);
|
||||
this.processServicesCloudButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesCloudHomeButton);
|
||||
this.processServicesCloudHomeButton.click();
|
||||
this.clickMenuButton('Process Cloud');
|
||||
BrowserActions.click(this.processServicesCloudHomeButton);
|
||||
return new AppListCloudPage();
|
||||
}
|
||||
|
||||
navigateToPeopleGroupCloudPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesCloudButton);
|
||||
this.processServicesCloudButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleGroupCloudButton);
|
||||
this.peopleGroupCloudButton.click();
|
||||
this.clickMenuButton('Process Cloud');
|
||||
BrowserActions.click(this.peopleGroupCloudButton);
|
||||
return new PeopleGroupCloudComponentPage();
|
||||
}
|
||||
|
||||
navigateToSettingsPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.settingsButton);
|
||||
this.settingsButton.click();
|
||||
async navigateToSettingsPage() {
|
||||
this.clickMenuButton('Settings');
|
||||
return new AppListCloudPage();
|
||||
}
|
||||
|
||||
clickLoginButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loginButton);
|
||||
this.loginButton.click();
|
||||
async clickLoginButton() {
|
||||
this.clickMenuButton('Login');
|
||||
}
|
||||
|
||||
clickTrashcanButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.trashcanButton);
|
||||
this.trashcanButton.click();
|
||||
async clickTrashcanButton() {
|
||||
this.clickMenuButton('Trashcan');
|
||||
}
|
||||
|
||||
clickOverlayViewerButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.overlayViewerButton);
|
||||
this.overlayViewerButton.click();
|
||||
async clickOverlayViewerButton() {
|
||||
this.clickMenuButton('Overlay Viewer');
|
||||
return this;
|
||||
}
|
||||
|
||||
clickThemeButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.themeButton);
|
||||
this.themeButton.click();
|
||||
async clickThemeButton() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.themeButton);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.themeMenuContent);
|
||||
}
|
||||
|
||||
clickOnSpecificThemeButton(themeName) {
|
||||
async clickOnSpecificThemeButton(themeName) {
|
||||
const themeElement = element(by.css(`button[data-automation-id="${themeName}"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(themeElement);
|
||||
BrowserVisibility.waitUntilElementIsClickable(themeElement);
|
||||
themeElement.click();
|
||||
BrowserActions.click(themeElement);
|
||||
}
|
||||
|
||||
clickLogoutButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoutButton);
|
||||
this.logoutButton.click();
|
||||
async clickLogoutButton() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.logoutButton);
|
||||
}
|
||||
|
||||
clickCardViewButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cardViewButton);
|
||||
this.cardViewButton.click();
|
||||
async clickCardViewButton() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.cardViewButton);
|
||||
}
|
||||
|
||||
openContentServicesFolder(folderId) {
|
||||
return browser.get(TestConfig.adf.url + '/files/' + folderId);
|
||||
return BrowserActions.getUrl(TestConfig.adf.url + '/files/' + folderId);
|
||||
}
|
||||
|
||||
chooseLanguage(language) {
|
||||
const buttonLanguage = element(by.xpath(`//adf-language-menu//button[contains(text(), '${language}')]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(buttonLanguage);
|
||||
buttonLanguage.click();
|
||||
BrowserActions.click(buttonLanguage);
|
||||
}
|
||||
|
||||
openLanguageMenu() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.languageMenuButton);
|
||||
this.languageMenuButton.click();
|
||||
BrowserActions.click(this.languageMenuButton);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.appTitle);
|
||||
}
|
||||
|
||||
clickHeaderDataButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.headerDataButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.headerDataButton);
|
||||
return this.headerDataButton.click();
|
||||
async clickHeaderDataButton() {
|
||||
this.clickMenuButton('Header Data');
|
||||
}
|
||||
|
||||
clickAboutButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.aboutButton);
|
||||
return this.aboutButton.click();
|
||||
async clickAboutButton() {
|
||||
this.clickMenuButton('About');
|
||||
}
|
||||
|
||||
checkAboutButtonIsDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.aboutButton);
|
||||
async clickTreeViewButton() {
|
||||
this.clickMenuButton('Tree View');
|
||||
}
|
||||
|
||||
async navigateToIconsPage() {
|
||||
this.clickMenuButton('Icons');
|
||||
}
|
||||
|
||||
async navigateToCustomSources() {
|
||||
this.clickMenuButton('Custom Sources');
|
||||
}
|
||||
|
||||
checkMenuButtonIsDisplayed() {
|
||||
@@ -212,20 +188,17 @@ export class NavigationBarPage {
|
||||
|
||||
clickAppLogo(logoTitle) {
|
||||
const appLogo = element(by.css('a[title="' + logoTitle + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(appLogo);
|
||||
appLogo.click();
|
||||
BrowserActions.click(appLogo);
|
||||
}
|
||||
|
||||
clickAppLogoText() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.appTitle);
|
||||
this.appTitle.click();
|
||||
BrowserActions.click(this.appTitle);
|
||||
}
|
||||
|
||||
clickFormButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processServicesButton);
|
||||
this.processServicesButton.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.formButton);
|
||||
return this.formButton.click();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.processServicesButton);
|
||||
BrowserActions.click(this.formButton);
|
||||
}
|
||||
|
||||
checkLogoTooltip(logoTooltipTitle) {
|
||||
@@ -233,32 +206,17 @@ export class NavigationBarPage {
|
||||
BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||
}
|
||||
|
||||
openViewer(nodeId) {
|
||||
browser.get(TestConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
|
||||
async openViewer(nodeId) {
|
||||
await BrowserActions.getUrl(TestConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
|
||||
return this;
|
||||
}
|
||||
|
||||
goToSite(site) {
|
||||
browser.get(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
|
||||
async goToSite(site) {
|
||||
await BrowserActions.getUrl(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
|
||||
}
|
||||
|
||||
clickTreeViewButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.treeViewButton);
|
||||
this.treeViewButton.click();
|
||||
}
|
||||
|
||||
navigateToIconsPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.iconsButton);
|
||||
this.iconsButton.click();
|
||||
}
|
||||
|
||||
navigateToCustomSources() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.customSourcesButton);
|
||||
this.customSourcesButton.click();
|
||||
}
|
||||
|
||||
scrollTo(el: ElementFinder) {
|
||||
browser.executeScript(`return arguments[0].scrollTop = arguments[1].offsetTop`, this.linkListContainer.getWebElement(), el.getWebElement());
|
||||
async scrollTo(el: ElementFinder) {
|
||||
await browser.executeScript(`return arguments[0].scrollTop = arguments[1].offsetTop`, this.linkListContainer.getWebElement(), el.getWebElement());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser, until } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationPage {
|
||||
|
||||
@@ -33,18 +33,16 @@ export class NotificationPage {
|
||||
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
||||
|
||||
checkNotifyContains(message) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('simple-snack-bar', message)));
|
||||
BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||
return this;
|
||||
}
|
||||
|
||||
goToNotificationsPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.notificationsPage);
|
||||
this.notificationsPage.click();
|
||||
BrowserActions.click(this.notificationsPage);
|
||||
}
|
||||
|
||||
getConfigObject() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.notificationConfig);
|
||||
return this.notificationConfig.getText();
|
||||
return BrowserActions.getText(this.notificationConfig);
|
||||
}
|
||||
|
||||
checkNotificationSnackBarIsDisplayed() {
|
||||
@@ -77,28 +75,28 @@ export class NotificationPage {
|
||||
|
||||
selectHorizontalPosition(selectedItem) {
|
||||
const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
|
||||
this.horizontalPosition.click();
|
||||
BrowserActions.click(this.horizontalPosition);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectItem.click();
|
||||
BrowserActions.click(selectItem);
|
||||
}
|
||||
|
||||
selectVerticalPosition(selectedItem) {
|
||||
const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
|
||||
this.verticalPosition.click();
|
||||
BrowserActions.click(this.verticalPosition);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectItem.click();
|
||||
BrowserActions.click(selectItem);
|
||||
}
|
||||
|
||||
selectDirection(selectedItem) {
|
||||
const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
|
||||
this.direction.click();
|
||||
BrowserActions.click(this.direction);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectItem.click();
|
||||
BrowserActions.click(selectItem);
|
||||
}
|
||||
|
||||
clickNotificationButton() {
|
||||
const button = browser.wait(until.elementLocated(by.css('button[data-automation-id="notification-custom-config-button"]')));
|
||||
button.click();
|
||||
const button = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
BrowserActions.click(button);
|
||||
}
|
||||
|
||||
checkActionEvent() {
|
||||
@@ -107,8 +105,7 @@ export class NotificationPage {
|
||||
}
|
||||
|
||||
clickActionToggle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.actionToggle);
|
||||
this.actionToggle.click();
|
||||
BrowserActions.click(this.actionToggle);
|
||||
}
|
||||
|
||||
clickActionButton() {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import { DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
const column = {
|
||||
role: 'Role'
|
||||
@@ -26,11 +26,13 @@ const column = {
|
||||
|
||||
export class PermissionsPage {
|
||||
|
||||
dataTableComponentPage: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
addPermissionButton = element(by.css("button[data-automation-id='adf-add-permission-button']"));
|
||||
addPermissionDialog = element(by.css('adf-add-permission-dialog'));
|
||||
searchUserInput = element(by.id('searchInput'));
|
||||
searchResults = element.all(by.id('adf-search-results-content')).first();
|
||||
addButton = element(by.id('add-permission-dialog-confirm-button'));
|
||||
addButton = element(by.id('add-permission-dialog-confirm-button'));
|
||||
permissionInheritedButton = element.all(by.css("div[class='adf-inherit_permission_button'] button")).first();
|
||||
permissionInheritedButtonText = this.permissionInheritedButton.element(by.css('span'));
|
||||
noPermissions = element(by.css('div[id="adf-no-permissions-template"]'));
|
||||
@@ -42,8 +44,7 @@ export class PermissionsPage {
|
||||
closeButton = element(by.id('add-permission-dialog-close-button'));
|
||||
|
||||
clickCloseButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.closeButton);
|
||||
this.closeButton.click();
|
||||
BrowserActions.click(this.closeButton);
|
||||
}
|
||||
|
||||
checkAddPermissionButtonIsDisplayed() {
|
||||
@@ -51,8 +52,7 @@ export class PermissionsPage {
|
||||
}
|
||||
|
||||
clickAddPermissionButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.addPermissionButton);
|
||||
return this.addPermissionButton.click();
|
||||
BrowserActions.clickExecuteScript('button[data-automation-id="adf-add-permission-button"]');
|
||||
}
|
||||
|
||||
checkAddPermissionDialogIsDisplayed() {
|
||||
@@ -64,9 +64,7 @@ export class PermissionsPage {
|
||||
}
|
||||
|
||||
searchUserOrGroup(name) {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.searchUserInput);
|
||||
this.searchUserInput.clear();
|
||||
return this.searchUserInput.sendKeys(name);
|
||||
BrowserActions.clearSendKeys(this.searchUserInput, name);
|
||||
}
|
||||
|
||||
checkResultListIsDisplayed() {
|
||||
@@ -75,10 +73,8 @@ export class PermissionsPage {
|
||||
|
||||
clickUserOrGroup(name) {
|
||||
const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(userOrGroupName);
|
||||
userOrGroupName.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.addButton);
|
||||
return this.addButton.click();
|
||||
BrowserActions.click(userOrGroupName);
|
||||
return BrowserActions.click(this.addButton);
|
||||
}
|
||||
|
||||
checkUserOrGroupIsAdded(name) {
|
||||
@@ -96,13 +92,12 @@ export class PermissionsPage {
|
||||
}
|
||||
|
||||
clickPermissionInheritedButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.permissionInheritedButton);
|
||||
return this.permissionInheritedButton.click();
|
||||
return BrowserActions.click(this.permissionInheritedButton);
|
||||
|
||||
}
|
||||
|
||||
clickDeletePermissionButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.deletePermissionButton);
|
||||
return this.deletePermissionButton.click();
|
||||
return BrowserActions.click(this.deletePermissionButton);
|
||||
}
|
||||
|
||||
checkNoPermissionsIsDisplayed() {
|
||||
@@ -110,8 +105,7 @@ export class PermissionsPage {
|
||||
}
|
||||
|
||||
getPermissionInheritedButtonText() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.permissionInheritedButton);
|
||||
return this.permissionInheritedButtonText.getText();
|
||||
return BrowserActions.getText(this.permissionInheritedButton);
|
||||
}
|
||||
|
||||
checkPermissionsDatatableIsDisplayed() {
|
||||
@@ -120,31 +114,27 @@ export class PermissionsPage {
|
||||
|
||||
getRoleCellValue(rowName) {
|
||||
const locator = new DataTableComponentPage().getCellByRowContentAndColumn('Authority ID', rowName, column.role);
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
return locator.getText();
|
||||
return BrowserActions.getText(locator);
|
||||
}
|
||||
|
||||
clickRoleDropdown() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.roleDropdown);
|
||||
return this.roleDropdown.click();
|
||||
clickRoleDropdownByUserOrGroupName(name) {
|
||||
const row = this.dataTableComponentPage.getRow('Authority ID', name);
|
||||
return BrowserActions.click(row.element(by.id('adf-select-role-permission')));
|
||||
}
|
||||
|
||||
getRoleDropdownOptions() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.roleDropdownOptions);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.roleDropdownOptions.first());
|
||||
return this.roleDropdownOptions;
|
||||
}
|
||||
|
||||
selectOption(name) {
|
||||
const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(selectProcessDropdown);
|
||||
BrowserVisibility.waitUntilElementIsClickable(selectProcessDropdown);
|
||||
selectProcessDropdown.click();
|
||||
BrowserActions.click(selectProcessDropdown);
|
||||
return this;
|
||||
}
|
||||
|
||||
getAssignPermissionErrorText() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.assignPermissionError);
|
||||
return this.assignPermissionError.getText();
|
||||
return BrowserActions.getText(this.assignPermissionError);
|
||||
}
|
||||
|
||||
checkPermissionContainerIsDisplayed() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class AnalyticsPage {
|
||||
|
||||
@@ -27,16 +27,12 @@ export class AnalyticsPage {
|
||||
|
||||
getReport(title) {
|
||||
const reportTitle = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(reportTitle);
|
||||
reportTitle.click();
|
||||
BrowserActions.click(reportTitle);
|
||||
}
|
||||
|
||||
changeReportTitle(title) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.toolbarTitleContainer);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.toolbarTitleContainer);
|
||||
this.toolbarTitleContainer.click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.toolbarTitleInput);
|
||||
this.toolbarTitleInput.click();
|
||||
BrowserActions.click(this.toolbarTitleContainer);
|
||||
BrowserActions.click(this.toolbarTitleInput);
|
||||
this.clearReportTitle();
|
||||
this.toolbarTitleInput.sendKeys(title);
|
||||
this.toolbarTitleInput.sendKeys(protractor.Key.ENTER);
|
||||
@@ -54,8 +50,7 @@ export class AnalyticsPage {
|
||||
}
|
||||
|
||||
getReportTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.toolbarTitle);
|
||||
return this.toolbarTitle.getText();
|
||||
return BrowserActions.getText(this.toolbarTitle);
|
||||
}
|
||||
|
||||
checkNoReportMessage() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user