[ACS-5761] Demo Shell Cleanup (part 2) (#8807)

cleanup demo shell
This commit is contained in:
Denys Vuika
2023-08-10 22:18:21 +01:00
committed by GitHub
parent ca60b392d4
commit f201efd56a
203 changed files with 1005 additions and 10703 deletions

View File

@@ -1,354 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
WaitActions
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { LockFilePage } from '../../content-services/pages/lock-file.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { NodeEntry, NodesApi, SitesApi } from '@alfresco/js-api';
import CONSTANTS = require('../../util/constants');
describe('Lock File', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const lockFilePage = new LockFilePage();
const contentServices = new ContentServicesPage();
const adminUser = new UserModel();
const managerUser = new UserModel();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const waitActions = new WaitActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
const pngFileToLock = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path
});
const pngFileToLockAdmin = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_path
});
let site; let documentLibrary;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(adminUser);
await usersActions.createUser(managerUser);
await apiService.login(adminUser.username, adminUser.password);
const sitesApi = new SitesApi(apiService.getInstance());
site = await sitesApi.createSite({
title: StringUtil.generateRandomString(),
visibility: 'PRIVATE'
});
const resultNode = await nodesApi.listNodeChildren(site.entry.guid);
documentLibrary = resultNode.list.entries[0].entry.id;
await sitesApi.createSiteMembership(site.entry.id, {
id: managerUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
try {
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(site.entry.id, { permanent: true });
} catch (e) {
}
});
describe('Lock file interaction with the UI', () => {
let pngLockedUploadedFile: NodeEntry;
let pngUploadedFile: NodeEntry;
beforeAll(async () => {
pngLockedUploadedFile = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
await loginPage.login(adminUser.username, adminUser.password);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
await navigationBarPage.openContentServicesFolder(documentLibrary);
await contentServices.waitForTableBody();
});
afterEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
try {
await nodesApi.unlockNode(pngUploadedFile.entry.id);
await waitActions.nodeIsUnlock(pngUploadedFile.entry.id);
} catch (e) {
}
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
try {
await nodesApi.unlockNode(pngLockedUploadedFile.entry.id);
} catch (e) {
}
try {
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
} catch (e) {
}
try {
await uploadActions.deleteFileOrFolder(pngLockedUploadedFile.entry.id);
} catch (e) {
}
await navigationBarPage.clickLogoutButton();
});
it('[C286604] Should be able to open Lock file option by clicking the lock image', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.cancelButton.waitVisible();
await lockFilePage.saveButton.waitVisible();
});
it('[C286625] Should be able to click Cancel to cancel lock file operation', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.cancelButton.click();
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
it('[C286603] Should be able to click on Lock file checkbox and lock a file', async () => {
await contentServices.lockContent(pngFileToLock.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
await contentServices.checkLockedIcon(pngFileToLock.name);
});
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
await contentServices.checkLockedIcon(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
});
describe('Locked file without owner permissions', () => {
let pngUploadedFile: NodeEntry;
beforeEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
await loginPage.login(managerUser.username, managerUser.password);
await navigationBarPage.openContentServicesFolder(documentLibrary);
});
afterEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
try {
await nodesApi.unlockNode(pngUploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
} catch (error) {
}
await navigationBarPage.clickLogoutButton();
});
it('[C286610] Should not be able to delete a locked file', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
try {
await nodesApi.deleteNode(pngUploadedFile.entry.id);
} catch (error) {
await expect(error.status).toEqual(409);
}
});
it('[C286611] Should not be able to rename a locked file', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
try {
await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
} catch (error) {
await expect(error.status).toEqual(409);
}
});
it('[C286612] Should not be able to move a locked file', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
try {
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
} catch (error) {
await expect(error.status).toEqual(409);
}
});
it('[C286613] Should not be able to update a new version on a locked file', async () => {
await contentServices.lockContent(pngFileModel.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.saveButton.click();
try {
await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
} catch (error) {
await expect(error.status).toEqual(409);
}
});
});
describe('Locked file with owner permissions', () => {
let pngFileToBeLocked: NodeEntry;
let pngUploadedFile: NodeEntry;
beforeEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLockAdmin.location, pngFileToLockAdmin.name, documentLibrary);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
await loginPage.login(adminUser.username, adminUser.password);
await navigationBarPage.openContentServicesFolder(documentLibrary);
await contentServices.getDocumentList().dataTable.waitTillContentLoaded();
});
afterEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
try {
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(pngFileToBeLocked.entry.id);
} catch (e) {
}
await navigationBarPage.clickLogoutButton();
});
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);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.allowOwnerCheckbox.click();
await lockFilePage.saveButton.click();
try {
await apiService.login(adminUser.username, adminUser.password);
const response = await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
await expect(response.entry.modifiedAt.getTime()).toBeGreaterThan(response.entry.createdAt.getTime());
} catch (error) {
}
});
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);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.allowOwnerCheckbox.click();
await lockFilePage.saveButton.click();
try {
await apiService.login(adminUser.username, adminUser.password);
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
const movedFile = await nodesApi.getNode(pngUploadedFile.entry.id);
await expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
} catch (error) {
}
});
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => {
await contentServices.lockContent(pngFileToLockAdmin.name);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.allowOwnerCheckbox.click();
await lockFilePage.saveButton.click();
await contentServices.deleteContent(pngFileToBeLocked.entry.name);
await contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
});
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);
await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
await lockFilePage.allowOwnerCheckbox.click();
await lockFilePage.saveButton.click();
try {
const response = await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
await expect(response.entry.name).toEqual('My new name');
} catch (error) {
}
});
});
});

View File

@@ -22,7 +22,6 @@ import {
createApiService,
BrowserActions, Logger,
LoginPage,
NotificationHistoryPage,
PermissionActions,
SearchService,
StringUtil,
@@ -37,7 +36,7 @@ import { FolderModel } from '../../models/ACS/folder.model';
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { GroupsApi } from '@alfresco/js-api';
import { GroupsApi, NodeEntry } from '@alfresco/js-api';
describe('Permissions Component', () => {
@@ -56,7 +55,6 @@ describe('Permissions Component', () => {
const contentList = contentServicesPage.getDocumentList();
const viewerPage = new ViewerPage();
const metadataViewPage = new MetadataViewPage();
const notificationHistoryPage = new NotificationHistoryPage();
const uploadDialog = new UploadDialogPage();
let file;
const fileModel = new FileModel({
@@ -89,11 +87,11 @@ describe('Permissions Component', () => {
const roleContributorFolderModel = new FolderModel({ name: 'roleContributor' + StringUtil.generateRandomString() });
const roleEditorFolderModel = new FolderModel({ name: 'roleEditor' + StringUtil.generateRandomString() });
let roleConsumerFolder;
let roleCoordinatorFolder;
let roleContributorFolder;
let roleCollaboratorFolder;
let roleEditorFolder;
let roleConsumerFolder: NodeEntry;
let roleCoordinatorFolder: NodeEntry;
let roleContributorFolder: NodeEntry;
let roleCollaboratorFolder: NodeEntry;
let roleEditorFolder: NodeEntry;
beforeAll(async () => {
try {
@@ -305,11 +303,9 @@ describe('Permissions Component', () => {
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
await expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have access to do this.');
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await browser.sleep(3000);
await contentServicesPage.uploadFile(fileLocation);
await expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276996] Role Contributor', async () => {
@@ -324,7 +320,6 @@ describe('Permissions Component', () => {
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleContributor' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
@@ -351,7 +346,6 @@ describe('Permissions Component', () => {
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(fileLocation);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C277003] Role Collaborator', async () => {

View File

@@ -1,221 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
ApiUtil,
BrowserActions,
LocalStorageUtil,
LoginPage,
NotificationHistoryPage,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { SharedLinkEntry, SharedLinkPaging, SharedlinksApi } from '@alfresco/js-api';
import { CustomSourcesPage } from '../../core/pages/custom-sources.page';
describe('Share file', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const contentListPage = contentServicesPage.getDocumentList();
const shareDialog = new ShareDialogPage();
const navigationBarPage = new NavigationBarPage();
const customSourcesPage = new CustomSourcesPage();
const viewerPage = new ViewerPage();
const notificationHistoryPage = new NotificationHistoryPage();
let acsUser: UserModel;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const sharedLinksApi = new SharedlinksApi(apiService.getInstance());
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
let nodeId;
const waitForShareLink = async (nodeIdSharedFile: string) => {
const predicate = (sharedLinkPaging: SharedLinkPaging) => {
const sharedLink = sharedLinkPaging.list.entries.find((sharedLinkEntry: SharedLinkEntry) => sharedLinkEntry.entry.nodeId === nodeIdSharedFile);
return !!sharedLink;
};
const apiCall = async () => {
await apiService.login(acsUser.username, acsUser.password);
return sharedLinksApi.listSharedLinks();
};
return ApiUtil.waitForApi(apiCall, predicate, 10, 2000);
};
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
nodeId = pngUploadedFile.entry.id;
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(nodeId);
});
describe('Shared link dialog', () => {
beforeAll(async () => {
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentListPage.selectRow(pngFileModel.name);
await BrowserActions.closeMenuAndDialogs();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C286549] Should check automatically toggle button in Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await BrowserActions.closeMenuAndDialogs();
});
it('[C286544] Should display notification when clicking URL copy button', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
await BrowserActions.closeMenuAndDialogs();
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
});
it('[C286543] Should be possible to close Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
await BrowserActions.closeMenuAndDialogs();
});
it('[C286578] Should disable today option in expiration day calendar', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickExpireToggle();
await shareDialog.clickDateTimePickerButton();
await shareDialog.calendarTodayDayIsDisabled();
await BrowserActions.closeMenuAndDialogs();
});
it('[C310329] Should be possible to set expiry date only for link', async () => {
await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date'));
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickExpireToggle();
await shareDialog.setDefaultDay();
await shareDialog.dateTimePickerDialogIsClosed();
const value = await shareDialog.getExpirationDate();
await shareDialog.clickCloseButton();
await shareDialog.dialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.expirationDateInputHasValue(value);
await BrowserActions.closeMenuAndDialogs();
});
});
describe('Shared link preview', () => {
beforeEach(async () => {
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterEach(async () => {
await BrowserActions.getUrl('/');
await navigationBarPage.clickLogoutButton();
});
it('[C286565] Should open file when logged user access shared link', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
await shareDialog.clickCloseButton();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const secondSharedLink = await shareDialog.getShareLink();
await BrowserActions.closeMenuAndDialogs();
await expect(sharedLink).toEqual(secondSharedLink);
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C286539] Should open file when non-logged user access shared link', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
const sharedLink = await shareDialog.getShareLink();
await shareDialog.clickCloseButton();
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C260153] Should shared files listed in share files custom resources', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
await BrowserActions.closeMenuAndDialogs();
await waitForShareLink(nodeId);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectSharedLinksSourceType();
await customSourcesPage.checkRowIsDisplayed(pngFileModel.name);
});
});
});

View File

@@ -1,397 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { PermissionsPage } from '../../content-services/pages/permissions.page';
import {
createApiService,
BrowserActions, Logger,
LoginPage,
NotificationHistoryPage, SearchService,
StringUtil,
UploadActions,
UserModel,
UsersActions,
ViewerPage,
SnackbarPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { VersionManagePage } from '../../core/pages/version-manager.page';
import CONSTANTS = require('../../util/constants');
import { NodesApi, SitesApi } from '@alfresco/js-api';
describe('Permissions Component', () => {
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const searchService = new SearchService(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const permissionsPage = new PermissionsPage();
const viewerPage = new ViewerPage();
const navigationBarPage = new NavigationBarPage();
const metadataViewPage = new MetadataViewPage();
const notificationHistoryPage = new NotificationHistoryPage();
const snackbarPage = new SnackbarPage();
const uploadDialog = new UploadDialogPage();
const versionManagePage = new VersionManagePage();
const contentList = contentServicesPage.getDocumentList();
let publicSite;
let privateSite;
let folderName;
const fileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
});
const testFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const newVersionFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
let siteFolder;
let privateSiteFile;
const folderOwnerUser = new UserModel();
const consumerUser: UserModel = new UserModel();
const siteConsumerUser: UserModel = new UserModel();
const collaboratorUser: UserModel = new UserModel();
const contributorUser: UserModel = new UserModel();
const managerUser: UserModel = new UserModel();
const usersActions = new UsersActions(apiService);
beforeAll(async () => {
try {
await apiService.loginWithProfile('admin');
await usersActions.createUser(folderOwnerUser);
await usersActions.createUser(siteConsumerUser);
await usersActions.createUser(consumerUser);
await usersActions.createUser(contributorUser);
await usersActions.createUser(collaboratorUser);
await usersActions.createUser(managerUser);
await apiService.login(folderOwnerUser.username, folderOwnerUser.password);
const publicSiteName = `PUBLIC_TEST_SITE_${StringUtil.generateRandomString(5)}`;
const privateSiteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}`;
const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName };
const privateSiteBody = { visibility: 'PRIVATE', title: privateSiteName };
const sitesApi = new SitesApi(apiService.getInstance());
publicSite = await sitesApi.createSite(publicSiteBody);
privateSite = await sitesApi.createSite(privateSiteBody);
await sitesApi.createSiteMembership(publicSite.entry.id, {
id: siteConsumerUser.username,
role: CONSTANTS.CS_USER_ROLES.CONSUMER
});
await sitesApi.createSiteMembership(publicSite.entry.id, {
id: collaboratorUser.username,
role: CONSTANTS.CS_USER_ROLES.COLLABORATOR
});
await sitesApi.createSiteMembership(publicSite.entry.id, {
id: contributorUser.username,
role: CONSTANTS.CS_USER_ROLES.CONTRIBUTOR
});
await sitesApi.createSiteMembership(publicSite.entry.id, {
id: managerUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await sitesApi.createSiteMembership(privateSite.entry.id, {
id: managerUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
siteFolder = await uploadActions.createFolder(folderName, publicSite.entry.guid);
privateSiteFile = await uploadActions.uploadFile(fileModel.location, 'privateSite' + fileModel.name, privateSite.entry.guid);
await nodesApi.updateNode(privateSiteFile.entry.id,
{
permissions: {
locallySet: [{
authorityId: managerUser.username,
name: 'SiteConsumer',
accessStatus: 'ALLOWED'
}]
}
});
await uploadActions.uploadFile(fileModel.location, 'Site' + fileModel.name, siteFolder.entry.id);
// to sync user in acs
try {
await searchService.isUserSearchable(consumerUser);
} catch (e) {
Logger.error(`*****\n Failed to sync user \n*****`);
}
await browser.sleep(browser.params.testConfig.timeouts.index_search);
} catch (error) {
fail('Failed to setup site permission : ' + JSON.stringify(error, null, 2));
}
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(publicSite.entry.id, { permanent: true });
await sitesApi.deleteSite(privateSite.entry.id, { permanent: true });
});
describe('Role Site Dropdown', () => {
beforeAll(async () => {
await loginPage.login(folderOwnerUser.username, folderOwnerUser.password);
await BrowserActions.getUrl(browser.baseUrl + '/files/' + publicSite.entry.guid);
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C277002] Should display the Role Site dropdown', async () => {
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentList.rightClickOnRow(folderName);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionManagerDisplayed();
await permissionsPage.addPermissionButton.waitVisible();
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup(consumerUser.username);
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
await permissionsPage.addPermissionsDialog.clickUserOrGroup(consumerUser.firstName);
await permissionsPage.addPermissionsDialog.selectRole(consumerUser.fullName, 'Site Collaborator');
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(consumerUser.fullName)).toEqual('Site Collaborator');
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'Add button should be enabled');
await permissionsPage.addPermissionsDialog.clickAddButton();
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
await snackbarPage.waitForSnackBarToClose();
await permissionsPage.checkUserIsAdded(consumerUser.username);
await expect(await permissionsPage.getRoleCellValue(consumerUser.username)).toEqual(CONSTANTS.CS_USER_ROLES_I18N.COLLABORATOR);
await permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.username);
const roleDropdownOptions = permissionsPage.addPermissionsDialog.getRoleDropdownOptions();
await expect(await roleDropdownOptions.count()).toBe(4);
await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe(CONSTANTS.CS_USER_ROLES_I18N.COLLABORATOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe(CONSTANTS.CS_USER_ROLES_I18N.CONSUMER);
await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe(CONSTANTS.CS_USER_ROLES_I18N.CONTRIBUTOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe(CONSTANTS.CS_USER_ROLES_I18N.MANAGER);
});
});
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', () => {
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C276994] Role SiteConsumer', async () => {
await loginPage.login(siteConsumerUser.username, siteConsumerUser.password);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('Site' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(testFileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276997] Role SiteContributor', async () => {
await loginPage.login(contributorUser.username, contributorUser.password);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('Site' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277005] Role SiteCollaborator', async () => {
await loginPage.login(collaboratorUser.username, collaboratorUser.password);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('Site' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277006] Role SiteManager', async () => {
await loginPage.login(managerUser.username, managerUser.password);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.metadataContent('Site' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
await metadataViewPage.enterDescriptionText('newDescription');
await metadataViewPage.clickSaveMetadata();
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.deleteContent('Site' + fileModel.name);
await contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name);
});
});
describe('Roles: Private site and Manager User', () => {
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C277196] should a user with Manager permissions be able to upload a new version for the created file', async () => {
await loginPage.login(managerUser.username, managerUser.password);
await navigationBarPage.openContentServicesFolder(privateSite.entry.guid);
await contentServicesPage.versionManagerContent('privateSite' + fileModel.name);
await versionManagePage.showNewVersionButton.click();
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
});
});
});

View File

@@ -1,199 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 CONSTANTS = require('../../util/constants');
import { createApiService,
BrowserActions,
ErrorPage,
LoginPage,
NotificationHistoryPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { NodeEntry, NodesApi, SharedlinksApi, SitesApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
describe('Unshare file', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navBar = new NavigationBarPage();
const errorPage = new ErrorPage();
const notificationHistoryPage = new NotificationHistoryPage();
const navigationBarPage = new NavigationBarPage();
const shareDialog = new ShareDialogPage();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const sharedlinksApi = new SharedlinksApi(apiService.getInstance());
const siteName = `PRIVATE-TEST-SITE-${StringUtil.generateRandomString(5)}`;
let acsUser: UserModel;
let nodeBody; let shareFilesSite;
let pngUploadedFile: NodeEntry;
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
const site = {
title: siteName,
visibility: 'PRIVATE',
id: siteName
};
nodeBody = {
name: StringUtil.generateRandomString(5),
nodeType: 'cm:content',
properties: {
'cm:title': StringUtil.generateRandomString(5)
}
};
const sitesApi = new SitesApi(apiService.getInstance());
shareFilesSite = await sitesApi.createSite(site);
const docLibId = (await sitesApi.listSiteContainers(siteName)).list.entries[0].entry.id;
const testFile1Id = (await nodesApi.createNode(docLibId, nodeBody)).entry.id;
await sitesApi.createSiteMembership(siteName, {
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.CONSUMER
});
await nodesApi.updateNode(testFile1Id, {
permissions: {
isInheritanceEnabled: false,
locallySet: [
{
authorityId: acsUser.username,
name: CONSTANTS.CS_USER_ROLES.CONSUMER
}
]
}
});
await sharedlinksApi.createSharedLink({ nodeId: testFile1Id });
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(shareFilesSite.entry.id, { permanent: true });
});
describe('with permission', () => {
afterEach(async () => {
await apiService.loginWithProfile('admin');
await navigationBarPage.clickLogoutButton();
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
});
beforeEach(async () => {
await apiService.login(acsUser.username, acsUser.password);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await navBar.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
it('[C286551] Should be able to cancel unshare action', async () => {
await contentServicesPage.getDocumentList().selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogCancelButton();
await shareDialog.shareToggleButtonIsChecked();
});
it('[C286550] Should display unshare confirmation dialog', async () => {
await contentServicesPage.getDocumentList().selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await browser.sleep(2000);
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
});
it('[C286552] Should be able to confirm unshare action', async () => {
await contentServicesPage.getDocumentList().selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
});
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
await contentServicesPage.getDocumentList().selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await browser.sleep(2000);
const sharedLink = await shareDialog.getShareLink();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, `${browser.baseUrl}`));
await errorPage.checkErrorCode();
});
});
describe('without permission', () => {
beforeEach(async () => {
await loginPage.login(acsUser.username, acsUser.password);
});
it('[C286555] Should NOT be able to unshare file without permission', async () => {
await navBar.goToSite(shareFilesSite);
await contentServicesPage.openFolder('documentLibrary');
await contentServicesPage.getDocumentList().selectRow(nodeBody.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`);
});
});
});

View File

@@ -1,147 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
LoginPage,
NotificationHistoryPage,
StringUtil,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FolderDialogPage } from '../../core/pages/dialog/folder-dialog.page';
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { browser, Key } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
describe('Create folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const createFolderDialog = new FolderDialogPage();
const notificationHistoryPage = new NotificationHistoryPage();
const metadataViewPage = new MetadataViewPage();
let acsUser: UserModel;
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
});
afterEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
});
it('[C260154] Should not create the folder if cancel button is clicked', async () => {
const folderName = 'cancelFolder';
await contentServicesPage.clickOnCreateNewFolder();
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.clickOnCancelButton();
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C260155] Should enable the Create button only when a folder name is present', async () => {
const folderName = 'NotEnableFolder';
await contentServicesPage.clickOnCreateNewFolder();
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.checkCreateUpdateBtnIsEnabled();
});
it('[C260156] Should not be possible create two folder with the same name', async () => {
const folderName = 'duplicate';
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.createNewFolder(folderName);
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260157] Should be possible create a folder under a folder with the same name', async () => {
const folderName = 'sameSubFolder';
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260158] Should be possible add a folder description when create a new folder', async () => {
const folderName = StringUtil.generateRandomString();
const description = 'this is the description';
await contentServicesPage.clickOnCreateNewFolder();
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.addFolderDescription(description);
await createFolderDialog.clickOnCreateUpdateButton();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.metadataContent(folderName);
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
});
it('[C260159] Should not be possible create a folder with banned character', async () => {
await contentServicesPage.clickOnCreateNewFolder();
await createFolderDialog.addFolderName('*');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('<');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('>');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('\\');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('/');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('?');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName(':');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await createFolderDialog.addFolderName('|');
await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
});
});

View File

@@ -1,266 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService, BrowserActions, LoginPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { CreateLibraryDialogPage } from '../../core/pages/dialog/create-library-dialog.page';
import { CustomSourcesPage } from '../../core/pages/custom-sources.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { SitesApi } from '@alfresco/js-api';
describe('Create library directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const createLibraryDialog = new CreateLibraryDialogPage();
const customSourcesPage = new CustomSourcesPage();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const visibility = {
public: 'Public',
private: 'Private',
moderated: 'Moderated'
};
let createSite;
let acsUser: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
const sitesApi = new SitesApi(apiService.getInstance());
createSite = await sitesApi.createSite({
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PUBLIC'
});
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(createSite.entry.id, { permanent: true });
await navigationBarPage.clickLogoutButton();
});
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.openCreateLibraryDialog();
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C290158] Should display the Create Library defaults', async () => {
await expect(await createLibraryDialog.libraryTitle.getText()).toMatch('Create Library');
await expect(await createLibraryDialog.libraryNameField.isDisplayed()).toBe(true, 'Name input field is not displayed');
await expect(await createLibraryDialog.libraryIdField.isDisplayed()).toBe(true, 'Library ID field is not displayed');
await expect(await createLibraryDialog.libraryDescriptionField.isDisplayed()).toBe(true, 'Library description is not displayed');
await expect(await createLibraryDialog.publicRadioButton.isDisplayed()).toBe(true, 'Public radio button is not displayed');
await expect(await createLibraryDialog.privateRadioButton.isDisplayed()).toBe(true, 'Private radio button is not displayed');
await expect(await createLibraryDialog.moderatedRadioButton.isDisplayed()).toBe(true, 'Moderated radio button is not displayed');
await expect(await createLibraryDialog.createButton.isEnabled()).toBe(false, 'Create button is not disabled');
await expect(await createLibraryDialog.cancelButton.isEnabled()).toBe(true, 'Cancel button is disabled');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public');
});
it('[C290159] Should close the dialog when clicking Cancel button', async () => {
const libraryName = 'cancelLibrary';
await createLibraryDialog.libraryNameField.typeText(libraryName);
await createLibraryDialog.cancelButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
});
it('[C290160] Should create a public library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(libraryName);
await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription);
await createLibraryDialog.publicRadioButton.click();
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public');
await createLibraryDialog.createButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.');
});
it('[C290173] Should create a private library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(libraryName);
await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription);
await createLibraryDialog.privateRadioButton.click();
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private');
await createLibraryDialog.createButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.');
});
it('[C290174, C290175] Should create a moderated library with a given Library ID', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryId = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(libraryName);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription);
await createLibraryDialog.moderatedRadioButton.click();
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated');
await createLibraryDialog.createButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.');
});
it('[C290163] Should disable Create button when a mandatory field is not filled in', async () => {
const inputValue = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(inputValue);
await createLibraryDialog.libraryIdField.clearInput();
await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.libraryNameField.clearInput();
await createLibraryDialog.libraryIdField.typeText(inputValue);
await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.libraryIdField.clearInput();
await createLibraryDialog.libraryDescriptionField.typeText(inputValue);
await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled');
});
it('[C290164] Should auto-fill in the Library Id built from library name', async () => {
const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*'];
const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link'];
for (let i = 0; i < 3; i++) {
await createLibraryDialog.libraryNameField.typeText(name[i]);
await createLibraryDialog.libraryIdField.waitHasValue(libraryId[i]);
await createLibraryDialog.libraryNameField.clearInput();
}
});
it('[C290176] Should not accept special characters for Library Id', async () => {
const name = 'My Library';
const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>'];
await createLibraryDialog.libraryNameField.typeText(name);
for (let i = 0; i < 3; i++) {
await createLibraryDialog.libraryIdField.typeText(libraryId[i]);
await createLibraryDialog.errorMessage.waitVisible(60000);
await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Use numbers and letters only');
}
});
it('[C291985] Should not accept less than 2 characters for Library name', async () => {
const name = 'x';
const libraryId = 'my-library-id';
await createLibraryDialog.libraryNameField.typeText(name);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.errorMessage.waitVisible(60000);
await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Title must be at least 2 characters long');
});
it('[C291793] Should display error for Name field filled in with spaces only', async () => {
const name = ' ';
const libraryId = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(name);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.errorMessage.waitVisible(60000);
await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Library name can\'t contain only spaces');
});
it('[C290177] Should not accept a duplicate Library Id', async () => {
const name = 'My Library';
const libraryId = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(name);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.createButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
await contentServicesPage.openCreateLibraryDialog();
await createLibraryDialog.libraryNameField.typeText(name);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.errorMessage.waitVisible(60000);
await expect(await createLibraryDialog.errorMessage.getText()).toMatch('This Library ID isn\'t available. Try a different Library ID.');
});
it('[C290178] Should accept the same library name but different Library Ids', async () => {
const name = createSite.entry.title;
const libraryId = StringUtil.generateRandomString();
await createLibraryDialog.libraryNameField.typeText(name.toUpperCase());
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.libraryNameHint.waitVisible();
await expect(await createLibraryDialog.libraryNameHint.getText()).toMatch('Library name already in use', 'The library name hint is wrong');
await createLibraryDialog.createButton.click();
await createLibraryDialog.libraryDialog.waitNotPresent(60000);
});
it('[C290179] Should not accept more than the expected characters for input fields', async () => {
const name = StringUtil.generateRandomString(257);
const libraryId = StringUtil.generateRandomString(73);
const libraryDescription = StringUtil.generateRandomString(513);
await createLibraryDialog.libraryNameField.typeText(name);
await createLibraryDialog.libraryIdField.typeText(libraryId);
await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription);
await createLibraryDialog.publicRadioButton.click();
await expect(await createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title');
await expect(await createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name');
await expect(await createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description');
});
});

View File

@@ -1,271 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import { createApiService,
BrowserActions,
LoginPage,
PaginationPage,
PermissionActions,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { FolderModel } from '../../models/ACS/folder.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { SitesApi } from '@alfresco/js-api';
describe('Delete Directive', () => {
let baseFolderUploaded;
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const paginationPage = new PaginationPage();
const navigationBarPage = new NavigationBarPage();
const contentListPage = contentServicesPage.getDocumentList();
const acsUser = new UserModel();
const secondAcsUser = new UserModel();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const permissionActions = new PermissionActions(apiService);
const usersActions = new UsersActions(apiService);
const txtFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path
});
const file0BytesModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
});
const pdfFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const secondPdfFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path
});
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
const secondPngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path
});
const folderInfo = new FolderModel({
name: 'myFolder',
location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_path
});
const folderSecond = new FolderModel({
name: 'myrSecondFolder',
location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
const baseFolder = new FolderModel({
name: 'BASE_FOLDER',
location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await usersActions.createUser(secondAcsUser);
});
beforeEach(async () => {
await apiService.login(acsUser.username, acsUser.password);
baseFolderUploaded = await uploadActions.createFolder(
baseFolder.name,
'-my-'
);
});
afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(baseFolderUploaded.entry.id);
});
describe('Handling multiselection', () => {
beforeEach(async () => {
await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id);
const textFolderUploaded = await uploadActions.createFolder(folderInfo.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFolder(folderInfo.location, textFolderUploaded.entry.id);
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, textFolderUploaded.entry.id);
await uploadActions.createFolder(folderSecond.name, baseFolderUploaded.entry.id);
await loginPage.login(acsUser.username, acsUser.password);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await contentServicesPage.waitForTableBody();
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260188] Delete multiple content', async () => {
await contentListPage.selectRowsWithKeyboard(txtFileModel.name, file0BytesModel.name, folderSecond.name, folderInfo.name);
await contentServicesPage.clickDeleteOnToolbar();
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name);
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name);
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name);
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderSecond.name);
});
it('[C260192] Delete file and folder with hierarchy', async () => {
await contentListPage.selectRowsWithKeyboard(txtFileModel.name, folderInfo.name);
await contentServicesPage.clickDeleteOnToolbar();
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name);
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name);
});
it('[C260193] Delete file when different selections are set', async () => {
await contentServicesPage.chooseSelectionMode('None');
await contentListPage.selectRow(txtFileModel.name);
await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name);
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
await contentServicesPage.chooseSelectionMode('Single');
await contentListPage.selectRow(txtFileModel.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name);
await contentListPage.selectRowsWithKeyboard(folderInfo.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', folderInfo.name);
await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name);
await contentServicesPage.clickDeleteOnToolbar();
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name);
await contentListPage.dataTable.checkContentIsDisplayed('Display name', txtFileModel.name);
await contentServicesPage.chooseSelectionMode('Multiple');
await contentListPage.selectRowsWithKeyboard(txtFileModel.name, file0BytesModel.name);
await contentServicesPage.clickDeleteOnToolbar();
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name);
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name);
});
});
describe('When selection on multiple pages', () => {
beforeEach(async () => {
await apiService.login(acsUser.username, acsUser.password);
await uploadActions.uploadFile( txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(secondPdfFileModel.location, secondPdfFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, baseFolderUploaded.entry.id);
await uploadActions.uploadFile(secondPngFileModel.location, secondPngFileModel.name, baseFolderUploaded.entry.id);
await loginPage.login(acsUser.username, acsUser.password);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await contentServicesPage.waitForTableBody();
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260191] Delete content selected from different pages', async () => {
await contentServicesPage.sortByName('ASC');
await paginationPage.selectItemsPerPage('5');
await contentListPage.selectRowWithKeyboard(txtFileModel.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name);
await paginationPage.clickOnNextPage();
await contentListPage.selectRowWithKeyboard(file0BytesModel.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', file0BytesModel.name);
await contentServicesPage.clickDeleteOnToolbar();
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name);
await contentListPage.dataTable.checkContentIsDisplayed('Display name', txtFileModel.name);
});
});
describe('when user does not have `delete` permission', () => {
let createdSite = null;
let fileTxt; let filePdf; let folderA; let folderB;
beforeAll(async () => {
await apiService.login(acsUser.username, acsUser.password);
const sitesApi = new SitesApi(apiService.getInstance());
createdSite = await sitesApi.createSite({
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PRIVATE'
});
await sitesApi.createSiteMembership(createdSite.entry.id, {
id: secondAcsUser.username,
role: 'SiteCollaborator'
});
fileTxt = await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, createdSite.entry.guid);
filePdf = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, createdSite.entry.guid);
folderA = await uploadActions.createFolder(StringUtil.generateRandomString(5), createdSite.entry.guid);
folderB = await uploadActions.createFolder(StringUtil.generateRandomString(5), createdSite.entry.guid);
await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteManager', folderA);
await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteManager', fileTxt);
await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteConsumer', folderB);
await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteConsumer', filePdf);
await permissionActions.disableInheritedPermissionsForNode(folderA.entry.id);
await permissionActions.disableInheritedPermissionsForNode(folderB.entry.id);
await permissionActions.disableInheritedPermissionsForNode(fileTxt.entry.id);
await permissionActions.disableInheritedPermissionsForNode(filePdf.entry.id);
await loginPage.login(secondAcsUser.username, secondAcsUser.password);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${createdSite.entry.guid}`);
await contentServicesPage.waitForTableBody();
});
afterAll(async () => {
try {
await apiService.login(acsUser.username, acsUser.password);
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(createdSite.entry.id, { permanent: true });
} catch (error) {}
await navigationBarPage.clickLogoutButton();
});
it('[C216426] Delete file without delete permissions', async () => {
await contentListPage.selectRowWithKeyboard(filePdf.entry.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', filePdf.entry.name);
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
await contentListPage.selectRowWithKeyboard(folderB.entry.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', folderB.entry.name);
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
await contentListPage.selectRowWithKeyboard(fileTxt.entry.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', fileTxt.entry.name);
await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true);
});
});
});

View File

@@ -1,138 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import { createApiService,
BrowserVisibility,
FileBrowserUtil,
LoginPage,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FolderModel } from '../../models/ACS/folder.model';
describe('Version component actions', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const contentListPage = contentServicesPage.getDocumentList();
let acsUser: UserModel;
const txtFileComma = new FileModel({
name: 'comma,name',
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path
});
const txtFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path
});
const file0BytesModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
});
const folderInfo = new FolderModel({
name: 'myFolder',
location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_path
});
const folderSecond = new FolderModel({
name: 'myrSecondFolder',
location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
await uploadActions.uploadFile( txtFileModel.location, txtFileModel.name, '-my-');
await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await uploadActions.uploadFile(txtFileComma.location, txtFileComma.name, '-my-');
const textFolderUploaded = await uploadActions.createFolder(folderInfo.name, '-my-');
await uploadActions.uploadFolder(folderInfo.location, textFolderUploaded.entry.id);
await uploadActions.createFolder(folderSecond.name, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async () => {
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C260083] Download files - Different size values', async () => {
await contentListPage.selectRow(txtFileModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileModel.name);
await BrowserVisibility.waitUntilDialogIsClose();
await contentListPage.selectRow(file0BytesModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
});
it('[C260084] Download folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
});
it('[C261032] File and Folder', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.checkAcsContainer();
await contentListPage.dataTablePage().checkAllRows();
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded('archive.zip');
});
it('[C261033] Folder and Folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentListPage.selectRow(folderSecond.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded('archive.zip');
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C277757] Download file - Comma in file name', async () => {
await contentListPage.selectRow(txtFileComma.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileComma.name);
});
});

View File

@@ -1,252 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
BrowserActions,
LoginPage,
NotificationHistoryPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FolderDialogPage } from '../../core/pages/dialog/folder-dialog.page';
import { browser, protractor } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { NodesApi } from '@alfresco/js-api';
describe('Edit folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const editFolderDialog = new FolderDialogPage();
const acsUser = new UserModel();
const anotherAcsUser = new UserModel();
const navigationBarPage = new NavigationBarPage();
const notificationHistoryPage = new NotificationHistoryPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const uploadActions = new UploadActions(apiService);
const updateFolderName = StringUtil.generateRandomString(5);
let editFolder; let anotherFolder; let filePdfNode; let subFolder;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await usersActions.createUser(anotherAcsUser);
await apiService.login(acsUser.username, acsUser.password);
editFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
anotherFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), editFolder.entry.id);
filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
await nodesApi.updateNode(editFolder.entry.id,
{
permissions: {
locallySet: [{
authorityId: anotherAcsUser.username,
name: 'Consumer',
accessStatus: 'ALLOWED'
}]
}
});
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(editFolder.entry.id);
await uploadActions.deleteFileOrFolder(anotherFolder.entry.id);
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C260161] Update folder - Cancel button', async () => {
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await expect(await editFolderDialog.getDialogTitle()).toBe('Edit folder');
await expect(await editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.checkCancelBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260162] Update folder - Introducing letters', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(editFolder.entry.name + 'a');
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
});
it('[C260163] Update folder name with an existing one', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(anotherFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsDisplayed();
await browser.sleep(3000); // The error needs time to come back
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260164] Edit Folder - Unsupported characters', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.addFolderName('a*"<>\\/?:|');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await editFolderDialog.addFolderName('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName('a.');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE);
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false);
await editFolderDialog.addFolderName(editFolder.entry.name);
await editFolderDialog.addFolderDescription('a*"<>\\/?:|');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260166] Enable/Disable edit folder icon - when file selected', async () => {
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when multiple folders selected', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRowsButtonIsDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when single folder selected', async () => {
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
});
it('[C260165] Update folder name with non-existing one', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.addFolderName(updateFolderName);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
});
describe('Edit Folder - no permission', () => {
beforeEach(async () => {
await navigationBarPage.clickLogoutButton();
await loginPage.login(anotherAcsUser.username, anotherAcsUser.password);
await BrowserActions.getUrl(browser.baseUrl + '/files/' + editFolder.entry.id);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260167] Edit folder without permission', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
});
});

View File

@@ -1,227 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
ContentNodeSelectorDialogPage,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { CustomSourcesPage } from '../../core/pages/custom-sources.page';
import { TrashcanPage } from '../../core/pages/trashcan.page';
describe('Favorite directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
let acsUser: UserModel;
const customSourcesPage = new CustomSourcesPage();
const trashcanPage = new TrashcanPage();
const contentListPage = contentServicesPage.getDocumentList();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const uploadActions = new UploadActions(apiService);
let testFolder1; let testFolder2; let testFolder3; let testFolder4; let testFile;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
testFolder1 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
testFolder2 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
testFolder3 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
testFolder4 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
testFile = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
await browser.sleep(browser.params.testConfig.timeouts.index_search);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(testFolder1.entry.id);
await uploadActions.deleteFileOrFolder(testFolder2.entry.id);
await uploadActions.deleteFileOrFolder(testFolder3.entry.id);
await uploadActions.deleteFileOrFolder(testFolder4.entry.id);
});
beforeEach(async () => {
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260247] Should be able to mark a file as favorite', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
});
it('[C260249] Should be able to mark a folder as favorite', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name);
});
it('[C260251] Should retain the restored file as favorite', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentListPage.rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await trashcanPage.checkTrashcanIsEmpty();
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
});
it('[C260252] Should retain the moved file as favorite', async () => {
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.openFolder(testFolder1.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
});
it('[C217216] Should be able to mark and unmark multiple folders as favorite', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4);
await contentServicesPage.getDocumentList().dataTablePage().uncheckAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await contentServicesPage.checkIsMarkedFavorite();
});
});

View File

@@ -1,286 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { NodeEntry } from '@alfresco/js-api';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TrashcanPage } from '../../core/pages/trashcan.page';
import { createApiService,
BreadcrumbPage,
LoginPage,
NotificationHistoryPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
WaitActions
} from '@alfresco/adf-testing';
describe('Restore content directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new UserModel();
const anotherAcsUser = new UserModel();
const trashcanPage = new TrashcanPage();
const breadCrumbPage = new BreadcrumbPage();
const notificationHistoryPage = new NotificationHistoryPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const waitActions = new WaitActions(apiService);
const pdfFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const testFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
});
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
let testFolder: NodeEntry;
const uploadActions = new UploadActions(apiService);
let folderWithContent; let folderWithFolder; let subFolder; let subFile; let testFile;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await usersActions.createUser(anotherAcsUser);
await apiService.login(acsUser.username, acsUser.password);
testFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
folderWithContent = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
subFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, folderWithContent.entry.id);
testFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
folderWithFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), folderWithFolder.entry.id);
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(folderWithContent.entry.id);
await uploadActions.deleteFileOrFolder(folderWithFolder.entry.id);
});
describe('Restore same name folders', () => {
beforeAll(async () => {
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name);
await contentServicesPage.deleteContent(testFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFolder.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFolder.entry.name);
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260227] Should validate when restoring Folders with same name', async () => {
await uploadActions.createFolder(testFolder.entry.name, '-my-');
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name);
await contentServicesPage.deleteContent(testFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFolder.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkAllRows();
await trashcanPage.clickRestore();
await waitActions.nodeIsPresent(testFolder.entry.id);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name);
await notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + testFolder.entry.name + ' item already exists');
});
});
describe('Validate', () => {
beforeAll(async () => {
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async () => {
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
it('[C260238] Should restore a file', async () => {
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
});
it('[C260239] Should restore folder with content', async () => {
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.deleteContent(folderWithContent.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
await notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored');
});
it('[C260240] Should validate restore when the original location no longer exists', async () => {
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.openFolder(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.deleteContent(subFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
await breadCrumbPage.chooseBreadCrumb(acsUser.username);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.deleteContent(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains(`Can't restore ${subFolder.entry.name} item, the original location no longer exists`);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains('Restore successful');
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.openFolder(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
});
});
describe('Restore with folder hierarchies', () => {
let parentFolder; let folderWithin; let pdfFile; let pngFile; let mainFile; let mainFolder;
beforeAll(async () => {
await apiService.login(anotherAcsUser.username, anotherAcsUser.password);
await uploadActions.createFolder(testFolder.entry.name, '-my-');
parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
folderWithin = await uploadActions.createFolder(StringUtil.generateRandomString(5), parentFolder.entry.id);
pdfFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, folderWithin.entry.id);
pngFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folderWithin.entry.id);
mainFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-');
mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
await loginPage.login(anotherAcsUser.username, anotherAcsUser.password);
});
beforeEach(async () => {
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFile.entry.id);
});
it('[C216431] Should restore hierarchy of folders', async () => {
await contentServicesPage.deleteContent(parentFolder.entry.name);
await contentServicesPage.deleteContent(mainFolder.entry.name);
await contentServicesPage.deleteContent(mainFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
await trashcanPage.clickRestore();
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
await contentServicesPage.openFolder(folderWithin.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});
});
});

View File

@@ -1,249 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
ContentNodeSelectorDialogPage,
LoginPage,
StringUtil,
UploadActions,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { FolderModel } from '../../models/ACS/folder.model';
describe('Document List Component - Actions', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const viewerPage = new ViewerPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
describe('Document List Component - Check Actions', () => {
let uploadedFolder; let secondUploadedFolder;
let acsUser = null;
let pdfUploadedNode;
let folderName;
let fileNames = [];
const nrOfFiles = 5;
const pdfFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const testFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
});
const files = {
base: 'newFile',
extension: '.txt'
};
beforeAll(async () => {
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-');
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
secondUploadedFolder = await uploadActions.createFolder('secondFolder', '-my-');
fileNames = StringUtil.generateFilesNames(1, nrOfFiles, files.base, files.extension);
await uploadActions.createEmptyFiles(fileNames, uploadedFolder.entry.id);
await loginPage.login(acsUser.username, acsUser.password);
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async () => {
await navigationBarPage.navigateToContentServices();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
describe('File Actions', () => {
it('[C213257] Should be able to copy a file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C260131] Copy - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C297491] Should be able to move a file', async () => {
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
});
it('[C260127] Move - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[0]);
await contentServicesPage.deleteContent(fileNames[0]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
});
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.getDocumentList().selectRow(fileNames[1]);
await contentServicesPage.getDocumentList().selectRow(fileNames[2]);
await contentServicesPage.deleteContent(fileNames[1]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
});
it('[C280565] Should be able to delete a file using context menu', async () => {
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
});
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.getDocumentList().selectRow(fileNames[3]);
await contentServicesPage.getDocumentList().selectRow(fileNames[4]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[3]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
await contentServicesPage.checkContentIsDisplayed(fileNames[4]);
});
it('[C280566] Should be able to open context menu with right click', async () => {
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Manage versions');
await contentServicesPage.checkContextActionIsVisible('Permission');
await contentServicesPage.checkContextActionIsVisible('Lock');
await contentServicesPage.closeActionContext();
});
it('[C260060] Should be able to open a file/folder through double click action - file', async () => {
await contentServicesPage.doubleClickRow(pdfFileModel.name);
await expect(await viewerPage.getDisplayedFileName()).toEqual(pdfFileModel.name);
await viewerPage.checkPreviewFileDefaultOptionsAreDisplayed();
await viewerPage.clickCloseButton();
});
});
describe('Folder Actions', () => {
it('[C260138] Should be able to copy a folder', async () => {
await contentServicesPage.copyContent(folderName);
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.openFolder(secondUploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260060] Should be able to open a file/folder through double click action - folder', async () => {
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const numberOfSubFolders = 3;
await contentServicesPage.createNewFolder(folderTwoModel.name);
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
await contentServicesPage.openFolder(folderTwoModel.name);
for (let i = 0; i < numberOfSubFolders; i++) {
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
}
await browser.refresh();
await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders);
});
it('[C260123] Should be able to delete a folder using context menu', async () => {
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C280568] Should be able to open context menu with right click', async () => {
await contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Permission');
});
});
});
});

View File

@@ -1,295 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
BrowserActions,
ContentNodeSelectorDialogPage,
LoginPage,
NotificationHistoryPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import CONSTANTS = require('../../util/constants');
import { NodesApi, SitesApi } from '@alfresco/js-api';
describe('Document List Component', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const notificationHistoryPage = new NotificationHistoryPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const uploadActions = new UploadActions(apiService);
let uploadedFolder; let uploadedFile; let sourceFolder; let destinationFolder; let subFolder; let subFolder2; let copyFolder; let subFile;
let duplicateFolderName;
const acsUser = new UserModel();
const anotherAcsUser = new UserModel();
let folderName; let sameNameFolder; let site;
const pdfFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const testFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
});
beforeAll(async () => {
folderName = StringUtil.generateRandomString(5);
sameNameFolder = StringUtil.generateRandomString(5);
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
await usersActions.createUser(anotherAcsUser);
const sitesApi = new SitesApi(apiService.getInstance());
site = await sitesApi.createSite({
title: StringUtil.generateRandomString(8),
visibility: 'PUBLIC'
});
await sitesApi.createSiteMembership(site.entry.id, {
id: anotherAcsUser.username,
role: CONSTANTS.CS_USER_ROLES.COLLABORATOR
});
await apiService.login(acsUser.username, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
destinationFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
sourceFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
subFolder = await uploadActions.createFolder(sameNameFolder, sourceFolder.entry.id);
subFolder2 = await uploadActions.createFolder(StringUtil.generateRandomString(5), subFolder.entry.id);
copyFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), sourceFolder.entry.id);
duplicateFolderName = await uploadActions.createFolder(sameNameFolder, '-my-');
subFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, subFolder.entry.id);
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id);
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, sourceFolder.entry.id);
uploadedFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
await nodesApi.updateNode(sourceFolder.entry.id,
{
permissions: {
locallySet: [{
authorityId: anotherAcsUser.username,
name: 'Consumer',
accessStatus: 'ALLOWED'
}]
}
});
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(site.entry.id, { permanent: true });
});
describe('Document List Component - Actions Move and Copy', () => {
beforeAll(async () => {
await loginPage.login(acsUser.username, acsUser.password);
});
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.navigateToContentServices();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260128] Move - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260134] Move - folder with subfolder and file within it', async () => {
await contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
await contentServicesPage.openFolder(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.openFolder(sourceFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
});
it('[C260135] Move - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260129] Copy - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260136] Copy - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260124] should be able to move file using action menu and content node selector', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.moveContent(pdfFileModel.name);
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe(`Move '${pdfFileModel.name}' to...`);
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name);
await contentNodeSelector.checkCopyMoveButtonIsEnabled();
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.moveContent(pdfFileModel.name);
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name);
await contentNodeSelector.checkCopyMoveButtonIsEnabled();
await contentNodeSelector.clickMoveCopyButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
});
describe('Document List actions - Move, Copy on no permission folder', () => {
beforeAll(async () => {
await loginPage.login(anotherAcsUser.username, anotherAcsUser.password);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260133] Move - no permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await expect(await contentServicesPage.isContextActionEnabled('Move')).toBe(false);
await contentServicesPage.closeActionContext();
});
it('[C260140] Copy - No permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await expect(await contentServicesPage.isContextActionEnabled('Copy')).toBe(true);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
});
it('[C261160] should disable copy/move button when user is not allowed in a specific folder', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.copyContent(pdfFileModel.name);
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
await contentNodeSelector.checkSelectedFolder(subFolder.entry.name);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C261990] should enable copy/move button when user selects own site\'s documentLibrary', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.copyContent(pdfFileModel.name);
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.typeIntoNodeSelectorSearchField(site.entry.title);
await contentNodeSelector.doubleClickContentNodeSelectorResult(site.entry.id);
await contentNodeSelector.clickContentNodeSelectorResult('documentLibrary');
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C260137] should disable delete action when user has no permission', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.checkDeleteIsDisabled(pdfFileModel.name);
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.username, acsUser.password);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.deleteContent(pdfFileModel.name);
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
});
});

View File

@@ -1,191 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $ } from 'protractor';
import { createApiService,
BreadcrumbPage,
BreadcrumbDropdownPage,
ContentNodeSelectorDialogPage,
LoginPage,
PaginationPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page';
import { FolderModel } from '../../models/ACS/folder.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
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 navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const infinitePaginationPage = new InfinitePaginationPage($('adf-content-node-selector'));
describe('Folder Actions - Copy and Move', () => {
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() });
let folder1; let folder2; let folder3; let folder4; let folder5; let folder6;
let folders;
const contentServicesUser = new UserModel();
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(contentServicesUser);
await apiService.login(contentServicesUser.username, contentServicesUser.password);
folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-');
folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-');
folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-');
folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-');
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
});
beforeEach(async () => {
await loginPage.login(contentServicesUser.username, contentServicesUser.password);
await contentServicesPage.goToDocumentList();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
it('[C260132] Move action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await contentServicesPage.openFolder('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await breadCrumbDropdownPage.clickParentFolder();
await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
await breadCrumbDropdownPage.choosePath(contentServicesUser.username);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.username);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
it('[C305051] Copy action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await paginationPage.clickOnNextPage();
await contentServicesPage.getDocumentList().dataTable.waitTillContentLoaded();
await contentServicesPage.openFolder('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
});
});

View File

@@ -17,7 +17,7 @@
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -29,7 +29,7 @@ describe('Document List Component', () => {
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
let acsUser = null;
let acsUser: UserModel;
const navigationBarPage = new NavigationBarPage();
describe('Gallery View', () => {
@@ -90,10 +90,9 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
});
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await contentServicesPage.goToDocumentList();
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkCardViewContainerIsDisplayed();
@@ -146,21 +145,6 @@ describe('Document List Component', () => {
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
});
// eslint-disable-next-line ban/ban
xit('[C280129] Should keep Gallery View when accessing a folder', async () => {
await contentServicesPage.navigateToCardFolder(folderName);
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(1);
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280130] Should be able to go back to List View', async () => {
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.openFolder(folderName);
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
});
it('[C261993] Should be able to sort Gallery Cards by display name', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
await contentServicesPage.checkListIsSortedByNameColumn('asc');

View File

@@ -50,8 +50,6 @@ describe('Document List - Pagination', () => {
let acsUser: UserModel;
let fileNames = [];
let currentPage = 1;
let secondSetOfFiles = [];
const nrOfFiles = 20;
@@ -130,6 +128,7 @@ describe('Document List - Pagination', () => {
});
it('[C260069] Should be able to set Items per page to 5', async () => {
let currentPage = 1;
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -178,7 +177,7 @@ describe('Document List - Pagination', () => {
});
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
let currentPage = 1;
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage('10');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -207,9 +206,8 @@ describe('Document List - Pagination', () => {
});
it('[C260065] Should be able to set Items per page to 15', async () => {
currentPage = 1;
let currentPage = 1;
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage('15');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -236,7 +234,6 @@ describe('Document List - Pagination', () => {
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage('20');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -269,7 +266,6 @@ describe('Document List - Pagination', () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
@@ -280,9 +276,8 @@ describe('Document List - Pagination', () => {
});
it('[C260071] Should be able to change pagination when having 25 files', async () => {
currentPage = 1;
let currentPage = 1;
await contentServicesPage.openFolder(folderThreeModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage('15');
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
@@ -370,7 +365,6 @@ describe('Document List - Pagination', () => {
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await apiService.login(acsUser.username, acsUser.password);
@@ -436,5 +430,4 @@ describe('Document List - Pagination', () => {
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
});
});

View File

@@ -1,92 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService, DropActions, LoginPage, UploadActions, UsersActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
describe('Document List Component - Properties', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBar = new NavigationBarPage();
let subFolder; let parentFolder;
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
let acsUser = null;
const usersActions = new UsersActions(apiService);
const pngFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
});
describe('Allow drop files property', () => {
beforeEach(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
parentFolder = await uploadActions.createFolder('parentFolder', '-my-');
subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBar.navigateToContentServices();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await navigationBar.clickLogoutButton();
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.disableDropFilesInAFolder();
await browser.sleep(1000);
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
await DropActions.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
});
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await contentServicesPage.openFolder(parentFolder.entry.name);
await contentServicesPage.enableDropFilesInAFolder();
await browser.sleep(1000);
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
await DropActions.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.openFolder(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
});
});
});

View File

@@ -17,38 +17,31 @@
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { NodeEntry } from '@alfresco/js-api';
describe('Document List Component', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
let acsUser = null;
const navigationBarPage = new NavigationBarPage();
const usersActions = new UsersActions(apiService);
let acsUser: UserModel;
describe('Thumbnails and tooltips', () => {
const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
});
const testFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
});
const docxFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode; let fileTestNode; let fileDocxNode; let folderNode;
let filePdfNode: NodeEntry;
let folderNode: NodeEntry;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -57,8 +50,6 @@ describe('Document List Component', () => {
await apiService.login(acsUser.username, acsUser.password);
filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
fileTestNode = await uploadActions.uploadFile(testFile.location, testFile.name, '-my-');
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
folderNode = await uploadActions.createFolder(folderName, '-my-');
});
@@ -69,12 +60,6 @@ describe('Document List Component', () => {
if (filePdfNode) {
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
}
if (fileTestNode) {
await uploadActions.deleteFileOrFolder(fileTestNode.entry.id);
}
if (fileDocxNode) {
await uploadActions.deleteFileOrFolder(fileDocxNode.entry.id);
}
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
@@ -97,26 +82,6 @@ describe('Document List Component', () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName);
});
it('[C260119] Should have a specific thumbnail for folders', async () => {
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
});
it('[C280066] Should have a specific thumbnail PDF files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
});
it('[C280068] Should have a specific thumbnail files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
});
it('[C274701] Should be able to enable thumbnails', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();

View File

@@ -1,27 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { TestElement } from '@alfresco/adf-testing';
export class LockFilePage {
cancelButton = TestElement.byCss('button[data-automation-id="lock-dialog-btn-cancel"]');
saveButton = TestElement.byText('button span', 'Save');
lockFileCheckboxText = TestElement.byText('mat-checkbox label span', ' Lock file ');
lockFileCheckbox = TestElement.byCss('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]');
allowOwnerCheckbox = TestElement.byText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file ');
}

View File

@@ -99,8 +99,6 @@ describe('Upload component', () => {
});
it('[C272788] Should display upload button', async () => {
await expect(await contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
await contentServicesPage.checkUploadButton();
await contentServicesPage.checkContentIsDisplayed(firstPdfFileModel.name);
});
@@ -133,13 +131,6 @@ describe('Upload component', () => {
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272794] Should display tooltip for uploading files', async () => {
await uploadToggles.enableMultipleFileUpload();
await uploadToggles.checkMultipleFileUploadToggleIsEnabled();
await expect(await contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
await uploadToggles.disableMultipleFileUpload();
});
it('[C279920] Should rename a file uploaded twice', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);

View File

@@ -16,13 +16,13 @@
*/
import { browser } from 'protractor';
import { createApiService, LoginPage, NotificationHistoryPage, StringUtil, UsersActions } from '@alfresco/adf-testing';
import { createApiService, LoginPage, SnackbarPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import CONSTANTS = require('../../util/constants');
import { SitesApi } from '@alfresco/js-api';
import { SiteEntry, SitesApi } from '@alfresco/js-api';
describe('Upload - User permission', () => {
@@ -30,7 +30,6 @@ describe('Upload - User permission', () => {
const uploadDialog = new UploadDialogPage();
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const notificationHistoryPage = new NotificationHistoryPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -39,17 +38,10 @@ describe('Upload - User permission', () => {
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const pngFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_location
});
let acsUser; let acsUserTwo; let consumerSite; let managerSite;
let acsUser: UserModel;
let acsUserTwo: UserModel;
let consumerSite: SiteEntry;
let managerSite: SiteEntry;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -125,7 +117,8 @@ describe('Upload - User permission', () => {
await contentServicesPage.uploadFile(emptyFile.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
const message = await new SnackbarPage().getSnackBarMessage();
expect(message).toEqual('You don\'t have the create permission to upload the content');
});
});
@@ -141,38 +134,4 @@ describe('Upload - User permission', () => {
await uploadDialog.fileIsUploaded(emptyFile.name);
});
});
describe('multiple users', () => {
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C260175] Should two different user upload files in the proper User Home', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
await uploadDialog.fileIsUploaded(emptyFile.name);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUserTwo.username, acsUserTwo.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
await contentServicesPage.uploadFile(pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.uploadFile(pdfFile.location);
await contentServicesPage.checkContentIsDisplayed(pdfFile.name);
});
});
});

View File

@@ -16,9 +16,10 @@
*/
import { browser, by, element } from 'protractor';
import { createApiService,
import {
createApiService,
LoginPage,
NotificationHistoryPage,
SnackbarPage,
StringUtil,
UploadActions,
UserModel,
@@ -38,7 +39,6 @@ describe('Version component permissions', () => {
const versionManagePage = new VersionManagePage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialogPage();
const notificationHistoryPage = new NotificationHistoryPage();
const contentServices = new ContentServicesPage();
let site;
@@ -194,7 +194,8 @@ describe('Version component permissions', () => {
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
const message = await new SnackbarPage().getSnackBarMessage();
expect(message).toEqual(`You don't have access to do this.`);
});
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', async () => {
@@ -249,7 +250,8 @@ describe('Version component permissions', () => {
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
const message = await new SnackbarPage().getSnackBarMessage();
expect(message).toEqual(`You don't have access to do this.`);
});
it('[C277202] Should be disabled the option for a locked file', async () => {

View File

@@ -24,12 +24,12 @@ import { createApiService,
UsersActions
} from '@alfresco/adf-testing';
import { FolderModel } from '../models/ACS/folder.model';
import { ContentServicesPage } from '../core/pages/content-services.page';
import { ContentServicesPage } from './pages/content-services.page';
import { InfinitePaginationPage } from './pages/infinite-pagination.page';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { NavigationBarPage } from './pages/navigation-bar.page';
import { NodeEntry } from '@alfresco/js-api';
describe('Enable infinite scrolling', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const infinitePaginationPage = new InfinitePaginationPage();
@@ -45,9 +45,9 @@ describe('Enable infinite scrolling', () => {
const nrOfFiles = 30;
let deleteFileNames = [];
const nrOfDeletedFiles = 22;
let deleteUploaded;
let deleteUploaded: NodeEntry;
const pageSize = 20;
let emptyFolderModel;
let emptyFolderModel: NodeEntry;
const files = {
base: 'newFile',

View File

@@ -21,12 +21,10 @@ import {
BrowserVisibility,
DateUtil,
DocumentListPage,
TogglePage,
DropdownPage,
Logger
} from '@alfresco/adf-testing';
import { $$, browser, by, element, ElementFinder, protractor, $ } from 'protractor';
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
import { $$, browser, by, element, protractor, $ } from 'protractor';
import { FolderDialogPage } from './dialog/folder-dialog.page';
import { NavigationBarPage } from './navigation-bar.page';
@@ -43,18 +41,10 @@ export class ContentServicesPage {
};
contentList = new DocumentListPage($$('adf-upload-drag-area adf-document-list').first());
togglePage = new TogglePage();
createFolderDialog = new FolderDialogPage();
createLibraryDialog = new CreateLibraryDialogPage();
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
uploadBorder = $('#document-list-container');
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
createFolderButton = $('button[data-automation-id="create-new-folder"]');
editFolderButton = $('button[data-automation-id="edit-folder"]');
deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]');
createLibraryButton = $('button[data-automation-id="create-new-library"]');
activeBreadcrumb = $('div[class*="active"]');
uploadFileButton = $('.adf-upload-button-file-container button');
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
@@ -69,21 +59,14 @@ export class ContentServicesPage {
emptyFolderImage = $('.adf-empty-folder-image');
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
shareNodeButton = element(by.cssContainingText('mat-icon', 'share'));
nameColumnHeader = 'name';
createdByColumnHeader = 'createdByUser.displayName';
createdColumnHeader = 'createdAt';
deleteContentElement = $('button[data-automation-id="Delete"]');
metadataAction = $('button[data-automation-id="Info"]');
versionManagerAction = $('button[data-automation-id="Manage versions"]');
moveContentElement = $('button[data-automation-id="Move"]');
copyContentElement = $('button[data-automation-id="Copy"]');
lockContentElement = $('button[data-automation-id="Lock"]');
downloadContent = $('button[data-automation-id="Download"]');
downloadButton = $('button[title="Download"]');
favoriteButton = $('button[data-automation-id="favorite"]');
markedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
notMarkedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
selectionModeDropdown = $('.mat-select[placeholder="Selection Mode"]');
@@ -95,11 +78,6 @@ export class ContentServicesPage {
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
}
async checkContextActionIsVisible(actionName) {
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
}
async isContextActionEnabled(actionName): Promise<boolean> {
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
@@ -110,18 +88,6 @@ export class ContentServicesPage {
return this.contentList;
}
async closeActionContext(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
}
async checkLockedIcon(content): Promise<void> {
return this.contentList.checkLockedIcon(content);
}
async checkUnlockedIcon(content): Promise<void> {
return this.contentList.checkUnlockedIcon(content);
}
async checkDeleteIsDisabled(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`);
@@ -134,14 +100,6 @@ export class ContentServicesPage {
await this.checkContentIsNotDisplayed(content);
}
async clickDeleteOnToolbar(): Promise<void> {
await BrowserActions.click(this.deleteNodesButton);
}
async checkToolbarDeleteIsDisabled(): Promise<boolean> {
return !(await this.deleteNodesButton.isEnabled());
}
async metadataContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.metadataAction);
@@ -152,21 +110,6 @@ export class ContentServicesPage {
await BrowserActions.click(this.versionManagerAction);
}
async copyContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.copyContentElement);
}
async moveContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.moveContentElement);
}
async lockContent(content): Promise<void> {
await this.contentList.clickOnActionMenu(content);
await BrowserActions.click(this.lockContentElement);
}
async clickFileHyperlink(fileName): Promise<void> {
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
await BrowserActions.click(hyperlink);
@@ -182,15 +125,6 @@ export class ContentServicesPage {
await BrowserActions.click(hyperlinkToggle);
}
async enableDropFilesInAFolder(): Promise<void> {
await this.togglePage.enableToggle(this.multipleFileUploadToggle);
}
async disableDropFilesInAFolder(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
await this.togglePage.disableToggle(this.multipleFileUploadToggle);
}
async getElementsDisplayedId() {
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
}
@@ -313,31 +247,6 @@ export class ContentServicesPage {
await BrowserActions.click(this.createFolderButton);
}
async clickOnFavoriteButton(): Promise<void> {
await BrowserActions.click(this.favoriteButton);
}
async checkIsMarkedFavorite(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
}
async checkIsNotMarkedFavorite(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
}
async clickOnEditFolder(): Promise<void> {
await BrowserActions.click(this.editFolderButton);
}
async isEditFolderButtonEnabled(): Promise<boolean> {
return this.editFolderButton.isEnabled();
}
async openCreateLibraryDialog(): Promise<void> {
await BrowserActions.click(this.createLibraryButton);
await this.createLibraryDialog.libraryDialog.waitVisible();
}
async createNewFolder(folderName: string): Promise<void> {
await this.clickOnCreateNewFolder();
await this.createFolderDialog.addFolderName(folderName);
@@ -355,17 +264,17 @@ export class ContentServicesPage {
await this.contentList.dataTablePage().waitTillContentLoaded();
}
async checkContentIsDisplayed(content): Promise<void> {
async checkContentIsDisplayed(content: string): Promise<void> {
await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
}
async checkContentsAreDisplayed(content): Promise<void> {
for (let i = 0; i < content.length; i++) {
await this.checkContentIsDisplayed(content[i]);
async checkContentsAreDisplayed(content: string[]): Promise<void> {
for (const item of content) {
await this.checkContentIsDisplayed(item);
}
}
async checkContentIsNotDisplayed(content): Promise<void> {
async checkContentIsNotDisplayed(content: string): Promise<void> {
await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
}
@@ -380,17 +289,13 @@ export class ContentServicesPage {
await this.deleteAndCheckFolderNotDisplayed(subFolderName);
}
async getActiveBreadcrumb(): Promise<string> {
return BrowserActions.getAttribute(this.activeBreadcrumb, 'title');
}
async uploadFile(fileLocation): Promise<void> {
async uploadFile(fileLocation: string): Promise<void> {
await this.checkUploadButton();
await this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
await this.checkUploadButton();
}
async uploadMultipleFile(files): Promise<void> {
async uploadMultipleFile(files: string[]): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
let allFiles = path.resolve(path.join(browser.params.testConfig.main.rootPath, files[0]));
for (let i = 1; i < files.length; i++) {
@@ -405,16 +310,6 @@ export class ContentServicesPage {
await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folderLocation)));
}
async getSingleFileButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
return BrowserActions.getAttribute(this.uploadFileButtonInput, 'title');
}
async getMultipleFileButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
}
async checkUploadButton(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
}
@@ -514,27 +409,27 @@ export class ContentServicesPage {
return $$('div.app-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
}
async getDocumentCardIconForElement(elementName): Promise<string> {
async getDocumentCardIconForElement(elementName: string): Promise<string> {
const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`);
return BrowserActions.getAttribute(elementIcon, 'src');
}
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
async checkDocumentCardPropertyIsShowed(elementName: string, propertyName: string): Promise<void> {
const elementProperty = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`);
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
}
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
async getAttributeValueForElement(elementName: string, propertyName: string): Promise<string> {
const elementSize = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`);
return BrowserActions.getText(elementSize);
}
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
async checkMenuIsShowedForElementIndex(elementIndex: number): Promise<void> {
const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`);
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
}
async navigateToCardFolder(folderName): Promise<void> {
async navigateToCardFolder(folderName: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const folderCard = $(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`);
await BrowserActions.click(folderCard);
@@ -543,22 +438,16 @@ export class ContentServicesPage {
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
async selectGridSortingFromDropdown(sortingOption): Promise<void> {
async selectGridSortingFromDropdown(sortingOption: string): Promise<void> {
await this.sortingDropdown.selectDropdownOption(sortingOption);
}
async checkRowIsDisplayed(rowName): Promise<void> {
async checkRowIsDisplayed(rowName: string): Promise<void> {
const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName);
await BrowserVisibility.waitUntilElementIsVisible(row);
}
async clickShareButton(): Promise<void> {
await browser.sleep(2000);
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.shareNodeButton);
}
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
async checkSelectedSiteIsDisplayed(siteName: string): Promise<void> {
await this.siteListDropdown.checkOptionIsSelected(siteName);
}
@@ -580,10 +469,6 @@ export class ContentServicesPage {
await BrowserActions.click(this.selectAllCheckbox);
}
getRowByName(rowName: string): ElementFinder {
return this.contentList.dataTable.getRow(this.columns.name, rowName);
}
async selectFolder(folderName: string): Promise<void> {
const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`);
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);

View File

@@ -1,79 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
import { $ } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
const source = {
favorites: 'Favorites',
recent: 'Recent',
sharedLinks: 'Shared Links',
sites: 'Sites',
mySites: 'My Sites',
trashcan: 'Trashcan',
root: 'Root',
my: 'My',
shared: 'Shared'
};
const column = {
status: 'Status'
};
export class CustomSourcesPage {
dataTable = new DataTableComponentPage();
navigationBarPage = new NavigationBarPage();
toolbar = $('app-custom-sources .adf-toolbar-title');
selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]'));
async waitForToolbarToBeVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
}
async navigateToCustomSources(): Promise<void> {
await this.navigationBarPage.clickCustomSources();
await this.waitForToolbarToBeVisible();
}
async selectMySitesSourceType(): Promise<void> {
await this.selectModeDropdown.selectDropdownOption(source.mySites);
}
async selectFavoritesSourceType(): Promise<void> {
await this.selectModeDropdown.selectDropdownOption(source.favorites);
}
async selectSharedLinksSourceType(): Promise<void> {
await this.selectModeDropdown.selectDropdownOption(source.sharedLinks);
}
checkRowIsDisplayed(rowName: string): Promise<void> {
return this.dataTable.checkContentIsDisplayed('Name', rowName);
}
checkRowIsNotDisplayed(rowName: string): Promise<void> {
return this.dataTable.checkContentIsNotDisplayed('Name', rowName);
}
async getStatusCell(rowName: string): Promise<string> {
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
return BrowserActions.getText(cell);
}
}

View File

@@ -1,44 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $, $$ } from 'protractor';
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
export class CreateLibraryDialogPage {
libraryDialog = TestElement.byCss('[role="dialog"]');
libraryTitle = TestElement.byCss('.adf-library-dialog>h2');
libraryNameField = TestElement.byCss('input[formcontrolname="title"]');
libraryIdField = TestElement.byCss('input[formcontrolname="id"]');
libraryDescriptionField = TestElement.byCss('textarea[formcontrolname="description"]');
publicRadioButton = TestElement.byCss('[data-automation-id="PUBLIC"]>label');
privateRadioButton = TestElement.byCss('[data-automation-id="PRIVATE"]>label');
moderatedRadioButton = TestElement.byCss('[data-automation-id="MODERATED"]>label');
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
errorMessage = TestElement.byCss('.mat-dialog-content .mat-error');
errorMessages = $$('.mat-dialog-content .mat-error');
libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint');
async getSelectedRadio(): Promise<string> {
const radio = $('.mat-radio-button[class*="checked"]');
return BrowserActions.getText(radio);
}
async getErrorMessages(position: number): Promise<string> {
return BrowserActions.getText(this.errorMessages.get(position));
}
}

View File

@@ -15,73 +15,21 @@
* limitations under the License.
*/
import { $$, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { $$ } from 'protractor';
import { BrowserActions } from '@alfresco/adf-testing';
export class FolderDialogPage {
folderDialog = $$('adf-folder-dialog').first();
folderNameField = this.folderDialog.$('#adf-folder-name-input');
folderDescriptionField = this.folderDialog.$('#adf-folder-description-input');
createUpdateButton = this.folderDialog.$('#adf-folder-create-button');
cancelButton = this.folderDialog.$('#adf-folder-cancel-button');
folderTitle = this.folderDialog.$('h2.mat-dialog-title');
validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span');
async getDialogTitle(): Promise<string> {
return BrowserActions.getText(this.folderTitle);
}
async checkFolderDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
}
async checkFolderDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
}
async clickOnCreateUpdateButton(): Promise<void> {
await BrowserActions.click(this.createUpdateButton);
}
async clickOnCancelButton(): Promise<void> {
await BrowserActions.click(this.cancelButton);
}
async addFolderName(folderName): Promise<void> {
await BrowserActions.clearSendKeys(this.folderNameField, folderName);
}
async addFolderDescription(folderDescription): Promise<void> {
await BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
}
async getFolderName(): Promise<string> {
return BrowserActions.getInputValue(this.folderNameField);
}
async getValidationMessage(): Promise<string> {
return BrowserActions.getText(this.validationMessage);
}
async checkValidationMessageIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
}
getFolderNameField(): ElementFinder {
return this.folderNameField;
}
getFolderDescriptionField(): ElementFinder {
return this.folderDescriptionField;
}
async checkCreateUpdateBtnIsEnabled(): Promise<boolean> {
return this.createUpdateButton.isEnabled();
}
async checkCancelBtnIsEnabled(): Promise<void> {
await this.cancelButton.isEnabled();
}
}

View File

@@ -1,114 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { $$, $ } from 'protractor';
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
import { format, add } from 'date-fns';
export class ShareDialogPage {
togglePage = new TogglePage();
dateTimePickerPage = new DateTimePickerPage();
shareDialog = $('adf-share-dialog');
dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first();
shareToggle = $('[data-automation-id="adf-share-toggle"] label');
expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`);
shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked');
shareLink = $('[data-automation-id="adf-share-link"]');
closeButton = $('button[data-automation-id="adf-share-dialog-close"]');
copySharedLinkButton = $('.adf-input-action');
expirationDateInput = $('input[formcontrolname="time"]');
confirmationDialog = $('adf-confirm-dialog');
confirmationCancelButton = $('#adf-confirm-cancel');
confirmationRemoveButton = $('#adf-confirm-accept');
async checkDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
}
async clickUnShareFile() {
await this.togglePage.enableToggle(this.shareToggle);
}
async clickExpireToggle() {
await this.togglePage.enableToggle(this.expireToggle);
}
async clickConfirmationDialogCancelButton(): Promise<void> {
await BrowserActions.click(this.confirmationCancelButton);
}
async clickConfirmationDialogRemoveButton(): Promise<void> {
await BrowserActions.click(this.confirmationRemoveButton);
}
async checkShareLinkIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
}
async getShareLink(): Promise<string> {
return BrowserActions.getInputValue(this.shareLink);
}
async clickCloseButton(): Promise<void> {
await BrowserActions.click(this.closeButton);
}
async clickShareLinkButton(): Promise<void> {
await BrowserActions.click(this.copySharedLinkButton);
}
async shareToggleButtonIsChecked(): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.shareToggleChecked);
}
async dialogIsClosed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsStale(this.shareDialog);
}
async clickDateTimePickerButton(): Promise<void> {
await this.dateTimePickerPage.clickDateTimePicker();
}
async calendarTodayDayIsDisabled(): Promise<void> {
const tomorrow = format(add(new Date(), {days: 1}), 'd');
if (tomorrow !== '1') {
await this.dateTimePickerPage.checkCalendarTodayDayIsDisabled();
}
}
async setDefaultDay(): Promise<void> {
const tomorrow = format(add(new Date(), {days: 1}), 'd');
await this.dateTimePickerPage.setDate(tomorrow);
}
async dateTimePickerDialogIsClosed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
}
async getExpirationDate(): Promise<string> {
return BrowserActions.getInputValue(this.expirationDateInput);
}
async expirationDateInputHasValue(value): Promise<void> {
await BrowserVisibility.waitUntilElementHasValue(this.expirationDateInput, value);
}
async confirmationDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialog);
}
}

View File

@@ -26,7 +26,6 @@ export class UploadDialogPage {
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
cancelledStatusIcon = 'div[class*="status--cancelled"]';
errorStatusIcon = 'div[class*="status--error"] mat-icon';
errorTooltip = $('div.mat-tooltip');
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
title = $('span[class*="upload-dialog__title"]');
minimizeButton = $('mat-icon[title="Minimize"]');
@@ -121,6 +120,6 @@ export class UploadDialogPage {
}
async getTooltip(): Promise<string> {
return BrowserActions.getText(this.errorTooltip);
return BrowserActions.getAttribute($(this.errorStatusIcon), 'title');
}
}

View File

@@ -90,18 +90,6 @@ export class NavigationBarPage {
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
}
async clickTrashcanButton(): Promise<void> {
await this.clickNavigationBarItem('Trashcan');
}
async clickCustomSources(): Promise<void> {
await this.clickNavigationBarItem('Custom Sources');
}
async clickOverlayViewerButton(): Promise<void> {
await this.clickNavigationBarItem('Overlay Viewer');
}
async clickTreeViewButton(): Promise<void> {
await this.clickNavigationBarItem('Tree View');
}

View File

@@ -25,13 +25,13 @@ import { createApiService,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { NodeEntry } from '@alfresco/js-api';
import { browser } from 'protractor';
import { FileModel } from '../models/ACS/file.model';
import { FolderModel } from '../models/ACS/folder.model';
import { ContentServicesPage } from '../core/pages/content-services.page';
import { ContentServicesPage } from './pages/content-services.page';
describe('Pagination - returns to previous page when current is empty', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const paginationPage = new PaginationPage();
@@ -48,8 +48,8 @@ describe('Pagination - returns to previous page when current is empty', () => {
const nrOfFiles = 6;
const nrOfFolders = 5;
const lastFile = 'newFile6.txt';
let lastFolderResponse;
let pngFileUploaded;
let lastFolderResponse: NodeEntry;
let pngFileUploaded: any;
const folderNames = ['t1', 't2', 't3', 't4', 't5', 't6'];
const itemsPerPage = {

View File

@@ -15,11 +15,10 @@
* limitations under the License.
*/
import { createApiService, LoginPage, SettingsPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing';
import { createApiService, LoginPage, SettingsPage, UserInfoPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
describe('User Info - SSO', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginPage();
const userInfoPage = new UserInfoPage();
@@ -27,16 +26,21 @@ describe('User Info - SSO', () => {
const apiService = createApiService({ authType: 'OAUTH', provider: 'ECM' });
const usersActions = new UsersActions(apiService);
let identityUser;
let identityUser: UserModel;
beforeAll(async () => {
await apiService.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
identityUser = await usersActions.createUser();
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
await settingsPage.setProviderEcmSso(
browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId);
browser.params.testConfig.appConfig.identityHost,
false,
true,
browser.params.testConfig.appConfig.oauth2.clientId
);
await loginSSOPage.loginSSOIdentityService(identityUser.username, identityUser.password);
});

View File

@@ -39,8 +39,6 @@ describe('Content Services Viewer', () => {
const versionManagePage = new VersionManagePage();
const metadataViewPage = new MetadataViewPage();
let zoom;
const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
firstPageText: browser.params.resources.Files.ADF_DOCUMENTS.PDF.first_page_text,
@@ -241,7 +239,7 @@ describe('Content Services Viewer', () => {
await viewerPage.checkPercentageIsDisplayed();
zoom = await viewerPage.getZoom();
let zoom = await viewerPage.getZoom();
await viewerPage.clickZoomInButton();
await viewerPage.checkZoomedIn(zoom);
@@ -401,36 +399,6 @@ describe('Content Services Viewer', () => {
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.clickCloseButton();
});
it('[C268901] Should need a password when opening a protected file', async () => {
await contentServicesPage.doubleClickRow(protectedFile.name);
await viewerPage.waitTillContentLoaded();
await viewerPage.checkZoomInButtonIsDisplayed();
await viewerPage.checkPasswordDialogIsDisplayed();
await viewerPage.checkPasswordSubmitDisabledIsDisplayed();
await viewerPage.enterPassword('random password');
await viewerPage.clickPasswordSubmit();
await viewerPage.checkPasswordErrorIsDisplayed();
await viewerPage.checkPasswordInputIsDisplayed();
await viewerPage.enterPassword(protectedFile.password);
await viewerPage.clickPasswordSubmit();
await viewerPage.checkFileContent('1', protectedFile.firstPageText);
await viewerPage.clickCloseButton();
});
it('[C307985] Should close the viewer when password dialog is cancelled', async () => {
await contentServicesPage.doubleClickRow(protectedFile.name);
await viewerPage.waitTillContentLoaded();
await viewerPage.checkPasswordDialogIsDisplayed();
await viewerPage.clickClosePasswordDialog();
await contentServicesPage.checkContentIsDisplayed(protectedFile.name);
});
});
describe('Viewer - version update with unsupported file', () => {

View File

@@ -1,133 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
BrowserActions,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { SharedlinksApi, SitesApi } from '@alfresco/js-api';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const navigationBarPage = new NavigationBarPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const shareDialog = new ShareDialogPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const sharedlinksApi = new SharedlinksApi(apiService);
let site;
const acsUser = new UserModel();
let pngFileUploaded;
const contentList = contentServicesPage.getDocumentList();
const pngFileInfo = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
const wordFileInfo = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path
});
let pngFileShared; let wordFileUploaded;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(acsUser);
const sitesApi = new SitesApi(apiService.getInstance());
site = await sitesApi.createSite({
title: StringUtil.generateRandomString(8),
visibility: 'PUBLIC'
});
await sitesApi.createSiteMembership(site.entry.id, {
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
await apiService.login(acsUser.username, acsUser.password);
pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid);
await apiService.login(acsUser.username, acsUser.password);
wordFileUploaded = await uploadActions.uploadFile(wordFileInfo.location, wordFileInfo.name, '-my-');
pngFileShared = await sharedlinksApi.createSharedLink({ nodeId: pngFileUploaded.entry.id });
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(site.entry.id, { permanent: true });
await apiService.login(acsUser.username, acsUser.password);
await uploadActions.deleteFileOrFolder(wordFileUploaded.entry.id);
});
beforeEach(async () => {
await loginPage.login(acsUser.username, acsUser.password);
});
it('[C260105] Should be able to open an image file shared via API', async () => {
await BrowserActions.getUrl(browser.baseUrl + '/preview/s/' + pngFileShared.entry.id);
await viewerPage.checkImgContainerIsDisplayed();
await BrowserActions.getUrl(browser.baseUrl);
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(browser.baseUrl + '/preview/s/' + pngFileShared.entry.id);
await viewerPage.checkImgContainerIsDisplayed();
});
it('[C260106] Should be able to open a Word file shared via API', async () => {
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await contentList.selectRow(wordFileInfo.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
await BrowserActions.getUrl(browser.baseUrl);
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name);
});
});

View File

@@ -1,50 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService, ErrorPage, IdentityService, LoginPage } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
describe('User Access Cloud', () => {
const loginSSOPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const errorPage = new ErrorPage();
const apiService = createApiService();
const identityService = new IdentityService(apiService);
let testUser;
beforeAll( async () => {
await apiService.loginWithProfile('identityAdmin');
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_DEVOPS]);
await loginSSOPage.login(testUser.username, testUser.password);
await apiService.login(testUser.username, testUser.password);
});
afterAll(async () => {
await apiService.loginWithProfile('identityAdmin');
await identityService.deleteIdentityUser(testUser.idIdentityService);
});
it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => {
await navigationBarPage.navigateToProcessServicesCloudPage();
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
});

View File

@@ -15,10 +15,11 @@
* limitations under the License.
*/
import { createApiService, AppListCloudPage, GroupIdentityService, IdentityService,
LoginPage, NotificationHistoryPage, ProcessCloudWidgetPage, ProcessDefinitionsService,
import {
createApiService, AppListCloudPage, GroupIdentityService, IdentityService,
LoginPage, ProcessCloudWidgetPage, ProcessDefinitionsService,
ProcessInstancesService, QueryService, TaskFormCloudComponent, TaskHeaderCloudPage,
TasksService
TasksService, SnackbarPage
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { TasksCloudDemoPage } from '.././pages/tasks-cloud-demo.page';
@@ -35,7 +36,6 @@ describe('Form Field Component - Dropdown Widget', () => {
const taskList = tasksCloudDemoPage.taskListCloudComponent();
const taskFormCloudComponent = new TaskFormCloudComponent();
const notificationHistoryPage = new NotificationHistoryPage();
const taskHeaderCloudPage = new TaskHeaderCloudPage();
const widget = new ProcessCloudWidgetPage();
@@ -148,7 +148,9 @@ describe('Form Field Component - Dropdown Widget', () => {
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
await taskList.checkContentIsNotDisplayedByName(dropdownOptionTaskName);
await notificationHistoryPage.checkNotifyContains('Task has been saved successfully');
const message = await new SnackbarPage().getSnackBarMessage();
expect(message).toEqual('Task has been saved successfully');
await taskFilter.clickTaskFilter('completed-tasks');
await taskList.getDataTable().waitTillContentLoaded();

View File

@@ -1,126 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 {
LoginPage,
TasksService, createApiService,
AppListCloudPage,
StringUtil,
IdentityService,
GroupIdentityService,
NotificationHistoryPage,
ProcessInstancesService,
ProcessDefinitionsService,
QueryService
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
describe('Task counters cloud', () => {
describe('Task Counters', () => {
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
const loginSSOPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();
const notificationHistoryPage = new NotificationHistoryPage();
const taskFilter = tasksCloudDemoPage.taskFilterCloudComponent;
const apiService = createApiService();
const identityService = new IdentityService(apiService);
const groupIdentityService = new GroupIdentityService(apiService);
const tasksService = new TasksService(apiService);
const processDefinitionService = new ProcessDefinitionsService(apiService);
const processInstancesService = new ProcessInstancesService(apiService);
const queryService = new QueryService(apiService);
let testUser; let groupInfo;
const createdTaskName = StringUtil.generateRandomString();
beforeAll(async () => {
await apiService.loginWithProfile('identityAdmin');
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
await apiService.login(testUser.username, testUser.password);
await loginSSOPage.login(testUser.username, testUser.password);
});
afterAll(async () => {
await apiService.loginWithProfile('identityAdmin');
await identityService.deleteIdentityUser(testUser.idIdentityService);
});
beforeEach(async () => {
await navigationBarPage.navigateToProcessServicesCloudPage();
await appListCloudComponent.checkApsContainer();
await appListCloudComponent.goToApp(simpleApp);
});
it('[C593065] Should display notification in counter when process started', async () => {
await taskFilter.checkTaskFilterCounter('my-tasks');
await expect(await taskFilter.getTaskFilterCounter('my-tasks')).toBe('0');
const processDefinition = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.uploadSingleMultipleFiles, simpleApp);
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { name: StringUtil.generateRandomString() });
const task = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp);
await notificationHistoryPage.checkNotificationCenterHasNewNotifications();
await notificationHistoryPage.clickNotificationButton();
await notificationHistoryPage.checkNotificationIsPresent(`task has been assigned`);
await notificationHistoryPage.clickMarkAsRead();
await processInstancesService.deleteProcessInstance(processInstance.entry.id, simpleApp);
});
it('[C593066] Should display notification in counter when task assigned', async () => {
await taskFilter.checkTaskFilterCounter('my-tasks');
await expect(await taskFilter.getTaskFilterCounter('my-tasks')).toBe('0');
const taskCounter = await taskFilter.getTaskFilterCounter('my-tasks');
const assigneeTask = await tasksService.createStandaloneTask(createdTaskName, simpleApp);
await tasksService.claimTask(assigneeTask.entry.id, simpleApp);
await taskFilter.checkNotificationCounterValue('my-tasks', (parseInt(taskCounter, 10) + 1).toString());
await notificationHistoryPage.clickNotificationButton();
await notificationHistoryPage.clickMarkAsRead();
await tasksService.deleteTask(assigneeTask.entry.id, simpleApp);
});
it('[C290009] Should display notification in task center', async () => {
await taskFilter.checkTaskFilterCounter('my-tasks');
const assigneeTask = await tasksService.createStandaloneTask(createdTaskName, simpleApp);
await tasksService.claimTask(assigneeTask.entry.id, simpleApp);
await notificationHistoryPage.checkNotificationCenterHasNewNotifications();
await notificationHistoryPage.clickNotificationButton();
await notificationHistoryPage.checkNotificationIsPresent(`${assigneeTask.entry.name} task has been assigned`);
await notificationHistoryPage.clickMarkAsRead();
await tasksService.deleteTask(assigneeTask.entry.id, simpleApp);
});
});
});

View File

@@ -204,7 +204,6 @@ describe('Task form cloud component', () => {
await taskFormCloudComponent.checkSaveButtonIsDisplayed();
await taskFormCloudComponent.clickSaveButton();
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesCloudPage();
await appListCloudComponent.checkApsContainer();
await goToAppOpenDropdownTaskByNameFromFilters(myTasksFilter, dropdownOptionsTask.entry.name);

View File

@@ -225,8 +225,8 @@ describe('Task Header cloud component', () => {
it('[C291991] Should be able to assign a task only to the users that have access to the selected app', async () => {
await tasksCloudDemoPage.clickStartNewTaskButton();
const currentAssignee = await peopleCloudComponentPage.getChipAssignee();
await expect(currentAssignee).toContain(testUser.firstName, 'Invalid Assignee first name set for the new task');
await expect(currentAssignee).toContain(testUser.lastName, 'Invalid Assignee last name set for the new task');
await expect(currentAssignee).toContain(testUser.firstName);
await expect(currentAssignee).toContain(testUser.lastName);
await peopleCloudComponentPage.searchAssignee('hrUser');
await peopleCloudComponentPage.selectAssigneeFromList('HR User');

View File

@@ -17,10 +17,10 @@
import { browser } from 'protractor';
import { ModelsActions, createApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import CONSTANTS = require('../../util/constants');
import { AppDefinitionsApi } from '@alfresco/js-api';
import { AppDefinitionRepresentation, AppDefinitionsApi } from '@alfresco/js-api';
describe('Modify applications', () => {
@@ -39,7 +39,8 @@ describe('Modify applications', () => {
const applicationService = new ApplicationsUtil(apiService);
const appsApi = new AppDefinitionsApi(apiService.getInstance());
let firstApp; let appVersionToBeDeleted;
let firstApp: AppDefinitionRepresentation;
let appVersionToBeDeleted: AppDefinitionRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -131,7 +132,7 @@ describe('Modify applications', () => {
name: appToBeDeleted.title,
description: newDescription,
definition: {
models: [firstApp.definition.models[0]],
models: [firstApp['definition'].models[0]],
theme: 'theme-4',
icon: 'glyphicon-user'
}

View File

@@ -15,16 +15,15 @@
* limitations under the License.
*/
import { createApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions } from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
import { createApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
describe('Checklist component', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -38,11 +37,16 @@ describe('Checklist component', () => {
const applicationService = new ApplicationsUtil(apiService);
const taskUtil = new TaskUtil(apiService);
let processUserModel;
let processUserModel: UserModel;
const tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy'];
const checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist'];
const removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist'];
const removeChecklist = [
'removeFirstRunningChecklist',
'removeSecondRunningChecklist',
'removeFirstCompletedChecklist',
'removeSecondCompletedChecklist'
];
const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild'];
beforeAll(async () => {
@@ -54,19 +58,18 @@ describe('Checklist component', () => {
await apiService.login(processUserModel.username, processUserModel.password);
for (let i = 0; i < tasks.length; i++) {
await taskUtil.createStandaloneTask(tasks[i]);
for (const item of tasks) {
await taskUtil.createStandaloneTask(item);
}
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
});
it('[C279976] Should no checklist be created when no title is typed', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
@@ -93,7 +96,7 @@ describe('Checklist component', () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
await (await taskPage.clickOnAddChecklistButton());
await await taskPage.clickOnAddChecklistButton();
await taskPage.checkChecklistDialogIsDisplayed();
await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
@@ -122,7 +125,7 @@ describe('Checklist component', () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
await taskPage.tasksListPage().selectRow(tasks[2]);
await (await taskPage.clickOnAddChecklistButton());
await await taskPage.clickOnAddChecklistButton();
await taskPage.checkChecklistDialogIsDisplayed();
await checklistDialog.addName(removeChecklist[0]);
await checklistDialog.clickCreateChecklistButton();

View File

@@ -15,21 +15,23 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
DatePickerCalendarPage,
DateUtil,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
UsersActions,
Widget
Widget,
UserModel
} from '@alfresco/adf-testing';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { browser } from 'protractor';
describe('Dynamic Table', () => {
const loginPage = new LoginPage();
const processFiltersPage = new ProcessFiltersPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
@@ -41,18 +43,20 @@ describe('Dynamic Table', () => {
const usersActions = new UsersActions(apiService);
const modelsActions = new ModelsActions(apiService);
let user; let tenantId; let appId;
let user: UserModel;
let tenantId: number;
let appId: number;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser();
tenantId = user.tenantId;
});
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(tenantId);
});
});
describe('Date Picker', () => {
const app = browser.params.resources.Files.DYNAMIC_TABLE_APP;

View File

@@ -15,11 +15,10 @@
* limitations under the License.
*/
import { createApiService, FormPage, LoginPage, UsersActions, Widget } from '@alfresco/adf-testing';
import { createApiService, FormPage, LoginPage, UserModel, UsersActions, Widget } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
describe('Form Component', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const formPage = new FormPage();
@@ -28,7 +27,8 @@ describe('Form Component', () => {
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
let tenantId; let user;
let tenantId: number;
let user: UserModel;
const fields = {
dateWidgetId: 'label7',
@@ -92,5 +92,5 @@ describe('Form Component', () => {
await formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
await formPage.checkErrorLogMessage(message.errorLabel);
});
});
});

View File

@@ -1,45 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { TogglePage } from '@alfresco/adf-testing';
import { $ } from 'protractor';
export class AppSettingsTogglesPage {
togglePage = new TogglePage();
showDetailsHeaderToggle = $('#adf-show-header');
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
async enableShowHeader(): Promise<void> {
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
}
async disableShowHeader(): Promise<void> {
await this.togglePage.disableToggle(this.showDetailsHeaderToggle);
}
async enableTaskFiltersIcon(): Promise<void> {
await this.togglePage.enableToggle(this.showTaskFilterIconsToggle);
}
async enableProcessFiltersIcon(): Promise<void> {
await this.togglePage.enableToggle(this.showProcessFilterIconsToggle);
}
}

View File

@@ -26,7 +26,7 @@ export class ProcessDetailsPage {
propertiesList = TestElement.byCss('.adf-property-list');
showDiagramButton = TestElement.byId('show-diagram-button');
diagramCanvas = TestElement.byCss('svg[xmlns="http://www.w3.org/2000/svg"]');
backButton = TestElement.byCss('app-show-diagram button.mat-mini-fab.mat-accent');
backButton = TestElement.byCss('#btn-diagram-back');
commentInput = TestElement.byId('comment-input');
auditLogButton = TestElement.byCss('button[adf-process-audit]');
cancelProcessButton = TestElement.byCss('div[data-automation-id="header-status"] > button');

View File

@@ -19,16 +19,13 @@ import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcess
import { $, $$ } from 'protractor';
export class ProcessFiltersPage {
dataTable = new DataTableComponentPage();
createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span');
newProcessButton = $('div > button[data-automation-id="btn-start-process"]');
processesPage = $('#app-processes-menu');
accordionMenu = $('.app-processes-menu mat-accordion');
buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div');
noContentMessage = $$('.adf-empty-content__title').first();
rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
startProcessEl = $('adf-start-process .adf-start-process');
getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`);
@@ -57,7 +54,6 @@ export class ProcessFiltersPage {
async clickCreateProcessButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserVisibility.waitUntilElementIsVisible(this.accordionMenu);
await BrowserVisibility.waitUntilElementIsVisible(this.processesPage);
await BrowserActions.click(this.createProcessButton);
}
@@ -81,11 +77,6 @@ export class ProcessFiltersPage {
await BrowserActions.click(processName);
}
async checkFilterIsHighlighted(filterName: string): Promise<void> {
const processNameHighlighted = $(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`);
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
}
async numberOfProcessRows(): Promise<number> {
await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first());
return this.rows.count();
@@ -95,53 +86,13 @@ export class ProcessFiltersPage {
await this.dataTable.waitForTableBody();
}
/**
* Sort the list by name column.
*
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
*/
async sortByName(sortOrder: string) {
await this.dataTable.sortByColumn(sortOrder, 'name');
}
async getAllRowsNameColumn() {
return this.dataTable.getAllRowsColumnValues('Name');
}
async checkFilterIsDisplayed(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
}
async checkFilterHasNoIcon(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon));
}
async getFilterIcon(name: string): Promise<string> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
const icon = filterName.$(this.processIcon);
return BrowserActions.getText(icon);
}
async checkFilterIsNotDisplayed(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
}
async checkProcessesSortedByNameAsc(): Promise<void> {
const list = await this.getAllRowsNameColumn();
for (let i = 1; i < list.length; i++) {
await expect(JSON.stringify(list[i]) > JSON.stringify(list[i - 1])).toEqual(true);
}
}
async checkProcessesSortedByNameDesc(): Promise<void> {
const list = await this.getAllRowsNameColumn();
for (let i = 1; i < list.length; i++) {
await expect(JSON.stringify(list[i]) < JSON.stringify(list[i - 1])).toEqual(true);
}
}
}

View File

@@ -43,7 +43,7 @@ export class ProcessListDemoPage {
await this.stateDropdown.selectDropdownOption(stateOption);
}
async addAppId(appId: string): Promise<void> {
async addAppId(appId: string | number): Promise<void> {
await BrowserActions.click(this.appIdInput);
await this.appIdInput.sendKeys(protractor.Key.ENTER);
await this.appIdInput.clear();

View File

@@ -23,7 +23,6 @@ export class ProcessServiceTabBarPage {
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
async clickTasksButton(): Promise<void> {
@@ -36,11 +35,6 @@ export class ProcessServiceTabBarPage {
await browser.sleep(500);
}
async clickSettingsButton(): Promise<void> {
await BrowserActions.click(this.settingsButton);
await browser.sleep(500);
}
async clickReportsButton(): Promise<void> {
await BrowserActions.click(this.reportsButton);
await BrowserVisibility.waitUntilElementIsVisible(this.reportsButtonSelected);

View File

@@ -47,7 +47,7 @@ export class ProcessServicesPage {
return new ProcessServiceTabBarPage();
}
async goToAppByAppId(appId: string): Promise<void> {
async goToAppByAppId(appId: string | number): Promise<void> {
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${appId}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
const taskPage = new TasksPage();

View File

@@ -17,14 +17,9 @@
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
import { browser, by, element, Key, $, $$ } from 'protractor';
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
export class TaskDetailsPage {
appSettingsTogglesClass = new AppSettingsTogglesPage();
formContent = $('adf-form');
formNameField = $('[data-automation-id="card-textitem-value-formName"]');
formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]');
assigneeField = $('[data-automation-id="card-textitem-value-assignee"]');
@@ -45,7 +40,6 @@ export class TaskDetailsPage {
involvePeopleButton = $('div[class*="add-people"]');
addPeopleField = $('input[data-automation-id="adf-people-search-input"]');
addInvolvedUserButton = $('button[id="add-people"]');
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
taskDetailsSection = $('div[data-automation-id="app-tasks-details"]');
taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]');
completeTask = $('button[id="adf-no-form-complete-button"]');
@@ -304,18 +298,6 @@ export class TaskDetailsPage {
await BrowserActions.click(this.auditLogButton);
}
appSettingsToggles(): AppSettingsTogglesPage {
return this.appSettingsTogglesClass;
}
async taskInfoDrawerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskDetailsInfoDrawer);
}
async taskInfoDrawerIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.taskDetailsInfoDrawer);
}
async checkNoPeopleIsInvolved(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noPeopleInvolved);
}

View File

@@ -19,9 +19,7 @@ import { ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class TaskFiltersPage {
filter: ElementFinder;
taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
constructor(filter: ElementFinder) {
this.filter = filter;
@@ -31,17 +29,6 @@ export class TaskFiltersPage {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async getTaskFilterIcon(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const icon = this.filter.$(this.taskIcon);
return BrowserActions.getText(icon);
}
async checkTaskFilterHasNoIcon(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon));
}
async clickTaskFilter(): Promise<void> {
return BrowserActions.click(this.filter);
}

View File

@@ -16,20 +16,13 @@
*/
import { browser } from 'protractor';
import { createApiService,
ApplicationsUtil,
LoginPage,
ModelsActions,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { CommentsPage } from '../../core/pages/comments.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ActivitiCommentsApi, TasksApi } from '@alfresco/js-api';
import { ActivitiCommentsApi, ResultListDataRepresentationCommentRepresentation, TasksApi } from '@alfresco/js-api';
describe('Comment component for Processes', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -44,7 +37,10 @@ describe('Comment component for Processes', () => {
const commentsApi = new ActivitiCommentsApi(apiService.getInstance());
const taskApi = new TasksApi(apiService.getInstance());
let user; let appId; let processInstanceId; let addedComment;
let user: UserModel;
let appId: number;
let processInstanceId: string;
let addedComment: ResultListDataRepresentationCommentRepresentation;
const processName = 'Comment APS';
beforeAll(async () => {
@@ -82,7 +78,9 @@ describe('Comment component for Processes', () => {
await commentsPage.getTotalNumberOfComments('Comments (' + addedComment.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
await expect(await commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
await expect(await commentsPage.getUserName(0)).toEqual(
addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName
);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
@@ -120,7 +118,9 @@ describe('Comment component for Processes', () => {
await commentsPage.getTotalNumberOfComments('Comments (' + addedTaskComment.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
await expect(await commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
await expect(await commentsPage.getUserName(0)).toEqual(
addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName
);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
});

View File

@@ -17,20 +17,18 @@
import { browser } from 'protractor';
import { createApiService,
ApplicationsUtil,
LoginPage,
ModelsActions,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { FiltersPage } from './../pages/filters.page';
import { ProcessInstancesApi, UserFiltersApi } from '@alfresco/js-api';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { FiltersPage } from '../pages/filters.page';
import {
AppDefinitionRepresentation,
ProcessInstancesApi,
ResultListDataRepresentationProcessInstanceRepresentation,
UserFiltersApi
} from '@alfresco/js-api';
describe('Sorting for process filters', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -44,8 +42,11 @@ describe('Sorting for process filters', () => {
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
const processInstancesApi = new ProcessInstancesApi(apiService.getInstance());
let tenantId, appId, user, processesQuery;
let importedApp;
let tenantId: number;
let appId: number;
let user: UserModel;
let processesQuery: ResultListDataRepresentationProcessInstanceRepresentation;
let importedApp: AppDefinitionRepresentation;
const processFilter = {
running_old_first: 'Running - Oldest first',
@@ -79,16 +80,17 @@ describe('Sorting for process filters', () => {
await modelsActions.deleteModel(appId);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(tenantId);
} catch (e) {
}
} catch (e) {}
await navigationBarPage.clickLogoutButton();
});
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
appId: null,
name: processFilter.running_old_first,
icon: 'glyphicon-random',
filter: { sort: 'created-asc', name: '', state: 'running' }
});
const processUtil = new ProcessUtil(apiService);
const firstProc = await processUtil.startProcessOfApp(importedApp.name);
@@ -100,7 +102,10 @@ describe('Sorting for process filters', () => {
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
await filtersPage.goToFilter(processFilter.running_old_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
processDefinitionId: null,
appDefinitionId: null,
state: 'running',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
@@ -109,8 +114,10 @@ describe('Sorting for process filters', () => {
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
appId: null,
name: processFilter.completed_old_first,
icon: 'glyphicon-random',
filter: { sort: 'created-asc', name: '', state: 'completed' }
});
const processUtil = new ProcessUtil(apiService);
@@ -129,7 +136,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.completed_old_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
processDefinitionId: null,
appDefinitionId: null,
state: 'completed',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
@@ -138,8 +148,10 @@ describe('Sorting for process filters', () => {
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
appId: null,
name: processFilter.all_old_first,
icon: 'glyphicon-random',
filter: { sort: 'created-asc', name: '', state: 'all' }
});
const processUtil = new ProcessUtil(apiService);
@@ -162,7 +174,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.all_old_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
processDefinitionId: null,
appDefinitionId: null,
state: 'all',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
@@ -174,8 +189,10 @@ describe('Sorting for process filters', () => {
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
appId: null,
name: processFilter.running_new_first,
icon: 'glyphicon-random',
filter: { sort: 'created-desc', name: '', state: 'running' }
});
const processUtil = new ProcessUtil(apiService);
@@ -190,7 +207,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.running_new_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
processDefinitionId: null,
appDefinitionId: null,
state: 'running',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
@@ -199,8 +219,10 @@ describe('Sorting for process filters', () => {
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
appId: null,
name: processFilter.completed_new_first,
icon: 'glyphicon-random',
filter: { sort: 'created-desc', name: '', state: 'completed' }
});
const processUtil = new ProcessUtil(apiService);
@@ -218,7 +240,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.completed_new_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
processDefinitionId: null,
appDefinitionId: null,
state: 'completed',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
@@ -227,8 +252,10 @@ describe('Sorting for process filters', () => {
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
appId: null,
name: processFilter.all_new_first,
icon: 'glyphicon-random',
filter: { sort: 'created-desc', name: '', state: 'all' }
});
const processUtil = new ProcessUtil(apiService);
@@ -251,7 +278,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.all_new_first);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
processDefinitionId: null,
appDefinitionId: null,
state: 'all',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
await expect(processesQuery.data[1].name).toEqual(deleteSecondProc.name);
@@ -263,8 +293,10 @@ describe('Sorting for process filters', () => {
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
appId: null,
name: processFilter.completed_most_recently,
icon: 'glyphicon-random',
filter: { sort: 'ended-asc', name: '', state: 'completed' }
});
const processUtil = new ProcessUtil(apiService);
@@ -283,7 +315,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.completed_most_recently);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
processDefinitionId: null,
appDefinitionId: null,
state: 'completed',
sort: 'ended-asc'
});
await expect(processesQuery.data[0].name).toEqual(secondProc.name);
await expect(processesQuery.data[1].name).toEqual(firstProc.name);
@@ -292,8 +327,10 @@ describe('Sorting for process filters', () => {
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => {
await userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
appId: null,
name: processFilter.completed_least_recently,
icon: 'glyphicon-random',
filter: { sort: 'ended-desc', name: '', state: 'completed' }
});
const processUtil = new ProcessUtil(apiService);
@@ -312,7 +349,10 @@ describe('Sorting for process filters', () => {
await filtersPage.goToFilter(processFilter.completed_least_recently);
processesQuery = await processInstancesApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
processDefinitionId: null,
appDefinitionId: null,
state: 'completed',
sort: 'ended-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(firstProc.name);

View File

@@ -15,26 +15,24 @@
* limitations under the License.
*/
import { createApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
import { createApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { UserFiltersApi } from '@alfresco/js-api';
import { UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
describe('New Process Filters', () => {
const loginPage = new LoginPage();
const processFiltersPage = new ProcessFiltersPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const appSettingsToggles = new AppSettingsTogglesPage();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
let tenantId; let user; let filterId; let customProcessFilter;
let tenantId: number;
let user: UserModel;
let filterId: number;
let customProcessFilter: UserProcessInstanceFilterRepresentation;
const processFilter = {
running: 'Running',
@@ -87,28 +85,6 @@ describe('New Process Filters', () => {
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_filter);
});
it('[C286450] Should display the process filter icon when a custom filter is added', async () => {
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
appId: null,
name: processFilter.new_icon,
icon: 'glyphicon-cloud',
filter: { sort: 'created-desc', name: '', state: 'running' }
});
filterId = customProcessFilter.id;
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
await expect(await processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud');
});
it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => {
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
appId: null,
@@ -131,51 +107,6 @@ describe('New Process Filters', () => {
await processFiltersPage.checkFilterIsDisplayed(processFilter.edited);
});
it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => {
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
appId: null,
name: processFilter.edit_icon,
icon: 'glyphicon-random',
filter: { sort: 'created-desc', name: '', state: 'running' }
});
filterId = customProcessFilter.id;
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
appId: null,
name: processFilter.edit_icon,
icon: 'glyphicon-cloud',
filter: { sort: 'created-desc', name: '', state: 'running' }
});
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await expect(await processFiltersPage.getFilterIcon(processFilter.edit_icon)).toEqual('cloud');
});
it('[C286452] Should display process filter icons only when showIcon property is set on true', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterHasNoIcon(processFilter.all);
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.all);
await expect(await processFiltersPage.getFilterIcon(processFilter.all)).toEqual('dashboard');
});
it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => {
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
appId: null,

View File

@@ -16,15 +16,14 @@
*/
import { browser } from 'protractor';
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions, UserModel } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessListPage } from './../pages/process-list.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import { ProcessListPage } from '../pages/process-list.page';
describe('Empty Process List Test', () => {
const appWithProcess = browser.params.resources.Files.APP_WITH_PROCESSES;
const simpleAppWithUserForm = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
@@ -37,7 +36,7 @@ describe('Empty Process List Test', () => {
const startProcessPage = new StartProcessPage();
const apiService = createApiService();
let user;
let user: UserModel;
beforeAll(async () => {
const usersActions = new UsersActions(apiService);
@@ -54,7 +53,7 @@ describe('Empty Process List Test', () => {
await applicationsService.importPublishDeployApp(simpleAppWithUserForm.file_path);
await loginPage.login(user.username, user.password);
});
});
it('[C260494] Should add process to list when a process is created', async () => {
await navigationBarPage.navigateToProcessServicesPage();

View File

@@ -15,20 +15,14 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
PaginationPage,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { AppDefinitionRepresentation } from '@alfresco/js-api';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
describe('Process List - Pagination when adding processes', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -46,8 +40,8 @@ describe('Process List - Pagination when adding processes', () => {
fifteenValue: 15
};
let processUserModel;
let resultApp;
let processUserModel: UserModel;
let resultApp: AppDefinitionRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -80,7 +74,7 @@ describe('Process List - Pagination when adding processes', () => {
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20' );
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20');
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
@@ -96,7 +90,7 @@ describe('Process List - Pagination when adding processes', () => {
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25' );
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25');
await expect(await processFiltersPage.numberOfProcessRows()).toBe(10);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();

View File

@@ -24,9 +24,9 @@ import { createApiService,
ViewerPage,
ModelsActions
} from '@alfresco/adf-testing';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import { AttachmentListPage } from '../pages/attachment-list.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
@@ -53,7 +53,9 @@ describe('Attachment list action menu for processes', () => {
});
const downloadedPngFile = pngFile.name;
let tenantId; let appId;
let tenantId: number;
let appId: number;
const processName = {
active: 'Active Process',
completed: 'Completed Process',

View File

@@ -15,26 +15,17 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
BrowserActions,
LoginPage,
StartProcessPage,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessListPage } from './../pages/process-list.page';
import { RuntimeAppDefinitionsApi, UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
import { ProcessServicesPage } from '../pages/process-services.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import { ProcessListPage } from '../pages/process-list.page';
import { browser } from 'protractor';
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
import CONSTANTS = require('../../util/constants');
import { ProcessListDemoPage } from '../pages/process-list-demo.page';
describe('Process Filters Test', () => {
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
const loginPage = new LoginPage();
@@ -50,10 +41,6 @@ describe('Process Filters Test', () => {
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
const appsApi = new RuntimeAppDefinitionsApi(apiService.getInstance());
let appModel; let user;
const processTitle = {
running: 'Test_running',
@@ -62,18 +49,12 @@ describe('Process Filters Test', () => {
one: 'Test fake process one',
two: 'Test fake process two'
};
const processFilter = {
running: 'Running',
all: 'All',
completed: 'Completed'
};
beforeAll(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser();
const user = await usersActions.createUser();
await apiService.login(user.username, user.password);
appModel = await applicationsService.importPublishDeployApp(app.file_path);
await applicationsService.importPublishDeployApp(app.file_path);
await loginPage.login(user.username, user.password);
});
@@ -107,7 +88,6 @@ describe('Process Filters Test', () => {
await startProcessPage.enterProcessName(processTitle.running);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
await processFiltersPage.selectFromProcessList(processTitle.running);
await processDetailsPage.propertiesList.waitVisible();
@@ -119,7 +99,6 @@ describe('Process Filters Test', () => {
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickAllFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.all);
await processFiltersPage.selectFromProcessList(processTitle.running);
await processFiltersPage.selectFromProcessList(processTitle.completed);
await processDetailsPage.propertiesList.waitVisible();
@@ -131,32 +110,10 @@ describe('Process Filters Test', () => {
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
await processFiltersPage.selectFromProcessList(processTitle.completed);
await processDetailsPage.propertiesList.waitVisible();
});
it('[C280407] Should be able to access the filters with URL', async () => {
const defaultFiltersNumber = 3;
let processFilterUrl;
const deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedAppId + '/processes/';
const taskAppFilters = await userFiltersApi.getUserProcessInstanceFilters({ appId: deployedAppId });
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await expect(taskAppFilters.size).toBe(defaultFiltersNumber);
for (const filter of taskAppFilters.data) {
await BrowserActions.getUrl(processFilterUrl + filter.id);
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.checkFilterIsHighlighted(filter.name);
}
});
it('[C260463] Should Cancel process be displayed in Completed process filters', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
@@ -172,86 +129,8 @@ describe('Process Filters Test', () => {
await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled);
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
await processListDemoPage.checkProcessIsDisplayed(processTitle.canceled);
await processFiltersPage.selectFromProcessList(processTitle.canceled);
await processDetailsPage.propertiesList.waitVisible();
});
it('[C213262] Default process filters', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName(processTitle.one);
await startProcessPage.clickFormStartProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
await processDetailsPage.propertiesList.waitVisible();
await checkProcessInfoDrawer({ name: processTitle.one });
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName(processTitle.two);
await startProcessPage.clickFormStartProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
await processDetailsPage.cancelProcessButton.click();
await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled);
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
await processFiltersPage.selectFromProcessList(processTitle.two);
await processFiltersPage.clickAllFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.all);
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
await processFiltersPage.selectFromProcessList(processTitle.two);
});
it('[C260384] Edit default filter', async () => {
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
await userFiltersApi
.updateUserProcessInstanceFilter(runningFilter.id, { ...runningFilter, name: 'Edited Running' });
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsNotDisplayed('Running');
await processFiltersPage.checkFilterIsDisplayed('Edited Running');
});
it('[C260385] Delete default filter', async () => {
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
await userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsNotDisplayed('All');
});
async function getFilter(): Promise<UserProcessInstanceFilterRepresentation[]> {
const apps = await appsApi.getAppDefinitions();
const { id: appId = 0 } = apps.data.find((application) => application.name === appModel.name);
const filters = await userFiltersApi.getUserProcessInstanceFilters({ appId });
return filters.data;
}
async function checkProcessInfoDrawer({ name }) {
await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(name);
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
await expect(await processDetailsPage.getCreatedBy()).toEqual(`${user.firstName} ${user.lastName}`);
await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
}
});

View File

@@ -16,23 +16,16 @@
*/
import { browser } from 'protractor';
import { createApiService,
ApplicationsUtil,
LoginPage,
ModelsActions,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { ProcessServicesPage } from './../pages/process-services.page';
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { ProcessListPage } from './../pages/process-list.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
import { ProcessListPage } from '../pages/process-list.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import * as moment from 'moment';
import { ProcessInstancesApi } from '@alfresco/js-api';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation, ProcessInstancesApi } from '@alfresco/js-api';
describe('Process Instance Details', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -48,7 +41,10 @@ describe('Process Instance Details', () => {
const modelsActions = new ModelsActions(apiService);
const processApi = new ProcessInstancesApi(apiService.getInstance());
let appModel; let process; let user;
let appModel: AppDefinitionRepresentation;
let process: ProcessInstanceRepresentation;
let user: UserModel;
const PROCESS_DATE_FORMAT = 'll';
beforeAll(async () => {
@@ -70,13 +66,13 @@ describe('Process Instance Details', () => {
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
process = await processApi.getProcessInstance(processModel.id);
});
});
afterAll(async () => {
await modelsActions.deleteModel(appModel.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
});
});
it('[C307031] Should display the created date in the default format', async () => {
await processDetailsPage.checkProcessHeaderDetailsAreVisible();

View File

@@ -15,19 +15,21 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
BrowserActions,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
ProcessUtil,
UsersActions
UsersActions,
UserModel
} from '@alfresco/adf-testing';
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
import { ProcessListDemoPage } from '../pages/process-list-demo.page';
import { browser } from 'protractor';
import { TaskFormsApi } from '@alfresco/js-api';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation, TaskFormsApi } from '@alfresco/js-api';
describe('Process List Test', () => {
const appWithDateField = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
const appWithUserWidget = browser.params.resources.Files.APP_WITH_USER_WIDGET;
@@ -40,7 +42,9 @@ describe('Process List Test', () => {
const modelsActions = new ModelsActions(apiService);
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
let appDateModel; let appUserWidgetModel; let user;
let appDateModel: AppDefinitionRepresentation;
let appUserWidgetModel: AppDefinitionRepresentation;
let user: UserModel;
const processList = ['Process With Date', 'Process With Date 2', 'Process With User Widget', 'Process With User Widget 2'];
@@ -56,8 +60,10 @@ describe('Process List Test', () => {
insertAppId: 'Insert App ID'
};
let appWithDateFieldId;
let procWithDate; let completedProcWithDate; let completedProcWithUserWidget;
let appWithDateFieldId: string | number;
let procWithDate: ProcessInstanceRepresentation;
let completedProcWithDate: ProcessInstanceRepresentation;
let completedProcWithUserWidget: ProcessInstanceRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -87,7 +93,7 @@ describe('Process List Test', () => {
await taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
await loginPage.login(user.username, user.password);
});
});
afterAll(async () => {
await modelsActions.deleteModel(appDateModel.id);
@@ -96,11 +102,11 @@ describe('Process List Test', () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
});
});
beforeEach(async () => {
await BrowserActions.getUrl(browser.baseUrl + '/process-list');
});
});
it('[C286638] Should display all process by default', async () => {
await processListDemoPage.checkAppIdFieldIsDisplayed();

View File

@@ -1,381 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
ApplicationsUtil,
LoginPage,
PaginationPage,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
describe('Process List - Pagination', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const paginationPage = new PaginationPage();
const processFiltersPage = new ProcessFiltersPage();
const processDetailsPage = new ProcessDetailsPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const itemsPerPage = {
five: '5',
fiveValue: 5,
ten: '10',
tenValue: 10,
fifteen: '15',
fifteenValue: 15,
twenty: '20',
twentyValue: 20,
default: '25'
};
const processFilterRunning = 'Running';
let deployedTestApp;
let processUserModel;
const nrOfProcesses = 20;
let page;
let totalPages;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
deployedTestApp = await applicationsService.importPublishDeployApp(app.file_path);
await loginPage.login(processUserModel.username, processUserModel.password);
});
describe('With processes Pagination', () => {
beforeAll(async () => {
await apiService.login(processUserModel.username, processUserModel.password);
for (let i = 0; i < nrOfProcesses; i++) {
await new ProcessUtil(apiService).startProcessOfApp(deployedTestApp.name);
}
});
beforeEach(async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
});
it('[C261042] Should display default pagination', async () => {
page = 1;
totalPages = 1;
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C261043] Should be possible to Items per page to 15', async () => {
page = 1;
totalPages = 2;
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C261044] Should be possible to Items per page to 10', async () => {
page = 1;
totalPages = 2;
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
});
it('[C261047] Should be possible to Items per page to 20', async () => {
page = 1;
totalPages = 1;
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
});
it('[C261045] Should be possible to Items per page to 5', async () => {
let showing;
page = 1;
totalPages = 4;
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
showing = (itemsPerPage.fiveValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
showing = (itemsPerPage.fiveValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page++;
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
showing = (itemsPerPage.fiveValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page++;
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
showing = (itemsPerPage.fiveValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
});
it('[C261049] Should be possible to open page number dropdown', async () => {
let showing;
page = 1;
totalPages = 2;
await processFiltersPage.clickRunningFilterButton();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
showing = (itemsPerPage.tenValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
page = 2;
await paginationPage.clickOnPageDropdownOption('2');
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
showing = (itemsPerPage.tenValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
page = 1;
await paginationPage.clickOnPageDropdownOption('1');
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
showing = (itemsPerPage.tenValue * page);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C261048] Should be possible to sort processes by name', async () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await processFiltersPage.sortByName('ASC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
await processFiltersPage.sortByName('DESC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameDesc();
});
it('[C286260] Should keep sorting when changing \'Items per page\'', async () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await processFiltersPage.sortByName('ASC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
});
});
});

View File

@@ -30,15 +30,14 @@ import { createApiService,
import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { ProcessInstancesApi } from '@alfresco/js-api';
import { AttachmentListPage } from '../pages/attachment-list.page';
import { ProcessDetailsPage } from '../pages/process-details.page';
import { ProcessFiltersPage } from '../pages/process-filters.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
import { AppDefinitionRepresentation, ProcessInstancesApi } from '@alfresco/js-api';
describe('Start Process Component', () => {
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
@@ -62,7 +61,9 @@ describe('Start Process Component', () => {
let procUserModel: UserModel;
let secondProcUserModel: UserModel;
let appCreated; let simpleAppCreated; let dateFormAppCreated;
let appCreated: AppDefinitionRepresentation;
let simpleAppCreated: AppDefinitionRepresentation;
let dateFormAppCreated: AppDefinitionRepresentation;
const processName255Characters = StringUtil.generateRandomString(255);
const processNameBiggerThen255Characters = StringUtil.generateRandomString(256);
@@ -77,7 +78,6 @@ describe('Start Process Component', () => {
});
describe('Provider: BPM', () => {
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -121,7 +121,6 @@ describe('Start Process Component', () => {
});
describe(' Once logged with user with app', () => {
beforeEach(async () => {
await loginPage.login(secondProcUserModel.username, secondProcUserModel.password);
await navigationBarPage.navigateToProcessServicesPage();
@@ -264,7 +263,9 @@ describe('Start Process Component', () => {
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.enterProcessName('Type');
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
await startProcessPage.clickStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Type');
@@ -278,7 +279,9 @@ describe('Start Process Component', () => {
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.pressDownArrowAndEnter();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
});
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
@@ -288,7 +291,9 @@ describe('Start Process Component', () => {
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
await startProcessPage.clickProcessDropdownArrow();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');

View File

@@ -25,7 +25,7 @@ import { createApiService,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { TasksPage } from '../pages/tasks.page';
import { CommentsPage } from '../../core/pages/comments.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api';
@@ -47,7 +47,9 @@ describe('Comment component for Processes', () => {
const activitiCommentsApi = new ActivitiCommentsApi(apiService.getInstance());
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
let user; let appId; let secondUser;
let user: UserModel;
let appId: number;
let secondUser: UserModel;
const taskName = {
completed_task: 'Test Completed',

View File

@@ -15,20 +15,13 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
PaginationPage,
StringUtil, TaskUtil,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, StringUtil, TaskUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
describe('Task List Pagination - Sorting', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -41,9 +34,8 @@ describe('Task List Pagination - Sorting', () => {
const taskUtil = new TaskUtil(apiService);
const nrOfTasks = 20;
let processUserModel;
const taskNameBase = 'Task';
const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, taskNameBase, '');
let processUserModel: UserModel;
const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, 'Task', '');
const itemsPerPage = {
five: '5',

View File

@@ -25,7 +25,7 @@ import {
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { TasksPage } from '../pages/tasks.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
import CONSTANTS = require('../../util/constants');
@@ -40,8 +40,8 @@ describe('Start Task - Task App', () => {
const taskPage = new TasksPage();
const widget = new Widget();
let processUserModel; let anotherUser;
const noFormMessage = 'No forms attached';
let processUserModel: UserModel;
let anotherUser: UserModel;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -81,7 +81,7 @@ describe('Start Task - Task App', () => {
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
await taskPage.taskDetails().checkAttachFormButtonIsEnabled();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
});
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
@@ -139,7 +139,7 @@ describe('Start Task - Task App', () => {
await taskPage.formFields().noFormIsDisplayed();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
});
it('[C329799] Form actions are enabled in assigned task', async () => {

View File

@@ -20,32 +20,29 @@ import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { AttachmentListPage } from '../pages/attachment-list.page';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
import { AppDefinitionRepresentation } from '@alfresco/js-api';
describe('Start Task - Custom App', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const attachmentListPage = new AttachmentListPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
let processUserModel; let assigneeUserModel;
const formTextField = app.form_fields.form_fieldId;
const formFieldValue = 'First value ';
let processUserModel: UserModel;
let assigneeUserModel: UserModel;
const taskPage = new TasksPage();
const firstComment = 'comm1'; const firstChecklist = 'checklist1';
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner'];
const showHeaderTask = 'Show Header';
let appModel;
let appModel: AppDefinitionRepresentation;
const pngFile = new FileModel({
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
@@ -62,7 +59,7 @@ describe('Start Task - Custom App', () => {
appModel = await applicationsService.importPublishDeployApp(app.file_path);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
it('[C263942] Should be possible to modify a task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
@@ -86,14 +83,19 @@ describe('Start Task - Custom App', () => {
await taskDetails.clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
).toEqual(assigneeUserModel.email);
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await taskDetails.selectActivityTab();
const firstComment = 'comm1';
await taskDetails.addComment(firstComment);
await taskDetails.checkCommentIsDisplayed(firstComment);
const checklistDialog = await taskPage.clickOnAddChecklistButton();
const firstChecklist = 'checklist1';
await checklistDialog.addName(firstChecklist);
await checklistDialog.clickCreateChecklistButton();
@@ -137,6 +139,8 @@ describe('Start Task - Custom App', () => {
});
it('[C263949] Should be possible to save filled form', async () => {
const formFieldValue = 'First value ';
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
@@ -146,22 +150,15 @@ describe('Start Task - Custom App', () => {
await task.addName(tasks[4]);
await task.clickStartButton();
const formTextField = app.form_fields.form_fieldId;
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
await taskPage.formFields().refreshForm();
await taskPage.formFields().checkFieldValue(formTextField, '');
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
await taskPage.formFields().saveForm();
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
});
@@ -198,25 +195,4 @@ describe('Start Task - Custom App', () => {
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
});
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(showHeaderTask);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
});
});

View File

@@ -26,19 +26,16 @@ import { createApiService,
import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { AttachmentListPage } from '../pages/attachment-list.page';
import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page';
import { TasksPage } from '../pages/tasks.page';
import * as CONSTANTS from '../../util/constants';
describe('Start Task - Task App', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
const attachmentListPage = new AttachmentListPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
@@ -46,16 +43,11 @@ describe('Start Task - Task App', () => {
const taskUtil = new TaskUtil(apiService);
const applicationsUtil = new ApplicationsUtil(apiService);
let processUserModel; let assigneeUserModel;
let processUserModel: UserModel;
let assigneeUserModel: UserModel;
const formTextField = app.form_fields.form_fieldId;
const formFieldValue = 'First value ';
const taskPage = new TasksPage();
const firstComment = 'comm1'; const firstChecklist = 'checklist1';
const taskName255Characters = StringUtil.generateRandomString(255);
const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256);
const lengthValidationError = 'Length exceeded, 255 characters max.';
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
const showHeaderTask = 'Show Header';
const jpgFile = new FileModel({
location: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_location,
name: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name
@@ -72,7 +64,7 @@ describe('Start Task - Task App', () => {
await applicationsUtil.importApplication(app.file_path);
await taskUtil.createStandaloneTask(showHeaderTask);
await taskUtil.createStandaloneTask('Show Header');
await loginPage.login(processUserModel.username, processUserModel.password);
});
@@ -101,9 +93,11 @@ describe('Start Task - Task App', () => {
.toEqual(assigneeUserModel.email);
await taskDetails.selectActivityTab();
const firstComment = 'comm1';
await taskDetails.addComment(firstComment);
await taskDetails.checkCommentIsDisplayed(firstComment);
const firstChecklist = 'checklist1';
await (await taskPage.clickOnAddChecklistButton()).addName(firstChecklist);
const checklistDialog = new ChecklistDialog();
@@ -133,6 +127,7 @@ describe('Start Task - Task App', () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
const formFields = await taskPage.formFields();
const formFieldValue = 'First value ';
await formFields.setFieldValue(formTextField, formFieldValue);
await formFields.refreshForm();
@@ -169,29 +164,16 @@ describe('Start Task - Task App', () => {
await attachmentListPage.checkFileIsAttached(jpgFile.name);
});
it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
});
it('[C291780] Should be displayed an error message if task name exceed 255 characters', async () => {
const startDialog = await taskPage.createNewTask();
const taskName255Characters = StringUtil.generateRandomString(255);
await startDialog.addName(taskName255Characters);
await startDialog.checkStartButtonIsEnabled();
const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256);
await startDialog.addName(taskNameBiggerThen255Characters);
await startDialog.blur(startDialog.name);
const lengthValidationError = 'Length exceeded, 255 characters max.';
await startDialog.checkValidationErrorIsDisplayed(lengthValidationError);
await startDialog.checkStartButtonIsDisabled();
});

View File

@@ -71,8 +71,7 @@ describe('Task Assignee', () => {
tenantId: user.tenantId,
type: 1
});
} catch (e) {
}
} catch {}
await apiService.login(user.username, user.password);
await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });

View File

@@ -24,17 +24,16 @@ import { createApiService,
ViewerPage
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { TasksPage } from '../pages/tasks.page';
import { AttachmentListPage } from '../pages/attachment-list.page';
import * as fs from 'fs';
import * as path from 'path';
import { FileModel } from '../../models/ACS/file.model';
import CONSTANTS = require('../../util/constants');
import { Activiti } from '@alfresco/js-api';
import { Activiti, RelatedContentRepresentation } from '@alfresco/js-api';
import ContentApi = Activiti.ContentApi;
describe('Attachment list action menu for tasks', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -55,7 +54,10 @@ describe('Attachment list action menu for tasks', () => {
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
});
const downloadedPngFile = pngFile.name;
let tenantId; let appId; let relatedContent; let relatedContentId;
let tenantId: number;
let appId: number;
let relatedContent: RelatedContentRepresentation;
let relatedContentId: number;
const taskName = {
active: 'Active Task',
completed: 'Completed Task',
@@ -64,7 +66,6 @@ describe('Attachment list action menu for tasks', () => {
};
beforeAll(async () => {
await apiService.loginWithProfile('admin');
const user = await usersActions.createUser();
tenantId = user.tenantId;

View File

@@ -19,17 +19,18 @@ import {
LoginPage,
BrowserActions,
FileBrowserUtil,
ApplicationsUtil, createApiService,
ApplicationsUtil,
createApiService,
UsersActions,
TaskUtil
TaskUtil,
UserModel
} from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { TasksPage } from '../pages/tasks.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import CONSTANTS = require('../../util/constants');
import { browser } from 'protractor';
describe('Task Audit', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -40,11 +41,10 @@ describe('Task Audit', () => {
const usersActions = new UsersActions(apiService);
const taskUtil = new TaskUtil(apiService);
let processUserModel;
let processUserModel: UserModel;
const taskTaskApp = 'Audit task task app';
const taskCustomApp = 'Audit task custom app';
const taskCompleteCustomApp = 'Audit completed task custom app';
const auditLogFile = 'Audit.pdf';
beforeAll(async () => {
@@ -59,7 +59,7 @@ describe('Task Audit', () => {
await loginPage.login(processUserModel.username, processUserModel.password);
});
afterAll( async () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
@@ -96,7 +96,8 @@ describe('Task Audit', () => {
it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.createTask({name: taskCompleteCustomApp});
const taskCompleteCustomApp = 'Audit completed task custom app';
await taskPage.createTask({ name: taskCompleteCustomApp });
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp);
@@ -113,7 +114,7 @@ describe('Task Audit', () => {
it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.createTask({name: taskCustomApp});
await taskPage.createTask({ name: taskCustomApp });
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp);

View File

@@ -15,27 +15,30 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
ProcessUtil,
StringUtil, TaskUtil,
StringUtil,
TaskUtil,
UsersActions,
Widget,
FormUtil
FormUtil,
UserModel
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FiltersPage } from './../pages/filters.page';
import { TaskDetailsPage } from './../pages/task-details.page';
import { TasksListPage } from './../pages/tasks-list.page';
import { TasksPage } from './../pages/tasks.page';
import { AttachFormPage } from './../pages/attach-form.page';
import { FiltersPage } from '../pages/filters.page';
import { TaskDetailsPage } from '../pages/task-details.page';
import { TasksListPage } from '../pages/tasks-list.page';
import { TasksPage } from '../pages/tasks.page';
import { AttachFormPage } from '../pages/attach-form.page';
import CONSTANTS = require('../../util/constants');
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
import { ModelRepresentation, TaskActionsApi, TaskRepresentation, TasksApi } from '@alfresco/js-api';
describe('Task Details - Form', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -56,7 +59,12 @@ describe('Task Details - Form', () => {
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
const tasksApi = new TasksApi(apiService.getInstance());
let task; let otherTask; let user; let newForm; let attachedForm; let otherAttachedForm;
let task: TaskRepresentation;
let otherTask: TaskRepresentation;
let user: UserModel;
let newForm: ModelRepresentation;
let attachedForm: ModelRepresentation;
let otherAttachedForm: ModelRepresentation;
beforeAll(async () => {
const attachedFormModel = {
@@ -183,7 +191,8 @@ describe('Task Details - Form', () => {
tabFieldVar: 'tabBasicFieldVar'
};
let newTask; let appModel;
let newTask;
let appModel;
beforeAll(async () => {
appModel = await applicationsService.importPublishDeployApp(app.file_path);

View File

@@ -15,14 +15,14 @@
* limitations under the License.
*/
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { AppDefinitionRepresentation } from '@alfresco/js-api';
describe('Task Details - No form', () => {
const app = browser.params.resources.Files.NO_FORM_APP;
const loginPage = new LoginPage();
@@ -32,9 +32,8 @@ describe('Task Details - No form', () => {
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
let processUserModel;
const noFormMessage = 'No forms attached';
let importedApp;
let processUserModel: UserModel;
let importedApp: AppDefinitionRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -45,9 +44,9 @@ describe('Task Details - No form', () => {
importedApp = await applicationsService.importPublishDeployApp(app.file_path);
await new ProcessUtil(apiService).startProcessOfApp(importedApp.name);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
afterAll( async () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
@@ -63,6 +62,8 @@ describe('Task Details - No form', () => {
await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled();
await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
const noFormMessage = 'No forms attached';
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});
});
});

View File

@@ -15,18 +15,22 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
BrowserActions,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
ProcessUtil,
StringUtil, TaskUtil,
UsersActions
StringUtil,
TaskUtil,
UsersActions,
UserModel
} from '@alfresco/adf-testing';
import { ProcessServicesPage } from './../pages/process-services.page';
import { TasksPage } from './../pages/tasks.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import { TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api';
import { AppDefinitionRepresentation, TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api';
import Task = require('../../models/APS/Task');
import TaskModel = require('../../models/APS/TaskModel');
import FormModel = require('../../models/APS/FormModel');
@@ -34,7 +38,6 @@ import CONSTANTS = require('../../util/constants');
import * as moment from 'moment';
describe('Task Details component', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const processServices = new ProcessServicesPage();
@@ -49,10 +52,11 @@ describe('Task Details component', () => {
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
let processUserModel; let appModel;
let processUserModel: UserModel;
let appModel: AppDefinitionRepresentation;
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
const TASK_DATE_FORMAT = 'll';
let formModel;
let formModel: any;
const taskFormModel = {
name: StringUtil.generateRandomString(),
@@ -162,7 +166,7 @@ describe('Task Details component', () => {
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
@@ -193,7 +197,7 @@ describe('Task Details component', () => {
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
@@ -310,7 +314,7 @@ describe('Task Details component', () => {
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
});
it('[C260321] Should not be able to edit a completed task\'s details', async () => {
it('[C260321] Should not be able to edit a completed task details', async () => {
const taskName = 'TaskCompleted';
const form = await modelsActions.modelsApi.createModel(taskFormModel);
const task = await taskUtil.createStandaloneTask(taskName);

View File

@@ -18,248 +18,155 @@
import { createApiService,
ApplicationsUtil,
LoginPage, ModelsActions,
UserFiltersUtil,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { TasksPage } from './../pages/tasks.page';
import { TasksListPage } from './../pages/tasks-list.page';
import { TaskDetailsPage } from './../pages/task-details.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page';
import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
import { ProcessServicesPage } from '../pages/process-services.page';
import { TasksPage } from '../pages/tasks.page';
import { TasksListPage } from '../pages/tasks-list.page';
import { TaskDetailsPage } from '../pages/task-details.page';
import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page';
import { browser } from 'protractor';
describe('Task', () => {
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
describe('Filters', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const processServicesPage = new ProcessServicesPage();
const tasksPage = new TasksPage();
const tasksListPage = new TasksListPage();
const taskDetailsPage = new TaskDetailsPage();
const taskFiltersDemoPage = new TaskFiltersDemoPage();
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const modelsActions = new ModelsActions(apiService);
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const processServicesPage = new ProcessServicesPage();
const tasksPage = new TasksPage();
const tasksListPage = new TasksListPage();
const taskDetailsPage = new TaskDetailsPage();
const taskFiltersDemoPage = new TaskFiltersDemoPage();
let appId: number;
let user: UserModel;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const modelsActions = new ModelsActions(apiService);
beforeEach(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser();
let appId: number; let user: UserModel;
await apiService.login(user.username, user.password);
const applicationsService = new ApplicationsUtil(apiService);
const { id } = await applicationsService.importPublishDeployApp(app.file_path);
appId = id;
beforeEach(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser();
await apiService.login(user.username, user.password);
const applicationsService = new ApplicationsUtil(apiService);
const { id } = await applicationsService.importPublishDeployApp(app.file_path);
appId = id;
await loginPage.login(user.username, user.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
});
afterEach(async () => {
await modelsActions.deleteModel(appId);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
await navigationBarPage.clickLogoutButton();
});
it('[C279967] Should display default filters when an app is deployed', async () => {
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
});
it('[C260330] Should display Task Filter List when app is in Task Tab', async () => {
await tasksPage.createTask({ name: 'Test' });
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
});
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
const task = await tasksPage.createNewTask();
await task.addName('Test');
await task.clickStartButton();
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
});
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
await tasksPage.createTask({ name: 'Test1' });
await taskDetailsPage.clickCompleteTask();
await tasksPage.createTask({ name: 'Test2' });
await taskDetailsPage.clickCompleteTask();
await tasksPage.createTask({ name: 'Test3' });
await tasksPage.createTask({ name: 'Test4' });
await tasksListPage.checkContentIsDisplayed('Test4');
await tasksListPage.checkRowIsSelected('Test4');
await tasksListPage.checkContentIsDisplayed('Test3');
await taskDetailsPage.checkTaskDetailsDisplayed();
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
await tasksPage.clickSortByNameDesc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test1');
await tasksListPage.checkContentIsDisplayed('Test2');
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test3');
await tasksListPage.checkContentIsDisplayed('Test4');
});
it('[C277264] Should display task filter results when task filter is selected', async () => {
await tasksPage.createTask({ name: 'Test' });
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
});
await loginPage.login(user.username, user.password);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
});
describe('Custom Filters', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const processServicesPage = new ProcessServicesPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const appSettingsToggles = new AppSettingsTogglesPage();
const taskFiltersDemoPage = new TaskFiltersDemoPage();
afterEach(async () => {
await modelsActions.deleteModel(appId);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
await navigationBarPage.clickLogoutButton();
});
const apiService = createApiService();
const userFiltersApi = new UserFiltersUtil(apiService);
const usersActions = new UsersActions(apiService);
it('[C279967] Should display default filters when an app is deployed', async () => {
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
});
let user;
let appId: number;
it('[C260330] Should display Task Filter List when app is in Task Tab', async () => {
await tasksPage.createTask({ name: 'Test' });
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
beforeAll(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser();
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await apiService.login(user.username, user.password);
const applicationsService = new ApplicationsUtil(apiService);
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
appId = await applicationsService.getAppDefinitionId(importedApp.id);
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
});
await loginPage.login(user.username, user.password);
});
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
});
const task = await tasksPage.createNewTask();
await task.addName('Test');
await task.clickStartButton();
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
beforeEach(async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
});
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
it('[C260350] Should display a new filter when a filter is added', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
name: 'New Task Filter',
appId,
icon: 'glyphicon-filter',
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
});
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
await userFiltersApi.deleteUserTaskFilter(id);
});
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
});
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
name: 'New Task Filter with icon',
appId,
icon: 'glyphicon-cloud',
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
});
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
await tasksPage.createTask({ name: 'Test1' });
await taskDetailsPage.clickCompleteTask();
await browser.refresh();
await processServiceTabBarPage.clickSettingsButton();
await browser.sleep(500);
await appSettingsToggles.enableTaskFiltersIcon();
await processServiceTabBarPage.clickTasksButton();
await tasksPage.createTask({ name: 'Test2' });
await taskDetailsPage.clickCompleteTask();
await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud');
await userFiltersApi.deleteUserTaskFilter(id);
});
await tasksPage.createTask({ name: 'Test3' });
await tasksPage.createTask({ name: 'Test4' });
it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => {
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterHasNoIcon();
await tasksListPage.checkContentIsDisplayed('Test4');
await tasksListPage.checkRowIsSelected('Test4');
await tasksListPage.checkContentIsDisplayed('Test3');
await taskDetailsPage.checkTaskDetailsDisplayed();
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableTaskFiltersIcon();
await processServiceTabBarPage.clickTasksButton();
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
await tasksPage.clickSortByNameDesc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await expect(await taskFiltersDemoPage.myTasksFilter().getTaskFilterIcon()).toEqual('inbox');
});
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test1');
await tasksListPage.checkContentIsDisplayed('Test2');
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test3');
await tasksListPage.checkContentIsDisplayed('Test4');
});
it('[C277264] Should display task filter results when task filter is selected', async () => {
await tasksPage.createTask({ name: 'Test' });
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
});
});

View File

@@ -15,18 +15,17 @@
* limitations under the License.
*/
import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { TasksPage } from './../pages/tasks.page';
import { TasksListPage } from './../pages/tasks-list.page';
import { TaskDetailsPage } from './../pages/task-details.page';
import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { TasksPage } from '../pages/tasks.page';
import { TasksListPage } from '../pages/tasks-list.page';
import { TaskDetailsPage } from '../pages/task-details.page';
import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page';
import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
import { browser } from 'protractor';
describe('Task Filters Sorting', () => {
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
const loginPage = new LoginPage();
@@ -41,8 +40,8 @@ describe('Task Filters Sorting', () => {
const usersActions = new UsersActions(apiService);
const userFiltersUtil = new UserFiltersUtil(apiService);
let user;
let appId;
let user: UserModel;
let appId: number;
const tasks = [
{ name: 'Task 1 Completed', dueDate: '01/01/2019' },
@@ -50,7 +49,8 @@ describe('Task Filters Sorting', () => {
{ name: 'Task 3 Completed', dueDate: '03/01/2019' },
{ name: 'Task 4', dueDate: '01/01/2019' },
{ name: 'Task 5', dueDate: '02/01/2019' },
{ name: 'Task 6', dueDate: '03/01/2019' }];
{ name: 'Task 6', dueDate: '03/01/2019' }
];
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -67,21 +67,21 @@ describe('Task Filters Sorting', () => {
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await tasksPage.createTask({name: tasks[0].name, dueDate: tasks[0].dueDate});
await tasksPage.createTask({ name: tasks[0].name, dueDate: tasks[0].dueDate });
await taskDetailsPage.clickCompleteTask();
await tasksPage.createTask({name: tasks[1].name, dueDate: tasks[1].dueDate});
await tasksPage.createTask({ name: tasks[1].name, dueDate: tasks[1].dueDate });
await taskDetailsPage.clickCompleteTask();
await tasksPage.createTask({name: tasks[2].name, dueDate: tasks[2].dueDate});
await tasksPage.createTask({ name: tasks[2].name, dueDate: tasks[2].dueDate });
await taskDetailsPage.clickCompleteTask();
await tasksPage.createTask({name: tasks[3].name, dueDate: tasks[3].dueDate});
await tasksPage.createTask({name: tasks[4].name, dueDate: tasks[4].dueDate});
await tasksPage.createTask({name: tasks[5].name, dueDate: tasks[5].dueDate});
await tasksPage.createTask({ name: tasks[3].name, dueDate: tasks[3].dueDate });
await tasksPage.createTask({ name: tasks[4].name, dueDate: tasks[4].dueDate });
await tasksPage.createTask({ name: tasks[5].name, dueDate: tasks[5].dueDate });
});
afterAll( async () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(user.tenantId);
});
@@ -89,7 +89,7 @@ describe('Task Filters Sorting', () => {
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Newest first',
name: 'Newest first',
icon: 'glyphicon-filter',
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
});
@@ -101,12 +101,12 @@ describe('Task Filters Sorting', () => {
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
});
});
it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Newest last',
name: 'Newest last',
icon: 'glyphicon-filter',
filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' }
});
@@ -123,7 +123,7 @@ describe('Task Filters Sorting', () => {
it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Due first',
name: 'Due first',
icon: 'glyphicon-filter',
filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' }
});
@@ -140,7 +140,7 @@ describe('Task Filters Sorting', () => {
it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Due last',
name: 'Due last',
icon: 'glyphicon-filter',
filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' }
});
@@ -157,7 +157,7 @@ describe('Task Filters Sorting', () => {
it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Newest first Open',
name: 'Newest first Open',
icon: 'glyphicon-filter',
filter: { sort: 'created-desc', state: 'open', assignment: 'involved' }
});
@@ -174,7 +174,7 @@ describe('Task Filters Sorting', () => {
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Newest last Open',
name: 'Newest last Open',
icon: 'glyphicon-filter',
filter: { sort: 'created-asc', state: 'open', assignment: 'involved' }
});
@@ -191,7 +191,7 @@ describe('Task Filters Sorting', () => {
it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Due first Open',
name: 'Due first Open',
icon: 'glyphicon-filter',
filter: { sort: 'due-desc', state: 'open', assignment: 'involved' }
});
@@ -208,7 +208,7 @@ describe('Task Filters Sorting', () => {
it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => {
const newFilter = new UserProcessInstanceFilterRepresentation({
appId,
name : 'Due last Open',
name: 'Due last Open',
icon: 'glyphicon-filter',
filter: { sort: 'due-asc', state: 'open', assignment: 'involved' }
});

View File

@@ -25,7 +25,7 @@ import { createApiService,
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
describe('Task List Pagination', () => {
@@ -42,7 +42,7 @@ describe('Task List Pagination', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
let currentPage = 1;
const nrOfTasks = 20;
let totalPages;
let totalPages: number;
const itemsPerPage = {
five: '5',

View File

@@ -15,22 +15,23 @@
* limitations under the License.
*/
import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
import { browser } from 'protractor';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Amount Widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.AMOUNT;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
const apiService = createApiService();
const applicationsService = new ApplicationsUtil(apiService);
@@ -49,7 +50,7 @@ describe('Amount Widget', () => {
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedAppId}/tasks/`;
@@ -64,7 +65,7 @@ describe('Amount Widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id);
@@ -78,12 +79,12 @@ describe('Amount Widget', () => {
await expect(fieldCurrency.trim()).toBe('$');
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5');
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be less than 5`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100');
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be greater than 100`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
FileBrowserUtil,
LoginPage,
UsersActions,
ViewerPage,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, FileBrowserUtil, LoginPage, UsersActions, ViewerPage, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
@@ -33,7 +26,6 @@ import { FiltersPage } from '../pages/filters.page';
import CONSTANTS = require('../../util/constants');
describe('Attach widget - File', () => {
const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
const loginPage = new LoginPage();
@@ -49,9 +41,8 @@ describe('Attach widget - File', () => {
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
let processUserModel;
const pdfFile = new FileModel({name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name});
const appFields = app.form_fields;
let processUserModel: UserModel;
const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -73,8 +64,8 @@ describe('Attach widget - File', () => {
await newTask.selectForm(app.formName);
await newTask.clickStartButton();
await widget.attachFileWidget().attachFile(appFields.attachFile_id, pdfFile.location);
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().attachFile(app.form_fields.attachFile_id, pdfFile.location);
await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name);
});
afterAll(async () => {
@@ -83,7 +74,7 @@ describe('Attach widget - File', () => {
});
it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => {
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().checkAttachFileOptionsActiveForm();
await widget.attachFileWidget().viewAttachedFile();
@@ -91,11 +82,11 @@ describe('Attach widget - File', () => {
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.clickCloseButton();
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().downloadFile();
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().removeAttachedFile();
await widget.attachFileWidget().attachFileWidgetDisplayed();
});
@@ -107,9 +98,9 @@ describe('Attach widget - File', () => {
await tasksListPage.checkTaskListIsLoaded();
await filtersPage.goToFilter('Completed Tasks');
await tasksListPage.checkTaskListIsLoaded();
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().checkAttachFileOptionsCompletedForm();
await widget.attachFileWidget().viewAttachedFile();
@@ -117,7 +108,7 @@ describe('Attach widget - File', () => {
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.clickCloseButton();
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().downloadFile();
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
});

View File

@@ -15,31 +15,24 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Attach Folder widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -58,11 +51,10 @@ describe('Attach Folder widget', () => {
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -72,7 +64,7 @@ describe('Attach Folder widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id);

View File

@@ -15,29 +15,24 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Checkbox Widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.CHECKBOX;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
let processUserModel;
let appModel;
let deployedAppId; let process;
let processUserModel: UserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -56,10 +51,10 @@ describe('Checkbox Widget', () => {
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
beforeEach(async () => {
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
@@ -68,7 +63,7 @@ describe('Checkbox Widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C268554] Should be able to set general settings for Checkbox widget ', async () => {
await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2');

View File

@@ -15,18 +15,19 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
Widget, UserModel
} from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Date and time widget', () => {
@@ -35,16 +36,16 @@ describe('Date and time widget', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let processUserModel;
let appModel;
let deployedAppId; let process;
let processUserModel: UserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -61,8 +62,7 @@ describe('Date and time widget', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();

View File

@@ -15,22 +15,23 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
BrowserActions,
FormPage,
LoginPage,
ProcessUtil,
UsersActions,
Widget
Widget, UserModel
} from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import { FormDemoPage } from '.././pages/form-demo.page';
import { FormDemoPage } from '../pages/form-demo.page';
import { customDateFormAPS1 } from '../../resources/forms/custom-date-form';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Date widget', () => {
@@ -39,12 +40,12 @@ describe('Date widget', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const dateWidget = widget.dateWidget();
let appModel;
let processUserModel;
let deployedAppId; let process;
let appModel: AppDefinitionRepresentation;
let processUserModel: UserModel;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -73,8 +74,7 @@ describe('Date widget', () => {
describe('Simple App', () => {
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -113,13 +113,11 @@ describe('Date widget', () => {
await formDemoPage.setConfigToEditor(formJson);
await dateWidget.setDateInput('datefield', '18-7-19');
await formPage.saveForm();
await expect(await dateWidget.getErrorMessage('datefield'))
.toBe('Can\'t be less than 19-7-19', 'Min date validation is not working');
await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be less than 19-7-19');
await dateWidget.clearDateInput('datefield');
await dateWidget.setDateInput('datefield', '20-7-19');
await formPage.saveForm();
await expect(await dateWidget.getErrorMessage('datefield'))
.toBe('Can\'t be greater than 19-8-19', 'Max date validation is not working');
await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be greater than 19-8-19');
await dateWidget.clearDateInput('datefield');
await dateWidget.setDateInput('datefield', '19-7-19');
await formPage.saveForm();

View File

@@ -15,54 +15,46 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Document Template widget', () => {
const app = browser.params.resources.Files.FILE_FORM_ADF;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp( app.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(app.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessOfApp(appModel.name);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessOfApp(appModel.name);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -72,10 +64,9 @@ describe('Document Template widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C260406] should check that the template contains assigned file ', async () => {
await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id))
.toEqual(app.attached_file);
await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)).toEqual(app.attached_file);
});
});

View File

@@ -15,18 +15,19 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
import {
createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget, UserModel
} from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Dropdown widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DROPDOWN;
@@ -34,34 +35,33 @@ describe('Dropdown widget', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();

View File

@@ -15,21 +15,22 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
Widget, UserModel
} from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Dynamic Table widget ', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
@@ -40,8 +41,9 @@ describe('Dynamic Table widget ', () => {
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let processUserModel;
let deployedAppId; let process;
let processUserModel: UserModel;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
describe('with Date Time Widget App', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
@@ -60,8 +62,7 @@ describe('Dynamic Table widget ', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -117,8 +118,7 @@ describe('Dynamic Table widget ', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkTaskListIsLoaded();
@@ -173,8 +173,7 @@ describe('Dynamic Table widget ', () => {
beforeEach(async () => {
await loginPage.login(processUserModel.username, processUserModel.password);
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkTaskListIsLoaded();
@@ -189,15 +188,15 @@ describe('Dynamic Table widget ', () => {
await widget.dynamicTable().setDatatableInput('name', app.CUSTOM_VALIDATOR.FIELD.NAME);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Id\' is required.');
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Id' is required.`);
await widget.dynamicTable().setDatatableInput('id', app.CUSTOM_VALIDATOR.FIELD.ID);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Number\' is required.');
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Number' is required.`);
await widget.dynamicTable().setDatatableInput('12', app.CUSTOM_VALIDATOR.FIELD.NUM);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Address\' is required.');
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Address' is required.`);
await widget.dynamicTable().setDatatableInput('address', app.CUSTOM_VALIDATOR.FIELD.ADDRESS);
await widget.dynamicTable().clickSaveButton();

View File

@@ -15,54 +15,46 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Header widget', async () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.HEADER;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -72,7 +64,7 @@ describe('Header widget', async () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C276737] Should be able to set general and visibility properties for Header widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id);

View File

@@ -15,36 +15,29 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Hyperlink widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.HYPERLINK;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let processUserModel;
let deployedAppId; let process;
let appModel: AppDefinitionRepresentation;
let processUserModel: UserModel;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -61,8 +54,7 @@ describe('Hyperlink widget', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();

View File

@@ -15,18 +15,12 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Multi-line Widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT;
@@ -34,34 +28,33 @@ describe('Multi-line Widget', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let processUserModel;
let deployedAppId; let process;
let appModel: AppDefinitionRepresentation;
let processUserModel: UserModel;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -71,7 +64,7 @@ describe('Multi-line Widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
const label = await widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);

View File

@@ -15,36 +15,29 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Number widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.NUMBER;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -58,11 +51,10 @@ describe('Number widget', () => {
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -72,7 +64,7 @@ describe('Number widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C269111] Should be able to set general properties for Number Widget', async () => {
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
@@ -91,12 +83,12 @@ describe('Number widget', () => {
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3');
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be less than 3`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100');
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be greater than 100`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);

View File

@@ -26,7 +26,6 @@ import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
describe('People widget', () => {
@@ -35,7 +34,6 @@ describe('People widget', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
@@ -61,8 +59,7 @@ describe('People widget', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();

View File

@@ -15,53 +15,45 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Radio Buttons Widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let appId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let appId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
appId = await applicationsService.getAppDefinitionId(appModel.id);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
appId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(appId);
await new ProcessServicesPage().goToAppByAppId(appId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -71,7 +63,7 @@ describe('Radio Buttons Widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C277316] Should display empty radio buttons when no preselection is configured', async () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);

View File

@@ -15,54 +15,46 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { ProcessServicesPage } from '../pages/process-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
describe('Text widget', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.TEXT;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
@@ -72,7 +64,7 @@ describe('Text widget', () => {
await processUtil.cancelProcessInstance(process.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
});
it('[C268157] Should be able to set general properties for Text widget', async () => {
const label = await widget.textWidget().getFieldLabel(app.FIELD.simpleText);

View File

@@ -15,18 +15,12 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
const widgets = {
textOneId: 'text1',
@@ -51,40 +45,38 @@ const checkbox = {
};
describe('Process-Services - Visibility conditions', () => {
const app = browser.params.resources.Files.WIDGET_CHECK_APP.VISIBILITY;
const loginPage = new LoginPage();
const taskPage = new TasksPage();
const widget = new Widget();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
const processUtil = new ProcessUtil(apiService);
let appModel;
let deployedAppId; let process;
let processUserModel;
let appModel: AppDefinitionRepresentation;
let deployedAppId: number;
let process: ProcessInstanceRepresentation;
let processUserModel: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
await apiService.loginWithProfile('admin');
processUserModel = await usersActions.createUser();
processUserModel = await usersActions.createUser();
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
await apiService.login(processUserModel.username, processUserModel.password);
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
await loginPage.login(processUserModel.username, processUserModel.password);
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});

View File

@@ -279,7 +279,6 @@ exports.config = {
await LocalStorageUtil.setStorageItem('bpmHost', browser.params.testConfig.appConfig.bpmHost);
// @ts-ignore
await LocalStorageUtil.setStorageItem('providers', browser.params.testConfig.appConfig.provider);
await LocalStorageUtil.setStorageItem('baseShareUrl', `${HOST}/#`);
// @ts-ignore
await LocalStorageUtil.setStorageItem('authType', browser.params.testConfig.appConfig.authType);

View File

@@ -104,15 +104,12 @@ describe('Search Sorting Picker', () => {
});
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter(search);
await searchResults.dataTable.waitTillContentLoaded();
});
afterEach(async () => {
await navigationBarPage.clickHomeButton();
});
it(`[C277269] Should see the "sort by" option when search results are displayed in search results page`, async () => {
await searchSortingPicker.checkSortingDropdownIsDisplayed();
});