mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5761] Demo Shell pages cleanup (#8802)
remove the content that is not covered by e2e testing, preparation steps for the demo shell decommissioning
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
import { PermissionsPage } from '../../content-services/pages/permissions.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
BrowserActions, Logger,
|
||||
LoginPage,
|
||||
NotificationHistoryPage,
|
||||
@@ -28,14 +29,14 @@ import { createApiService,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
ViewerPage,
|
||||
SnackbarPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
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 { NotificationDemoPage } from '../../core/pages/notification.page';
|
||||
import { GroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Permissions Component', () => {
|
||||
@@ -47,7 +48,7 @@ describe('Permissions Component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const notificationPage = new NotificationDemoPage();
|
||||
const snackbarPage = new SnackbarPage();
|
||||
const searchService = new SearchService(apiService);
|
||||
const permissionActions = new PermissionActions(apiService);
|
||||
const groupsApi = new GroupsApi(apiService.getInstance());
|
||||
@@ -177,7 +178,7 @@ describe('Permissions Component', () => {
|
||||
await permissionsPage.addPermissionsDialog.selectRole(groupBody.displayName, 'Consumer');
|
||||
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'button should be enabled');
|
||||
await permissionsPage.addPermissionsDialog.clickAddButton();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('Added 0 user(s) 1 group(s)');
|
||||
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 0 user(s) 1 group(s)');
|
||||
await permissionsPage.checkUserIsAdded(groupBody.id);
|
||||
});
|
||||
|
||||
@@ -198,8 +199,8 @@ describe('Permissions Component', () => {
|
||||
await permissionsPage.checkPermissionListDisplayed();
|
||||
await expect(await permissionsPage.isInherited()).toBe(true, 'Inherited permission should be on');
|
||||
await permissionsPage.toggleInheritPermission();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toContain('Disabled inherited permission', 'Disabled notification not shown');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await snackbarPage.getSnackBarMessage()).toContain('Disabled inherited permission', 'Disabled notification not shown');
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await permissionsPage.isInherited()).toBe(false, 'Inherited permission should be off');
|
||||
});
|
||||
});
|
||||
@@ -226,8 +227,8 @@ describe('Permissions Component', () => {
|
||||
await permissionsPage.addPermissionsDialog.selectRole(filePermissionUser.fullName, 'Contributor');
|
||||
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'button should be enabled');
|
||||
await permissionsPage.addPermissionsDialog.clickAddButton();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await permissionsPage.checkUserIsAdded(filePermissionUser.username);
|
||||
});
|
||||
|
||||
@@ -250,19 +251,19 @@ describe('Permissions Component', () => {
|
||||
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await permissionsPage.changePermission(filePermissionUser.username, 'Collaborator');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Collaborator');
|
||||
|
||||
await permissionsPage.changePermission(filePermissionUser.username, 'Coordinator');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Coordinator');
|
||||
|
||||
await permissionsPage.changePermission(filePermissionUser.username, 'Editor');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Editor');
|
||||
|
||||
await permissionsPage.changePermission(filePermissionUser.username, 'Consumer');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Consumer');
|
||||
});
|
||||
|
||||
@@ -281,7 +282,7 @@ describe('Permissions Component', () => {
|
||||
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Contributor');
|
||||
await permissionsPage.clickDeletePermissionButton(filePermissionUser.username);
|
||||
await permissionsPage.checkUserIsDeleted(filePermissionUser.username);
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('User/Group deleted');
|
||||
await expect(await snackbarPage.getSnackBarMessage()).toEqual('User/Group deleted');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -303,11 +304,11 @@ describe('Permissions Component', () => {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await contentList.checkActionMenuIsNotDisplayed();
|
||||
await contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('You don\'t have access to do this.');
|
||||
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 notificationPage.snackbarPage.getSnackBarMessage()).toEqual('You don\'t have the create permission to upload the content');
|
||||
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');
|
||||
});
|
||||
|
||||
|
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { PermissionsPage } from '../../content-services/pages/permissions.page';
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
BrowserActions, Logger,
|
||||
LoginPage,
|
||||
NotificationHistoryPage, SearchService,
|
||||
@@ -24,7 +25,8 @@ import { createApiService,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
ViewerPage,
|
||||
SnackbarPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
@@ -35,7 +37,6 @@ 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';
|
||||
import { NotificationDemoPage } from '../../core/pages/notification.page';
|
||||
|
||||
describe('Permissions Component', () => {
|
||||
|
||||
@@ -51,7 +52,7 @@ describe('Permissions Component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
const notificationPage = new NotificationDemoPage();
|
||||
const snackbarPage = new SnackbarPage();
|
||||
const uploadDialog = new UploadDialogPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
|
||||
@@ -213,8 +214,8 @@ describe('Permissions Component', () => {
|
||||
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 notificationPage.snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
|
||||
await snackbarPage.waitForSnackBarToClose();
|
||||
|
||||
await permissionsPage.checkUserIsAdded(consumerUser.username);
|
||||
|
||||
|
@@ -1,205 +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,
|
||||
LikePage,
|
||||
LoginPage,
|
||||
RatePage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { SocialPage } from '../../content-services/pages/social.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Social component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const likePage = new LikePage();
|
||||
const ratePage = new RatePage();
|
||||
const socialPage = new SocialPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const componentOwner = new UserModel();
|
||||
const componentVisitor = new UserModel();
|
||||
const secondComponentVisitor = new UserModel();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const blueLikeColor = ('rgba(33, 150, 243, 1)');
|
||||
const greyLikeColor = ('rgba(128, 128, 128, 1)');
|
||||
const yellowRatedStarColor = ('rgba(255, 233, 68, 1)');
|
||||
const averageStarColor = ('rgba(128, 128, 128, 1)');
|
||||
|
||||
let emptyFile;
|
||||
|
||||
const emptyFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await usersActions.createUser(componentOwner);
|
||||
await usersActions.createUser(componentVisitor);
|
||||
await usersActions.createUser(secondComponentVisitor);
|
||||
|
||||
await apiService.login(componentOwner.username, componentOwner.password);
|
||||
|
||||
emptyFile = await uploadActions.uploadFile(emptyFileModel.location, emptyFileModel.name, '-my-');
|
||||
|
||||
await nodesApi.updateNode(emptyFile.entry.id,
|
||||
|
||||
{
|
||||
permissions: {
|
||||
locallySet: [{
|
||||
authorityId: componentVisitor.username,
|
||||
name: 'Consumer',
|
||||
accessStatus: 'ALLOWED'
|
||||
}, {
|
||||
authorityId: secondComponentVisitor.username,
|
||||
name: 'Consumer',
|
||||
accessStatus: 'ALLOWED'
|
||||
}]
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(emptyFile.entry.email);
|
||||
});
|
||||
|
||||
describe('User interaction on their own components', () => {
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(componentOwner.username, componentOwner.password);
|
||||
await navigationBarPage.clickSocialButton();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C203006] Should be able to like and unlike their components but not rate them,', async () => {
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
|
||||
await likePage.clickLike();
|
||||
await likePage.checkLikeCounter(1);
|
||||
await likePage.removeHoverFromLikeButton();
|
||||
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
|
||||
await ratePage.rateComponent(4);
|
||||
await ratePage.checkRatingCounter(0);
|
||||
await expect(await ratePage.isNotStarRated(4));
|
||||
await expect(await ratePage.getUnratedStarColor(4)).toBe(averageStarColor);
|
||||
await likePage.clickUnlike();
|
||||
await likePage.checkLikeCounter(0);
|
||||
await likePage.removeHoverFromLikeButton();
|
||||
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
|
||||
});
|
||||
});
|
||||
|
||||
describe('User interaction on components that belong to other users', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(componentVisitor.username, componentVisitor.password);
|
||||
await navigationBarPage.clickSocialButton();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C310198] Should be able to rate and unRate a component', async () => {
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
|
||||
|
||||
await ratePage.checkRatingCounter(0);
|
||||
await ratePage.rateComponent(4);
|
||||
await ratePage.checkRatingCounter(1);
|
||||
await expect(await ratePage.isStarRated(4));
|
||||
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
|
||||
await ratePage.removeRating(4);
|
||||
await ratePage.checkRatingCounter(0);
|
||||
await expect(await ratePage.isNotStarRated(4));
|
||||
});
|
||||
});
|
||||
|
||||
describe('Multiple Users interaction', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(componentVisitor.username, componentVisitor.password);
|
||||
await navigationBarPage.clickSocialButton();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C310197] Should be able to like, unLike, display total likes', async () => {
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
|
||||
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
|
||||
await likePage.clickLike();
|
||||
await likePage.checkLikeCounter(1);
|
||||
await likePage.removeHoverFromLikeButton();
|
||||
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(secondComponentVisitor.username, secondComponentVisitor.password);
|
||||
await navigationBarPage.clickSocialButton();
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
|
||||
await likePage.clickLike();
|
||||
await likePage.checkLikeCounter(2);
|
||||
await likePage.removeHoverFromLikeButton();
|
||||
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
|
||||
await likePage.clickUnlike();
|
||||
await likePage.checkLikeCounter(1);
|
||||
await likePage.removeHoverFromLikeButton();
|
||||
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
|
||||
});
|
||||
|
||||
it('[C260327] Should be able to rate, unRate, display total ratings, display average rating', async () => {
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
|
||||
await ratePage.rateComponent(4);
|
||||
await ratePage.checkRatingCounter(1);
|
||||
await expect(await ratePage.isStarRated(4));
|
||||
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(secondComponentVisitor.username, secondComponentVisitor.password);
|
||||
await navigationBarPage.clickSocialButton();
|
||||
await socialPage.writeCustomNodeId(emptyFile.entry.id);
|
||||
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
|
||||
await ratePage.checkRatingCounter(1);
|
||||
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
|
||||
await ratePage.rateComponent(0);
|
||||
await ratePage.checkRatingCounter(2);
|
||||
await expect(await ratePage.isStarRated(2));
|
||||
await ratePage.removeRating(0);
|
||||
await ratePage.checkRatingCounter(1);
|
||||
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,160 +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 { FileModel } from '../../models/ACS/file.model';
|
||||
import { createApiService,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TagPage } from '../../content-services/pages/tag.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TagsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Tag component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const tagPage = new TagPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let acsUser: UserModel;
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const tagsApi = new TagsApi(apiService.getInstance());
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const pdfFileModel = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
const deleteFile = new FileModel({ name: StringUtil.generateRandomString() });
|
||||
const sameTag = StringUtil.generateRandomString().toLowerCase();
|
||||
|
||||
const tagList = [
|
||||
StringUtil.generateRandomString().toLowerCase(),
|
||||
StringUtil.generateRandomString().toLowerCase(),
|
||||
StringUtil.generateRandomString().toLowerCase(),
|
||||
StringUtil.generateRandomString().toLowerCase()];
|
||||
|
||||
const tags = [
|
||||
{ tag: 'test-tag-01' }, { tag: 'test-tag-02' }, { tag: 'test-tag-03' }, { tag: 'test-tag-04' }, { tag: 'test-tag-05' },
|
||||
{ tag: 'test-tag-06' }, { tag: 'test-tag-07' }, { tag: 'test-tag-08' }, { tag: 'test-tag-09' }, { tag: 'test-tag-10' },
|
||||
{ tag: 'test-tag-11' }];
|
||||
|
||||
let pdfUploadedFile; let nodeId;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
acsUser = await usersActions.createUser();
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
pdfUploadedFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||
|
||||
nodeId = pdfUploadedFile.entry.id;
|
||||
|
||||
const uploadedDeleteFile = await uploadActions.uploadFile(deleteFile.location, deleteFile.name, '-my-');
|
||||
|
||||
Object.assign(pdfFileModel, pdfUploadedFile.entry);
|
||||
|
||||
Object.assign(deleteFile, uploadedDeleteFile.entry);
|
||||
|
||||
await tagsApi.createTagForNode(nodeId, tags);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
await navigationBarPage.clickTagButton();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
|
||||
});
|
||||
|
||||
it('[C268151] Should be possible to add a new tag to a Node', async () => {
|
||||
await tagPage.insertNodeId(pdfFileModel.id);
|
||||
await tagPage.addTag(tagList[0]);
|
||||
|
||||
await tagPage.checkTagIsDisplayedInTagList(tagList[0]);
|
||||
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
|
||||
});
|
||||
|
||||
it('[C260377] Should NOT be possible to add a tag that already exists', async () => {
|
||||
await tagPage.insertNodeId(pdfFileModel.id);
|
||||
await tagPage.addTag(sameTag);
|
||||
await tagPage.checkTagIsDisplayedInTagList(sameTag);
|
||||
await tagPage.addTag(sameTag);
|
||||
await expect(await tagPage.errorMessage.getText()).toEqual('Tag already exists');
|
||||
});
|
||||
|
||||
it('[C260375] Should be possible to delete a tag', async () => {
|
||||
const deleteTag = StringUtil.generateRandomString().toUpperCase();
|
||||
|
||||
await tagPage.insertNodeId(deleteFile.id);
|
||||
|
||||
await tagPage.addTag(deleteTag);
|
||||
|
||||
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
|
||||
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
|
||||
|
||||
await tagPage.deleteTagFromTagListByNodeId(deleteTag.toLowerCase());
|
||||
|
||||
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
|
||||
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
|
||||
|
||||
await tagPage.insertNodeId(deleteFile.id);
|
||||
|
||||
await tagPage.addTag(deleteTag);
|
||||
|
||||
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
|
||||
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
|
||||
|
||||
await tagPage.deleteTagFromTagList(deleteTag.toLowerCase());
|
||||
|
||||
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
|
||||
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
|
||||
});
|
||||
|
||||
it('[C286290] Should be able to hide the delete option from a tag component', async () => {
|
||||
await tagPage.insertNodeId(pdfFileModel.id);
|
||||
await tagPage.addTag(tagList[3]);
|
||||
|
||||
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[3]);
|
||||
await tagPage.checkDeleteTagFromTagListByNodeIdIsDisplayed(tagList[3]);
|
||||
|
||||
await tagPage.showDeleteButton.click();
|
||||
|
||||
await tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
|
||||
});
|
||||
|
||||
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', async () => {
|
||||
await tagPage.insertNodeId(pdfFileModel.id);
|
||||
|
||||
await tagPage.showMoreButton.waitVisible();
|
||||
await tagPage.showLessButton.waitNotVisible();
|
||||
|
||||
await expect(await tagPage.tagsOnPage.count()).toEqual(10);
|
||||
|
||||
await tagPage.showMoreButton.click();
|
||||
await tagPage.showLessButton.waitVisible();
|
||||
|
||||
await tagPage.showLessButton.click();
|
||||
await tagPage.showLessButton.waitNotVisible();
|
||||
});
|
||||
|
||||
});
|
@@ -142,14 +142,14 @@ describe('Favorite directive', () => {
|
||||
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
|
||||
|
||||
await navigationBarPage.clickTrashcanButton();
|
||||
await trashcanPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
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.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
await trashcanPage.checkTrashcanIsEmpty();
|
||||
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
|
@@ -21,10 +21,11 @@ import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions, V
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import * as moment from 'moment';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
let uploadedFolder; let uploadedFolderExtra;
|
||||
let uploadedFolder: NodeEntry;
|
||||
let uploadedFolderExtra: NodeEntry;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
@@ -35,7 +36,8 @@ describe('Document List Component', () => {
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
let testFileNode; let pdfBFileNode;
|
||||
let testFileNode: any;
|
||||
let pdfBFileNode: any;
|
||||
|
||||
afterEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -281,7 +283,7 @@ describe('Document List Component', () => {
|
||||
await contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
|
||||
});
|
||||
|
||||
it('[C269086] Should display Islocked field for files', async () => {
|
||||
it('[C269086] Should display IsLocked field for files', async () => {
|
||||
const testFileA = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
|
||||
@@ -306,7 +308,7 @@ describe('Document List Component', () => {
|
||||
});
|
||||
|
||||
describe('Once uploaded 20 folders', () => {
|
||||
let folderCreated;
|
||||
let folderCreated: NodeEntry[];
|
||||
|
||||
beforeAll(async () => {
|
||||
folderCreated = [];
|
||||
@@ -325,8 +327,8 @@ describe('Document List Component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
for (let i = 0; i < folderCreated.length; i++) {
|
||||
await uploadActions.deleteFileOrFolder(folderCreated[i].entry.id);
|
||||
for (const item of folderCreated) {
|
||||
await uploadActions.deleteFileOrFolder(item.entry.id);
|
||||
}
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
@@ -345,7 +347,7 @@ describe('Document List Component', () => {
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
|
||||
});
|
||||
|
||||
let file;
|
||||
let file: any;
|
||||
const viewer = new ViewerPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
|
@@ -1,33 +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 } from '@alfresco/adf-testing';
|
||||
|
||||
export class SocialPage {
|
||||
|
||||
nodeIdField = $(`input[id="nodeId"]`);
|
||||
|
||||
async getNodeIdFieldValue(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.nodeIdField);
|
||||
}
|
||||
|
||||
async writeCustomNodeId(nodeId: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.nodeIdField, nodeId);
|
||||
}
|
||||
|
||||
}
|
@@ -1,107 +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 { by, protractor, browser, $, $$ } from 'protractor';
|
||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class TagPage {
|
||||
|
||||
addTagButton = TestElement.byCss('#add-tag');
|
||||
insertNodeIdElement = $('input[id="nodeId"]');
|
||||
newTagInput = TestElement.byCss('input[id="new-tag-text"]');
|
||||
tagListRow = TestElement.byCss('adf-tag-node-actions-list mat-list-item');
|
||||
tagListByNodeIdRow = TestElement.byCss('adf-tag-node-list mat-chip');
|
||||
errorMessage = TestElement.byCss('mat-hint[data-automation-id="errorMessage"]');
|
||||
tagListContentServicesRowLocator = by.css('div[class*="adf-list-tag"]');
|
||||
showDeleteButton = TestElement.byCss('#adf-remove-button-tag');
|
||||
showMoreButton = TestElement.byCss('button[data-automation-id="show-more-tags"]');
|
||||
showLessButton = TestElement.byCss('button[data-automation-id="show-fewer-tags"]');
|
||||
tagsOnPage = $$('div[class*="adf-list-tag"]');
|
||||
confirmTag = TestElement.byCss('#adf-tag-node-send');
|
||||
|
||||
getNodeId(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.insertNodeIdElement);
|
||||
}
|
||||
|
||||
async insertNodeId(nodeId) {
|
||||
await BrowserActions.clearSendKeys(this.insertNodeIdElement, nodeId);
|
||||
|
||||
await browser.sleep(200);
|
||||
await this.insertNodeIdElement.sendKeys(' ');
|
||||
await browser.sleep(200);
|
||||
await this.insertNodeIdElement.sendKeys(protractor.Key.BACK_SPACE);
|
||||
await this.confirmTag.click();
|
||||
}
|
||||
|
||||
async addTag(tag: string): Promise<void> {
|
||||
await this.newTagInput.typeText(tag);
|
||||
return this.addTagButton.click();
|
||||
}
|
||||
|
||||
deleteTagFromTagListByNodeId(name: string): Promise<void> {
|
||||
return TestElement.byId('tag_chips_delete_' + name).click();
|
||||
}
|
||||
|
||||
deleteTagFromTagList(name: string): Promise<void> {
|
||||
return TestElement.byId('tag_chips_delete_' + name).click();
|
||||
}
|
||||
|
||||
async addTagButtonIsEnabled(): Promise<boolean> {
|
||||
await this.addTagButton.waitVisible();
|
||||
return this.addTagButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkTagIsDisplayedInTagList(tagName: string): Promise<boolean> {
|
||||
try {
|
||||
await TestElement.byText('div[id*="tag_name"]', tagName).waitVisible();
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (await this.showMoreButton.isDisplayed()) {
|
||||
await this.showMoreButton.click();
|
||||
await this.checkTagIsDisplayedInTagList(tagName);
|
||||
return true;
|
||||
} else {
|
||||
throw new Error('Error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async checkTagIsNotDisplayedInTagList(tagName: string): Promise<boolean> {
|
||||
try {
|
||||
await TestElement.byText('div[id*="tag_name"]', tagName).waitNotVisible();
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
checkTagIsNotDisplayedInTagListByNodeId(tagName: string): Promise<void> {
|
||||
return TestElement.byText('span[id*="tag_name"]', tagName).waitNotVisible();
|
||||
}
|
||||
|
||||
checkTagIsDisplayedInTagListByNodeId(tagName: string): Promise<void> {
|
||||
return TestElement.byText('span[id*="tag_name"]', tagName).waitVisible();
|
||||
}
|
||||
|
||||
checkDeleteTagFromTagListByNodeIdIsDisplayed(name: string): Promise<void> {
|
||||
return TestElement.byId('tag_chips_delete_' + name).waitVisible();
|
||||
}
|
||||
|
||||
checkDeleteTagFromTagListByNodeIdIsNotDisplayed(name: string): Promise<void> {
|
||||
return TestElement.byId('tag_chips_delete_' + name).waitNotVisible();
|
||||
}
|
||||
}
|
@@ -1,67 +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, DataTableComponentPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { DataTablePage } from '../../core/pages/data-table.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Datatable component - selection', () => {
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const dataTablePage = new DataTablePage();
|
||||
const loginPage = new LoginPage();
|
||||
const acsUser = new UserModel();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const dataTableComponent = new DataTableComponentPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await usersActions.createUser(acsUser);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await navigationBarPage.navigateToDatatable();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C213258] Should be possible change the selection modes when change the selectionMode property', async () => {
|
||||
await dataTablePage.selectRow('2');
|
||||
await dataTableComponent.checkRowIsSelected('Id', '2');
|
||||
await expect(await dataTablePage.getNumberOfSelectedRows()).toEqual(1);
|
||||
await dataTablePage.selectRow('3');
|
||||
await dataTableComponent.checkRowIsSelected('Id', '3');
|
||||
await expect(await dataTablePage.getNumberOfSelectedRows()).toEqual(1);
|
||||
await dataTablePage.selectSelectionMode('Multiple');
|
||||
await dataTablePage.selectRow('1');
|
||||
await dataTableComponent.checkRowIsSelected('Id', '1');
|
||||
await dataTablePage.selectRowWithKeyboard('3');
|
||||
await dataTableComponent.checkRowIsSelected('Id', '1');
|
||||
await dataTableComponent.checkRowIsSelected('Id', '3');
|
||||
await dataTablePage.checkRowIsNotSelected('2');
|
||||
await dataTablePage.checkRowIsNotSelected('4');
|
||||
await dataTablePage.selectSelectionMode('None');
|
||||
await dataTablePage.selectRow('1');
|
||||
await dataTablePage.checkNoRowIsSelected();
|
||||
});
|
||||
|
||||
});
|
@@ -1,73 +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,
|
||||
NotificationHistoryPage,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { DataTablePage } from '../../core/pages/data-table.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Datatable component', () => {
|
||||
|
||||
const dragAndDropDataTablePage = new DataTablePage();
|
||||
const loginPage = new LoginPage();
|
||||
const acsUser = new UserModel();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
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 apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await usersActions.createUser(acsUser);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
describe('Datatable component - Drag and Drop', () => {
|
||||
beforeAll(async () => {
|
||||
await navigationBarPage.navigateToDragAndDropDatatable();
|
||||
await dragAndDropDataTablePage.dataTable.waitForTableBody();
|
||||
});
|
||||
|
||||
it('[C307984] Should trigger the event handling header-drop and cell-drop', async () => {
|
||||
const dragAndDropHeader = dragAndDropDataTablePage.getDropTargetIdColumnHeader();
|
||||
await DropActions.dropFile(dragAndDropHeader, pngFile.location);
|
||||
await notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] header');
|
||||
|
||||
const dragAndDropCell = dragAndDropDataTablePage.getDropTargetIdColumnCell(1);
|
||||
await DropActions.dropFile(dragAndDropCell, pngFile.location);
|
||||
await notificationHistoryPage.checkNotifyContains('Dropped data on [ id ] cell');
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,171 +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,
|
||||
ErrorPage,
|
||||
LocalStorageUtil,
|
||||
UserInfoPage,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { LoginShellPage } from '../../core/pages/login-shell.page';
|
||||
|
||||
describe('Login component', () => {
|
||||
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const userInfoPage = new UserInfoPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const loginPage = new LoginShellPage();
|
||||
const errorPage = new ErrorPage();
|
||||
|
||||
const userA = new UserModel();
|
||||
const userB = new UserModel();
|
||||
|
||||
const errorMessages = {
|
||||
username: 'Your username needs to be at least 2 characters.',
|
||||
invalid_credentials: 'You\'ve entered an unknown username or password',
|
||||
password: 'Enter your password to sign in',
|
||||
required: 'Required'
|
||||
};
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await usersActions.createUser(userA);
|
||||
await usersActions.createUser(userB);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C276746] Should display the right information in user-info when a different users logs in', async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ECM');
|
||||
|
||||
await loginPage.login(userA.username, userA.password);
|
||||
await userInfoPage.clickUserProfile();
|
||||
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(`${userA.firstName} ${userA.lastName}`);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(userB.username, userB.password);
|
||||
await userInfoPage.clickUserProfile();
|
||||
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(`${userB.firstName} ${userB.lastName}`);
|
||||
});
|
||||
|
||||
it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => {
|
||||
await loginPage.login(userA.username, userA.password);
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await expect(await errorPage.getErrorCode()).toBe('403');
|
||||
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
|
||||
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
|
||||
});
|
||||
|
||||
it('[C260036] Should require username', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.checkUsernameInactive();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterUsername('A');
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
|
||||
await loginPage.clearUsername();
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.required);
|
||||
await loginPage.checkUsernameHighlighted();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
});
|
||||
|
||||
it('[C260044] Username should be at least 2 characters long', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterUsername('A');
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
|
||||
await loginPage.enterUsername('AB');
|
||||
await loginPage.checkUsernameTooltipIsNotVisible();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.clearUsername();
|
||||
});
|
||||
|
||||
it('[C260045] Should enable login button after entering a valid username and a password', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.enterUsername(browser.params.testConfig.users.admin.username);
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterPassword('a');
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(true);
|
||||
await loginPage.clearUsername();
|
||||
await loginPage.clearPassword();
|
||||
});
|
||||
|
||||
it('[C260047] Password should be crypted', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterPassword('test');
|
||||
await loginPage.showPassword();
|
||||
const tooltip = await loginPage.getShownPassword();
|
||||
await expect(tooltip).toEqual('test');
|
||||
await loginPage.hidePassword();
|
||||
await loginPage.checkPasswordIsHidden();
|
||||
await loginPage.clearPassword();
|
||||
});
|
||||
|
||||
it('[C260048] Should be possible to enable/disable login footer', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.enableFooter();
|
||||
await loginPage.checkRememberIsDisplayed();
|
||||
await loginPage.checkNeedHelpIsDisplayed();
|
||||
await loginPage.checkRegisterDisplayed();
|
||||
await loginPage.disableFooter();
|
||||
await loginPage.checkRememberIsNotDisplayed();
|
||||
await loginPage.checkNeedHelpIsNotDisplayed();
|
||||
await loginPage.checkRegisterIsNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C260050] Should be possible to login to Content Services with Process Services disabled', async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ECM');
|
||||
|
||||
await loginPage.goToLoginPage();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.loginWithProfile('admin');
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.checkAcsContainer();
|
||||
});
|
||||
|
||||
it('[C277754] Should the user be redirect to the login page when the Content Service session expire', async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ECM');
|
||||
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.loginWithProfile('admin');
|
||||
await browser.executeScript('window.localStorage.removeItem("ADF_ticket-ECM");');
|
||||
await BrowserActions.getUrl(browser.baseUrl + '/files');
|
||||
await loginPage.waitForElements();
|
||||
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
});
|
||||
|
||||
it('[C279933] Should be possible change the login component logo when logoImageUrl is changed', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.enableLogoSwitch();
|
||||
await loginPage.enterLogo('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
|
||||
await loginPage.checkLoginImgURL();
|
||||
});
|
||||
});
|
@@ -1,39 +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 { LoginPage, SettingsPage } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../pages/navigation-bar.page';
|
||||
|
||||
describe('Logout component - SSO', () => {
|
||||
|
||||
const settingsPage = new SettingsPage();
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
it('[C280665] Should be possible change the logout redirect URL', async () => {
|
||||
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, '#/login');
|
||||
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
|
||||
const actualUrl = await browser.getCurrentUrl();
|
||||
await expect(actualUrl).toEqual(browser.baseUrl + '/login');
|
||||
});
|
||||
});
|
@@ -1,39 +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 { SettingsPage, LocalStorageUtil } from '@alfresco/adf-testing';
|
||||
import { LoginShellPage } from '../../core/pages/login-shell.page';
|
||||
|
||||
describe('Login component - Remember Me', () => {
|
||||
|
||||
const settingsPage = new SettingsPage();
|
||||
const loginPage = new LoginShellPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await LocalStorageUtil.setStorageItem('authType', 'BASIC');
|
||||
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.clickSettingsIcon();
|
||||
await settingsPage.setProviderEcmBpm();
|
||||
});
|
||||
|
||||
it('[C260501] Should Remember me checkbox not be present in the login if the property showRememberMe is false', async () => {
|
||||
await loginPage.checkRememberIsDisplayed();
|
||||
await loginPage.disableRememberMe();
|
||||
await loginPage.checkRememberIsNotDisplayed();
|
||||
});
|
||||
});
|
@@ -1,124 +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, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NotificationDemoPage } from '../core/pages/notification.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Notifications Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const notificationPage = new NotificationDemoPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let acsUser: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
acsUser = await usersActions.createUser();
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await notificationPage.goToNotificationsPage();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await notificationPage.enterDurationField(3000);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await browser.executeScript(`document.querySelector('button[data-automation-id="notification-custom-dismiss-button"]').click();`);
|
||||
});
|
||||
|
||||
it('[C279979] Should not show notification when the message is empty and button is clicked', async () => {
|
||||
await notificationPage.clearMessage();
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.isNotificationSnackBarDisplayed()).toEqual(false);
|
||||
});
|
||||
|
||||
it('[C279977] Should show notification when the message is not empty and button is clicked', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('test');
|
||||
});
|
||||
|
||||
it('[C279978] Should show notification with action when the message is not empty and button is clicked', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.clickActionToggle();
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('test');
|
||||
await notificationPage.clickActionButton();
|
||||
await notificationPage.checkActionEvent();
|
||||
await notificationPage.clickActionToggle();
|
||||
});
|
||||
|
||||
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.isNotificationSnackBarDisplayed()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.clickActionToggle();
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.isNotificationSnackBarDisplayed()).toEqual(true);
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('test');
|
||||
await notificationPage.snackbarPage.waitForSnackBarToClose();
|
||||
await notificationPage.clickNotificationButton();
|
||||
await notificationPage.clickActionButton();
|
||||
await notificationPage.checkActionEvent();
|
||||
await notificationPage.clickActionToggle();
|
||||
});
|
||||
|
||||
it('[C694098] Should show a decorative icon when the message and the icon fields are not empty and button is clicked', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.enterDecorativeIconField('folder');
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.getSnackBarDecorativeIcon()).toEqual('folder');
|
||||
});
|
||||
|
||||
it('[C279987] Should show custom notification during a limited time when a duration is added', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.enterDurationField(1000);
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.snackbarPage.isNotificationSnackBarDisplayed()).toEqual(true);
|
||||
await browser.sleep(2000);
|
||||
await expect(await notificationPage.snackbarPage.isNotificationSnackBarDisplayed()).toEqual(false);
|
||||
});
|
||||
|
||||
it('[C280001] Should meet configuration when a custom notification is set', async () => {
|
||||
await notificationPage.enterMessageField('test');
|
||||
await notificationPage.enterDurationField(1000);
|
||||
await notificationPage.selectHorizontalPosition('Right');
|
||||
await notificationPage.selectVerticalPosition('Top');
|
||||
await notificationPage.selectDirection('Left to right');
|
||||
await notificationPage.clickNotificationButton();
|
||||
await expect(await notificationPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
|
||||
});
|
||||
});
|
@@ -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 { $, by, element } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
CardTextItemPage,
|
||||
DropdownPage,
|
||||
CardBooleanItemPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
nameCardTextItem = new CardTextItemPage('name');
|
||||
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
||||
intField = $(`input[data-automation-id='card-textitem-editinput-int']`);
|
||||
floatField = $(`input[data-automation-id='card-textitem-editinput-float']`);
|
||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog = element(by.className('app-console'));
|
||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
resetButton = $(`#adf-reset-card-log`);
|
||||
editableSwitch = $('#app-toggle-editable');
|
||||
clearDateSwitch = $('#app-toggle-clear-date');
|
||||
noneOptionSwitch = $('#app-toggle-none-option');
|
||||
clickableField = $(`[data-automation-id="card-textitem-toggle-click"]`);
|
||||
|
||||
selectDropdown = new DropdownPage($('mat-select[data-automation-class="select-box"]'));
|
||||
|
||||
async clickOnAddButton(): Promise<void> {
|
||||
await BrowserActions.click(this.addButton);
|
||||
}
|
||||
|
||||
async checkNameTextLabelIsPresent(): Promise<void> {
|
||||
await this.nameCardTextItem.checkLabelIsPresent();
|
||||
}
|
||||
|
||||
async getNameTextFieldText(): Promise<string> {
|
||||
return this.nameCardTextItem.getFieldValue();
|
||||
}
|
||||
|
||||
async enterNameTextField(text: string): Promise<void> {
|
||||
await this.nameCardTextItem.enterTextField(text);
|
||||
}
|
||||
|
||||
async clickOnNameTextSaveIcon(): Promise<void> {
|
||||
await this.nameCardTextItem.clickOnSaveButton();
|
||||
}
|
||||
|
||||
async clickOnNameTextClearIcon(): Promise<void> {
|
||||
await this.nameCardTextItem.clickOnClearButton();
|
||||
}
|
||||
|
||||
async clickOnResetButton(): Promise<void> {
|
||||
await BrowserActions.click(this.resetButton);
|
||||
}
|
||||
|
||||
async clickOnIntField(): Promise<void> {
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-int"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
}
|
||||
|
||||
async clickOnIntClearIcon(): Promise<void> {
|
||||
const clearIcon = $('button[data-automation-id="card-textitem-reset-int"]');
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnIntSaveIcon(): Promise<void> {
|
||||
const saveIcon = $('button[data-automation-id="card-textitem-update-int"]');
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
async enterIntField(text): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.intField, text);
|
||||
}
|
||||
|
||||
getIntFieldText(): Promise<string> {
|
||||
const textField = $('span[data-automation-id="card-textitem-value-int"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt(): Promise<string> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async clickOnFloatField(): Promise<void> {
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-float"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
}
|
||||
|
||||
async clickOnFloatClearIcon(): Promise<void> {
|
||||
const clearIcon = $(`button[data-automation-id="card-textitem-reset-float"]`);
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnFloatSaveIcon(): Promise<void> {
|
||||
const saveIcon = $(`button[data-automation-id="card-textitem-update-float"]`);
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
async enterFloatField(text): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.floatField, text);
|
||||
}
|
||||
|
||||
getFloatFieldText(): Promise<string> {
|
||||
const textField = $('span[data-automation-id="card-textitem-value-float"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat(): Promise<string> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-float"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async setName(name: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.nameInputField, name);
|
||||
}
|
||||
|
||||
async setValue(value): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.valueInputField, value);
|
||||
}
|
||||
|
||||
async waitForOutput(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.consoleLog);
|
||||
}
|
||||
|
||||
getOutputText(index: number): Promise<string> {
|
||||
return BrowserActions.getText(this.consoleLog.$$('p').get(index));
|
||||
}
|
||||
|
||||
async deletePairsValues(): Promise<void> {
|
||||
await BrowserActions.click(this.deleteButton);
|
||||
}
|
||||
|
||||
async clickSelectBox(): Promise<void> {
|
||||
await this.selectDropdown.clickDropdown();
|
||||
await this.selectDropdown.checkOptionsPanelIsDisplayed();
|
||||
}
|
||||
|
||||
async checkboxClick(): Promise<void> {
|
||||
await this.booleanCardBooleanItem.checkboxClick();
|
||||
}
|
||||
|
||||
async checkBooleanLabelIsPresent(): Promise<void> {
|
||||
await this.booleanCardBooleanItem.checkLabelIsPresent();
|
||||
}
|
||||
|
||||
async selectValueFromComboBox(index): Promise<void> {
|
||||
await this.selectDropdown.selectOptionFromIndex(index);
|
||||
}
|
||||
|
||||
async disableEdit(): Promise<void> {
|
||||
const check = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (check.indexOf('mat-checked') > -1) {
|
||||
await BrowserActions.click(this.editableSwitch);
|
||||
await expect(await BrowserActions.getAttribute(this.editableSwitch, 'class')).not.toContain('mat-checked');
|
||||
}
|
||||
}
|
||||
|
||||
async getDateValue(): Promise<string> {
|
||||
const dateValue = $('span[data-automation-id="card-date-value-date"]');
|
||||
return dateValue.getText();
|
||||
}
|
||||
|
||||
async getDateTimeValue(): Promise<string> {
|
||||
const dateTimeValue = $('span[data-automation-id="card-datetime-value-datetime"]');
|
||||
return dateTimeValue.getText();
|
||||
}
|
||||
|
||||
async clearDateField(): Promise<void> {
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-date"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async clearDateTimeField(): Promise<void> {
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-datetime"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async enableClearDate(): Promise<void> {
|
||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = $('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async enableNoneOption(): Promise<void> {
|
||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = $('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async getClickableValue(): Promise<string> {
|
||||
return this.clickableField.getText();
|
||||
}
|
||||
|
||||
async updateClickableField(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||
await BrowserActions.click(this.clickableField);
|
||||
const inputField = $('input[data-automation-id="card-textitem-editinput-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||
await BrowserActions.clearSendKeys(inputField, text);
|
||||
const save = $('[data-automation-id="card-textitem-update-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(save);
|
||||
await BrowserActions.click(save);
|
||||
}
|
||||
|
||||
async hasCardViewConsoleLog(text: string): Promise<string> {
|
||||
const cardViewConsole = element(by.cssContainingText('.app-console', text));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(cardViewConsole);
|
||||
return cardViewConsole.getText();
|
||||
}
|
||||
|
||||
async clearIntField(): Promise<void> {
|
||||
await this.intField.clear();
|
||||
}
|
||||
|
||||
}
|
@@ -69,17 +69,17 @@ 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 '));
|
||||
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*="METADATA"]');
|
||||
versionManagerAction = $('button[data-automation-id*="VERSIONS"]');
|
||||
moveContentElement = $('button[data-automation-id*="MOVE"]');
|
||||
copyContentElement = $('button[data-automation-id*="COPY"]');
|
||||
lockContentElement = $('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]');
|
||||
downloadContent = $('button[data-automation-id*="DOWNLOAD"]');
|
||||
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'));
|
||||
@@ -124,7 +124,7 @@ export class ContentServicesPage {
|
||||
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
const disabledDelete = $(`button[data-automation-id*='DELETE'][disabled='true']`);
|
||||
const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
|
@@ -1,86 +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 { $, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
columns = {
|
||||
id: 'Id',
|
||||
name: 'Name',
|
||||
createdBy: 'Created By',
|
||||
json: 'Json'
|
||||
};
|
||||
|
||||
data = {
|
||||
copyClipboardDataTable: 'copyClipboard-datatable',
|
||||
defaultTable: 'datatable'
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
|
||||
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||
idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
|
||||
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
|
||||
|
||||
constructor(data?) {
|
||||
if (this.data[data]) {
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data[data] + `']`));
|
||||
} else {
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data.defaultTable + `']`));
|
||||
}
|
||||
}
|
||||
|
||||
async checkRowIsNotSelected(rowNumber: string): Promise<void> {
|
||||
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
|
||||
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(isRowSelected);
|
||||
}
|
||||
|
||||
async checkNoRowIsSelected(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
async getNumberOfSelectedRows(): Promise<number> {
|
||||
return this.allSelectedRows.count();
|
||||
}
|
||||
|
||||
async selectRow(rowNumber: string): Promise<void> {
|
||||
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
|
||||
await BrowserActions.click(row);
|
||||
}
|
||||
|
||||
async selectRowWithKeyboard(rowNumber: string): Promise<void> {
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
await this.selectRow(rowNumber);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
}
|
||||
|
||||
async selectSelectionMode(selectionMode: string): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(selectionMode);
|
||||
}
|
||||
|
||||
getDropTargetIdColumnCell(rowNumber: number): ElementFinder {
|
||||
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
|
||||
}
|
||||
|
||||
getDropTargetIdColumnHeader(): ElementFinder {
|
||||
return this.idColumnHeader;
|
||||
}
|
||||
}
|
@@ -96,14 +96,6 @@ export class ShareDialogPage {
|
||||
await this.dateTimePickerPage.setDate(tomorrow);
|
||||
}
|
||||
|
||||
async setDefaultHour(): Promise<void> {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledHour();
|
||||
}
|
||||
|
||||
async setDefaultMinutes() {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledMinutes();
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||
}
|
||||
|
@@ -1,43 +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 { $, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class IconsPage {
|
||||
|
||||
locateCustomIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] svg`);
|
||||
locateLigatureIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] .material-icons`);
|
||||
|
||||
async isCustomIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
||||
if (present) {
|
||||
return this.locateCustomIcon(name).isDisplayed();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async isLigatureIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateLigatureIcon(name));
|
||||
if (present) {
|
||||
return this.locateLigatureIcon(name).isDisplayed();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -15,41 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { $, browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginShellPage {
|
||||
loginURL = browser.baseUrl + '/login';
|
||||
loginSSOPage = new LoginPage();
|
||||
|
||||
togglePage = new TogglePage();
|
||||
txtUsername = $('input[id="username"]');
|
||||
txtPassword = $('input[id="password"]');
|
||||
logoImg = $('img[id="adf-login-img-logo"]');
|
||||
logoTxt = $('input[data-automation-id="adf-url-logo"]');
|
||||
usernameError = $('span[data-automation-id="username-error"]');
|
||||
usernameInactive = $('input[id="username"][class*="ng-invalid"]');
|
||||
adfLogo = $('.adf-img-logo');
|
||||
|
||||
usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
|
||||
signInButton = $('#login-button');
|
||||
showPasswordElement = $('button[data-automation-id="show_password"]');
|
||||
hidePasswordElement = $('button[data-automation-id="hide_password"]');
|
||||
rememberMe = $('mat-checkbox[id="adf-login-remember"]');
|
||||
needHelp = $('#adf-login-action-left');
|
||||
register = $('#adf-login-action-right');
|
||||
footerSwitch = $('#switch4');
|
||||
rememberMeSwitch = $('#adf-toggle-show-rememberme');
|
||||
logoSwitch = $('#adf-toggle-logo');
|
||||
header = $('#adf-header');
|
||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
private txtUsername = $('input[id="username"]');
|
||||
private txtPassword = $('input[id="password"]');
|
||||
private signInButton = $('#login-button');
|
||||
sidenavLayout = $(`[data-automation-id="sidenav-layout"]`);
|
||||
|
||||
async goToLoginPage(): Promise<void> {
|
||||
await BrowserActions.getUrl(this.loginURL);
|
||||
await this.waitForElements();
|
||||
}
|
||||
|
||||
async waitForElements(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtUsername);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
@@ -63,114 +37,7 @@ export class LoginShellPage {
|
||||
await BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
async clearUsername(): Promise<void> {
|
||||
await BrowserActions.click(this.txtUsername);
|
||||
await BrowserActions.clearWithBackSpace(this.txtUsername);
|
||||
}
|
||||
|
||||
async clearPassword(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
await BrowserActions.clearWithBackSpace(this.txtPassword);
|
||||
}
|
||||
|
||||
async getUsernameTooltip(): Promise<string> {
|
||||
return BrowserActions.getText(this.usernameError);
|
||||
}
|
||||
|
||||
async checkLoginImgURL(): Promise<string> {
|
||||
return BrowserActions.getAttribute(this.logoImg, 'src');
|
||||
}
|
||||
|
||||
async checkUsernameInactive(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameInactive);
|
||||
}
|
||||
|
||||
async checkUsernameHighlighted(): Promise<void> {
|
||||
await BrowserActions.click(this.adfLogo);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameHighlighted);
|
||||
}
|
||||
|
||||
async checkUsernameTooltipIsNotVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.usernameError);
|
||||
}
|
||||
|
||||
async getSignInButtonIsEnabled(): Promise<boolean> {
|
||||
return this.signInButton.isEnabled();
|
||||
}
|
||||
|
||||
async clickSignInButton(): Promise<void> {
|
||||
await BrowserActions.click(this.signInButton);
|
||||
}
|
||||
|
||||
async clickSettingsIcon(): Promise<void> {
|
||||
await BrowserActions.click(this.settingsIcon);
|
||||
}
|
||||
|
||||
async showPassword(): Promise<void> {
|
||||
await BrowserActions.click(this.showPasswordElement);
|
||||
}
|
||||
|
||||
async hidePassword(): Promise<void> {
|
||||
await BrowserActions.click(this.hidePasswordElement);
|
||||
}
|
||||
|
||||
async getShownPassword(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.txtPassword);
|
||||
}
|
||||
|
||||
async checkPasswordIsHidden(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
}
|
||||
|
||||
async checkRememberIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.rememberMe);
|
||||
}
|
||||
|
||||
async checkRememberIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.rememberMe);
|
||||
}
|
||||
|
||||
async checkNeedHelpIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.needHelp);
|
||||
}
|
||||
|
||||
async checkNeedHelpIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.needHelp);
|
||||
}
|
||||
|
||||
async checkRegisterDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.register);
|
||||
}
|
||||
|
||||
async checkRegisterIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.register);
|
||||
}
|
||||
|
||||
async enableFooter(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.footerSwitch);
|
||||
}
|
||||
|
||||
async disableFooter(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.footerSwitch);
|
||||
}
|
||||
|
||||
async disableRememberMe(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.rememberMeSwitch);
|
||||
}
|
||||
|
||||
async enableLogoSwitch(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.logoSwitch);
|
||||
}
|
||||
|
||||
async enterLogo(logo: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.logoTxt, logo);
|
||||
}
|
||||
|
||||
async login(username: string, password: string): Promise<void> {
|
||||
await this.loginSSOPage.login(username, password);
|
||||
}
|
||||
|
||||
async loginWithProfile(profile: string): Promise<void> {
|
||||
await this.loginSSOPage.loginWithProfile(profile);
|
||||
}
|
||||
}
|
||||
|
@@ -1,28 +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 } from '@alfresco/adf-testing';
|
||||
|
||||
export class LogoutPage {
|
||||
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
|
||||
async checkLogoutSectionIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
}
|
||||
}
|
@@ -21,8 +21,6 @@ import { ProcessServicesPage } from '../../process-services/pages/process-servic
|
||||
|
||||
export class NavigationBarPage {
|
||||
linkMenuChildrenContainer = $('.nestedMenu');
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
|
||||
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
|
||||
@@ -100,31 +98,6 @@ export class NavigationBarPage {
|
||||
await this.clickNavigationBarItem('Custom Sources');
|
||||
}
|
||||
|
||||
async clickDataTable(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Datatable');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToDatatable(): Promise<void> {
|
||||
await this.clickDataTable();
|
||||
await BrowserActions.click(this.dataTableNestedButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToDragAndDropDatatable(): Promise<void> {
|
||||
await this.clickDataTable();
|
||||
await BrowserActions.click(this.dataTableDragAndDropButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async clickTagButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Tag');
|
||||
}
|
||||
|
||||
async clickSocialButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Social');
|
||||
}
|
||||
|
||||
async clickOverlayViewerButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Overlay Viewer');
|
||||
}
|
||||
|
@@ -1,95 +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 { element, by, browser, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationDemoPage {
|
||||
|
||||
snackbarPage = new SnackbarPage();
|
||||
|
||||
messageField = $('input[data-automation-id="notification-message"]');
|
||||
decorativeIconField = $('input[data-automation-id="notification-icon"]');
|
||||
durationField = $('input[data-automation-id="notification-duration"]');
|
||||
actionToggle = $('mat-slide-toggle[data-automation-id="notification-action-toggle"]');
|
||||
notificationSnackBar = $$('simple-snack-bar').first();
|
||||
actionOutput = $('div[data-automation-id="notification-action-output"]');
|
||||
notificationsPage = $('.app-sidenav-link[data-automation-id="Notifications"]');
|
||||
notificationConfig = $('p[data-automation-id="notification-custom-object"]');
|
||||
|
||||
horizontalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-horizontal-position"]'));
|
||||
verticalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-vertical-position"]'));
|
||||
directionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-direction"]'));
|
||||
|
||||
async checkNotifyContains(message): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||
}
|
||||
|
||||
async goToNotificationsPage(): Promise<void> {
|
||||
await BrowserActions.click(this.notificationsPage);
|
||||
}
|
||||
|
||||
getConfigObject(): Promise<string> {
|
||||
return BrowserActions.getText(this.notificationConfig);
|
||||
}
|
||||
|
||||
async enterMessageField(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.messageField, text);
|
||||
}
|
||||
|
||||
async enterDecorativeIconField(icon: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.decorativeIconField, icon);
|
||||
}
|
||||
|
||||
async enterDurationField(time: number): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.durationField, time.toString());
|
||||
}
|
||||
|
||||
async selectHorizontalPosition(selectItem: string): Promise<void> {
|
||||
await this.horizontalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectVerticalPosition(selectItem: string): Promise<void> {
|
||||
await this.verticalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectDirection(selectItem: string): Promise<void> {
|
||||
await this.directionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async clickNotificationButton(): Promise<void> {
|
||||
const button = $('button[data-automation-id="notification-custom-config-button"]');
|
||||
await BrowserActions.click(button);
|
||||
}
|
||||
|
||||
async checkActionEvent(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.actionOutput);
|
||||
}
|
||||
|
||||
async clickActionToggle(): Promise<void> {
|
||||
await BrowserActions.click(this.actionToggle);
|
||||
}
|
||||
|
||||
async clickActionButton(): Promise<void> {
|
||||
await browser.executeScript(`document.querySelector("[data-automation-id='adf-snackbar-message-content-action-button']").click();`);
|
||||
}
|
||||
|
||||
async clearMessage(): Promise<void> {
|
||||
await BrowserActions.click(this.messageField);
|
||||
await BrowserActions.clearWithBackSpace(this.messageField);
|
||||
}
|
||||
}
|
@@ -19,28 +19,21 @@ import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/a
|
||||
import { browser, $$, $ } from 'protractor';
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
contentList = new DocumentListPage($('adf-document-list'));
|
||||
rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
pagination = $('adf-pagination');
|
||||
emptyTrashcan = $('adf-empty-content');
|
||||
restoreButton = $(`button[title='Restore']`);
|
||||
private contentList = new DocumentListPage($('adf-document-list'));
|
||||
private restoreButton = $(`button[title='Restore']`);
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return this.rows.count();
|
||||
const rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
return rows.count();
|
||||
}
|
||||
|
||||
async waitForTableBody(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
async waitForPagination(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.pagination);
|
||||
const tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tableBody);
|
||||
}
|
||||
|
||||
async checkTrashcanIsEmpty(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyTrashcan);
|
||||
await BrowserVisibility.waitUntilElementIsVisible($('adf-empty-content'));
|
||||
}
|
||||
|
||||
getDocumentList(): DocumentListPage {
|
||||
@@ -55,9 +48,4 @@ export class TrashcanPage {
|
||||
async checkRestoreButtonIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.restoreButton);
|
||||
}
|
||||
|
||||
async checkRestoreButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.restoreButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
DataTableComponentPage,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
@@ -35,7 +34,6 @@ describe('Viewer', () => {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const dataTable = new DataTableComponentPage();
|
||||
|
||||
const pngFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
@@ -168,28 +166,5 @@ describe('Viewer', () => {
|
||||
await viewerPage.checkLeftSideBarButtonIsNotDisplayed();
|
||||
await viewerPage.checkLeftSideBarIsNotDisplayed();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
fit('[C260100] Should be possible to disable Overlay viewer', async () => {
|
||||
await navigationBarPage.clickOverlayViewerButton();
|
||||
await dataTable.doubleClickRow('Name', fileForOverlay.name);
|
||||
await viewerPage.checkOverlayViewerIsDisplayed();
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
await dataTable.doubleClickRow('Name', pngFile.name);
|
||||
|
||||
await viewerPage.checkOverlayViewerIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
|
||||
await viewerPage.disableOverlay();
|
||||
|
||||
await dataTable.doubleClickRow('Name', fileForOverlay.name);
|
||||
await viewerPage.checkImgContainerIsDisplayed();
|
||||
await viewerPage.checkInlineViewerIsDisplayed();
|
||||
await dataTable.doubleClickRow('Name', pngFile.name);
|
||||
await viewerPage.checkImgContainerIsDisplayed();
|
||||
await viewerPage.checkInlineViewerIsDisplayed();
|
||||
});
|
||||
})
|
||||
;
|
||||
});
|
||||
|
@@ -1,108 +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 { by, element, $, $$, browser } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class PeopleGroupCloudComponentPage {
|
||||
|
||||
peopleCloudSingleSelectionChecked = $('mat-radio-button[data-automation-id="app-people-single-mode"][class*="mat-radio-checked"]');
|
||||
peopleCloudMultipleSelectionChecked = $('mat-radio-button[data-automation-id="app-people-multiple-mode"][class*="mat-radio-checked"]');
|
||||
peopleCloudSingleSelection = $('mat-radio-button[data-automation-id="app-people-single-mode"]');
|
||||
peopleCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-people-multiple-mode"]');
|
||||
groupCloudSingleSelection = $('mat-radio-button[data-automation-id="app-group-single-mode"]');
|
||||
groupCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-group-multiple-mode"]');
|
||||
peopleRoleInput = $('input[data-automation-id="app-people-roles-input"]');
|
||||
peopleAppInput = $('input[data-automation-id="app-people-app-input"]');
|
||||
peoplePreselect = $('input[data-automation-id="app-people-preselect-input"]');
|
||||
groupRoleInput = $('input[data-automation-id="app-group-roles-input"]');
|
||||
groupAppInput = $('input[data-automation-id="app-group-app-input"]');
|
||||
peopleCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
|
||||
groupCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
|
||||
preselectValidation = $$('mat-checkbox.app-preselect-value label').first();
|
||||
preselectValidationStatus = $$('mat-checkbox.app-preselect-value label input').first();
|
||||
|
||||
async navigateTo() {
|
||||
await browser.get('#/cloud/people-group-cloud');
|
||||
await browser.waitForAngular();
|
||||
}
|
||||
|
||||
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
|
||||
}
|
||||
|
||||
async checkGroupsCloudComponentTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.groupCloudComponentTitle);
|
||||
}
|
||||
|
||||
async clickPeopleCloudSingleSelection(): Promise<void> {
|
||||
await BrowserActions.click(this.peopleCloudSingleSelection);
|
||||
}
|
||||
|
||||
async clickPeopleCloudMultipleSelection(): Promise<void> {
|
||||
await BrowserActions.click(this.peopleCloudMultipleSelection);
|
||||
}
|
||||
|
||||
async checkPeopleCloudSingleSelectionIsSelected(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSingleSelectionChecked);
|
||||
}
|
||||
|
||||
async checkPeopleCloudMultipleSelectionIsSelected(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudMultipleSelectionChecked);
|
||||
}
|
||||
|
||||
async enterPeopleRoles(roles: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peopleRoleInput, roles);
|
||||
}
|
||||
|
||||
async enterPeoplePreselect(preselect: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peoplePreselect, preselect);
|
||||
}
|
||||
|
||||
async clearField(locator): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(locator, '');
|
||||
}
|
||||
|
||||
async clickGroupCloudSingleSelection(): Promise<void> {
|
||||
await BrowserActions.click(this.groupCloudSingleSelection);
|
||||
}
|
||||
|
||||
async clickGroupCloudMultipleSelection(): Promise<void> {
|
||||
await BrowserActions.click(this.groupCloudMultipleSelection);
|
||||
}
|
||||
|
||||
async enterGroupRoles(roles): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.groupRoleInput, roles);
|
||||
}
|
||||
|
||||
async clickPreselectValidation(): Promise<void> {
|
||||
await BrowserActions.click(this.preselectValidation);
|
||||
}
|
||||
|
||||
async getPreselectValidationStatus(): Promise<string> {
|
||||
return BrowserActions.getAttribute(this.preselectValidationStatus, 'aria-checked');
|
||||
}
|
||||
|
||||
async enterPeopleAppName(appName: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peopleAppInput, appName);
|
||||
}
|
||||
|
||||
async enterGroupAppName(appName: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.groupAppInput, appName);
|
||||
}
|
||||
|
||||
}
|
@@ -1,74 +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,
|
||||
BrowserActions,
|
||||
DataTableComponentPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class ServiceTaskListPage {
|
||||
dataTableComponentPage = new DataTableComponentPage();
|
||||
allServiceTaskButton = $('button[data-automation-id="my-service-tasks_filter"]');
|
||||
completedServiceTaskButton = $('button[data-automation-id="completed-tasks_filter"]');
|
||||
errorServiceTaskButton = $('button[data-automation-id="errored-service-tasks_filter"]');
|
||||
searchHeader = $('adf-cloud-edit-service-task-filter mat-expansion-panel-header');
|
||||
serviceTaskList = $('adf-cloud-service-task-list');
|
||||
activityNameField = $('input[data-automation-id="adf-cloud-edit-task-property-activityName"]');
|
||||
activityStatus = $('[data-automation-id="datatable-row-0"] div[aria-label="Status"]');
|
||||
activityName = $('[data-automation-id="datatable-row-0"] div[aria-label="Activity name"]');
|
||||
resultList = $('div[role="rowgroup"].adf-datatable-body');
|
||||
|
||||
async checkServiceTaskFiltersDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.allServiceTaskButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.completedServiceTaskButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.errorServiceTaskButton);
|
||||
}
|
||||
|
||||
async checkSearchServiceTaskFiltersDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchHeader);
|
||||
}
|
||||
|
||||
async checkServiceTaskListDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.serviceTaskList);
|
||||
}
|
||||
|
||||
async clickCompletedServiceTask(): Promise<void> {
|
||||
await BrowserActions.click(this.completedServiceTaskButton);
|
||||
}
|
||||
|
||||
async clickSearchHeaderServiceTask(): Promise<void> {
|
||||
await BrowserActions.click(this.searchHeader);
|
||||
}
|
||||
|
||||
async searchByActivityName(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.activityNameField, text);
|
||||
}
|
||||
|
||||
async getActivityNameText(): Promise<string> {
|
||||
return BrowserActions.getText(this.activityName);
|
||||
}
|
||||
|
||||
async getStatusText(): Promise<string> {
|
||||
return BrowserActions.getText(this.activityStatus);
|
||||
}
|
||||
|
||||
async checkServiceTaskListResultsIsLoaded(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.resultList);
|
||||
}
|
||||
}
|
@@ -25,26 +25,16 @@ import {
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class TasksCloudDemoPage {
|
||||
|
||||
createButton = TestElement.byCss('button[data-automation-id="create-button"');
|
||||
newTaskButton = TestElement.byCss('button[data-automation-id="btn-start-task"]');
|
||||
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
appButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
|
||||
displayTaskDetailsToggle = $('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]');
|
||||
displayProcessDetailsToggle = $('mat-slide-toggle[data-automation-id="processDetailsRedirection"]');
|
||||
actionMenuToggle = $('mat-slide-toggle[data-automation-id="actionmenu"]');
|
||||
contextMenuToggle = $('mat-slide-toggle[data-automation-id="contextmenu"]');
|
||||
multiSelectionToggle = $('mat-slide-toggle[data-automation-id="multiSelection"]');
|
||||
testingModeToggle = $('mat-slide-toggle[data-automation-id="testingMode"]');
|
||||
selectedRows = element(by.xpath('//div[text()=\' Selected Rows: \']'));
|
||||
noOfSelectedRows = element.all(by.xpath('//div[text()=\' Selected Rows: \']//li'));
|
||||
addActionTitle = element(by.cssContainingText('.mat-card-title', 'Add Action'));
|
||||
keyInputField = TestElement.byCss('input[data-placeholder="Key"]');
|
||||
titleInputField = TestElement.byCss('input[data-placeholder="Title"]');
|
||||
iconInputField = TestElement.byCss('input[data-placeholder="Icon"]');
|
||||
addActionButton = TestElement.byText('button span', 'Add');
|
||||
disableCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='disabled']`);
|
||||
visibleCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='visible']`);
|
||||
spinner = TestElement.byTag('mat-progress-spinner');
|
||||
modeDropdown = new DropdownPage($('mat-form-field[data-automation-id="selectionMode"]'));
|
||||
|
||||
@@ -66,14 +56,6 @@ export class TasksCloudDemoPage {
|
||||
await this.togglePage.enableToggle(this.multiSelectionToggle);
|
||||
}
|
||||
|
||||
async enableActionMenu(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.actionMenuToggle);
|
||||
}
|
||||
|
||||
async enableContextMenu(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.contextMenuToggle);
|
||||
}
|
||||
|
||||
async enableTestingMode(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.testingModeToggle);
|
||||
}
|
||||
@@ -118,44 +100,6 @@ export class TasksCloudDemoPage {
|
||||
return BrowserActions.getText(row);
|
||||
}
|
||||
|
||||
addActionIsDisplayed(): Promise<void> {
|
||||
return new TestElement(this.addActionTitle).waitVisible();
|
||||
}
|
||||
|
||||
async addAction(text: string): Promise<void> {
|
||||
await this.keyInputField.typeText(text);
|
||||
await this.titleInputField.typeText(text);
|
||||
await this.iconInputField.typeText(text);
|
||||
await this.addActionButton.click();
|
||||
}
|
||||
|
||||
async addDisabledAction(text: string): Promise<void> {
|
||||
await this.keyInputField.typeText(text);
|
||||
await this.titleInputField.typeText(text);
|
||||
await this.iconInputField.typeText(text);
|
||||
await this.disableCheckbox.click();
|
||||
await this.addActionButton.click();
|
||||
}
|
||||
|
||||
async addInvisibleAction(text: string): Promise<void> {
|
||||
await this.keyInputField.typeText(text);
|
||||
await this.titleInputField.typeText(text);
|
||||
await this.iconInputField.typeText(text);
|
||||
await this.visibleCheckbox.click();
|
||||
await this.addActionButton.click();
|
||||
}
|
||||
|
||||
actionAdded(action: string): Promise<void> {
|
||||
return TestElement.byText(`mat-chip`, action).waitVisible();
|
||||
}
|
||||
|
||||
async checkActionExecuted(taskId: string, action: string): Promise<void> {
|
||||
await TestElement.byText(`span`, 'Action Menu:').waitVisible();
|
||||
await TestElement.byText(`span`, 'Context Menu:').waitVisible();
|
||||
await TestElement.byText(`span`, 'Task ID: ' + taskId).waitVisible();
|
||||
await TestElement.byText(`span`, 'Action Type: ' + action).waitVisible();
|
||||
}
|
||||
|
||||
async clickStartNewTaskButton() {
|
||||
await this.createButton.click();
|
||||
await this.newTaskButton.click();
|
||||
|
@@ -33,7 +33,6 @@ describe('Applications list', () => {
|
||||
|
||||
let testUser;
|
||||
const appNames = [];
|
||||
let applications;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
@@ -42,7 +41,7 @@ describe('Applications list', () => {
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await apiService.login(testUser.username, testUser.password);
|
||||
|
||||
applications = await applicationsService.getApplicationsByStatus('RUNNING');
|
||||
const applications = await applicationsService.getApplicationsByStatus('RUNNING');
|
||||
|
||||
applications.list.entries.forEach(app => {
|
||||
appNames.push(app.entry.name.toLowerCase());
|
||||
|
@@ -28,18 +28,10 @@ export class AttachFormPage {
|
||||
defaultTitle = $('.mat-card-title');
|
||||
attachFormDropdown = new DropdownPage($('.adf-attach-form-row'));
|
||||
|
||||
async checkNoFormMessageIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
|
||||
}
|
||||
|
||||
async checkAttachFormButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachFormButton);
|
||||
}
|
||||
|
||||
async checkCompleteButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
}
|
||||
|
||||
async clickAttachFormButton(): Promise<void> {
|
||||
await BrowserActions.click(this.attachFormButton);
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ export class ProcessDetailsPage {
|
||||
backButton = TestElement.byCss('app-show-diagram button.mat-mini-fab.mat-accent');
|
||||
commentInput = TestElement.byId('comment-input');
|
||||
auditLogButton = TestElement.byCss('button[adf-process-audit]');
|
||||
auditLogEmptyListMessage = TestElement.byCss('.app-empty-list-header');
|
||||
cancelProcessButton = TestElement.byCss('div[data-automation-id="header-status"] > button');
|
||||
activeTask = TestElement.byCss('div[data-automation-id="active-tasks"]');
|
||||
completedTask = TestElement.byCss('div[data-automation-id="completed-tasks"]');
|
||||
|
@@ -28,7 +28,6 @@ export class ProcessFiltersPage {
|
||||
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"]');
|
||||
tableBody = $$('adf-datatable .adf-datatable-body').first();
|
||||
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||
startProcessEl = $('adf-start-process .adf-start-process');
|
||||
|
||||
|
@@ -26,8 +26,8 @@ export class ProcessListDemoPage {
|
||||
processDefinitionInput = $('input[data-automation-id="process-definition-id"]');
|
||||
processInstanceInput = $('input[data-automation-id="process-instance-id"]');
|
||||
|
||||
stateDropdown = new DropdownPage($('mat-select[data-automation-id="state"'));
|
||||
sortDropdown = new DropdownPage($('mat-select[data-automation-id="sort"'));
|
||||
stateDropdown = new DropdownPage($('mat-select[data-automation-id="state"]'));
|
||||
sortDropdown = new DropdownPage($('mat-select[data-automation-id="sort"]'));
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { $ } from 'protractor';
|
||||
|
||||
export class ProcessListPage {
|
||||
|
||||
processListTitle = $('.adf-empty-content__title');
|
||||
processInstanceList = $('adf-process-instance-list');
|
||||
|
||||
@@ -27,10 +26,6 @@ export class ProcessListPage {
|
||||
return BrowserActions.getText(this.processListTitle);
|
||||
}
|
||||
|
||||
titleNotPresent(): Promise<string> {
|
||||
return BrowserVisibility.waitUntilElementIsNotPresent(this.processListTitle);
|
||||
}
|
||||
|
||||
async isProcessListDisplayed(): Promise<boolean> {
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceList);
|
||||
@@ -39,5 +34,4 @@ export class ProcessListPage {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -58,11 +58,8 @@ export class TaskDetailsPage {
|
||||
removeInvolvedPeople = $('button[data-automation-id="Remove"]');
|
||||
peopleTitle = $('#people-title');
|
||||
noFormMessage = $('span[id*="no-form-message"]');
|
||||
cancelAttachForm = $('#adf-no-form-cancel-button');
|
||||
attachFormButton = $('#adf-no-form-attach-form-button');
|
||||
disabledAttachFormButton = $('button[id="adf-no-form-attach-form-button"][disabled]');
|
||||
removeAttachForm = $('#adf-attach-form-remove-button');
|
||||
attachFormName = $('.adf-form-title');
|
||||
emptyTaskDetails = $('adf-task-details > div > div');
|
||||
priority = $('[data-automation-id*="card-textitem-value-priority"]');
|
||||
editableAssignee = $('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]');
|
||||
@@ -94,22 +91,10 @@ export class TaskDetailsPage {
|
||||
await this.attachFormDropdown.checkOptionIsSelected(formName);
|
||||
}
|
||||
|
||||
async checkAttachFormButtonIsDisabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.disabledAttachFormButton);
|
||||
}
|
||||
|
||||
async checkAttachFormButtonIsEnabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.attachFormButton);
|
||||
}
|
||||
|
||||
async checkAttachFormDropdownIsDisplayed(): Promise<void> {
|
||||
await this.attachFormDropdown.checkDropdownIsVisible();
|
||||
}
|
||||
|
||||
async selectAttachFormOption(option): Promise<void> {
|
||||
await this.attachFormDropdown.selectDropdownOption(option);
|
||||
}
|
||||
|
||||
async noFormIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.formContent);
|
||||
}
|
||||
@@ -139,10 +124,6 @@ export class TaskDetailsPage {
|
||||
await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName);
|
||||
}
|
||||
|
||||
getFormName(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.formNameField);
|
||||
}
|
||||
|
||||
async waitFormNameEqual(formName: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName);
|
||||
}
|
||||
|
@@ -45,9 +45,4 @@ export class TaskFiltersPage {
|
||||
async clickTaskFilter(): Promise<void> {
|
||||
return BrowserActions.click(this.filter);
|
||||
}
|
||||
|
||||
async checkTaskFilterNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -83,10 +83,6 @@ export class TaskListDemoPage {
|
||||
await this.taskList().getDataTable().waitTillContentLoaded();
|
||||
}
|
||||
|
||||
async getProcessDefinitionId(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.processInstanceId);
|
||||
}
|
||||
|
||||
async typeProcessInstanceId(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.processInstanceId, input);
|
||||
}
|
||||
@@ -105,10 +101,6 @@ export class TaskListDemoPage {
|
||||
await BrowserActions.clearSendKeys(this.page, input.toString());
|
||||
}
|
||||
|
||||
async getPage(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.page);
|
||||
}
|
||||
|
||||
async getPageFieldErrorMessage(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
|
||||
const errorMessage = this.pageForm.$('mat-error');
|
||||
@@ -123,11 +115,6 @@ export class TaskListDemoPage {
|
||||
await BrowserActions.clearSendKeys(this.dueBefore, input);
|
||||
}
|
||||
|
||||
async clearText(input): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(input);
|
||||
await input.clear();
|
||||
}
|
||||
|
||||
async clickResetButton(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.resetButton);
|
||||
|
@@ -53,10 +53,6 @@ export class TasksPage {
|
||||
await dialog.clickStartButton();
|
||||
}
|
||||
|
||||
async newTaskButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.newTaskButton);
|
||||
}
|
||||
|
||||
async clickOnCreateButton(): Promise<void> {
|
||||
await BrowserActions.click(this.createButton);
|
||||
}
|
||||
|
@@ -106,8 +106,6 @@ exports.config = {
|
||||
suites: {
|
||||
smokeTestCore: [
|
||||
"./core/login-sso/login-sso.e2e.ts",
|
||||
"./core/login/login-component.e2e.ts",
|
||||
"./core/login/remember-me.e2e.ts",
|
||||
"./core/viewer/**/*.e2e.ts"
|
||||
],
|
||||
smokeTestCsSearch: [
|
||||
|
@@ -176,15 +176,10 @@ describe('Search Date Range Filter', () => {
|
||||
});
|
||||
|
||||
describe('configuration change', () => {
|
||||
let jsonFile;
|
||||
|
||||
beforeAll(async () => {
|
||||
jsonFile = SearchConfiguration.getConfiguration();
|
||||
});
|
||||
|
||||
it('[C277117] Should be able to change date format', async () => {
|
||||
await navigationBar.navigateToContentServices();
|
||||
|
||||
const jsonFile= SearchConfiguration.getConfiguration();
|
||||
jsonFile.categories[4].component.settings.dateFormat = 'MM-DD-YY';
|
||||
|
||||
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
|
||||
|
@@ -141,7 +141,7 @@ describe('Search Radio Component', () => {
|
||||
|
||||
for (let numberOfOptions = 0; numberOfOptions < 6; numberOfOptions++) {
|
||||
jsonFile.categories[5].component.settings.options.push({
|
||||
name: 'APP.SEARCH.RADIO.FOLDER',
|
||||
name: 'Folder',
|
||||
value: 'TYPE:\'cm:folder\''
|
||||
});
|
||||
}
|
||||
@@ -199,7 +199,7 @@ describe('Search Radio Component', () => {
|
||||
|
||||
for (let numberOfOptions = 0; numberOfOptions < 6; numberOfOptions++) {
|
||||
jsonFile.categories[5].component.settings.options.push({
|
||||
name: 'APP.SEARCH.RADIO.FOLDER',
|
||||
name: 'Folder',
|
||||
value: 'TYPE:\'cm:folder\''
|
||||
});
|
||||
}
|
||||
|
@@ -76,12 +76,6 @@ describe('Search component - Text widget', () => {
|
||||
});
|
||||
|
||||
describe('configuration change', () => {
|
||||
let jsonFile;
|
||||
|
||||
beforeAll(async () => {
|
||||
jsonFile = SearchConfiguration.getConfiguration();
|
||||
});
|
||||
|
||||
it('[C289330] Should be able to change the Field setting', async () => {
|
||||
await BrowserActions.getUrl(browser.baseUrl + '/search;q=*');
|
||||
await searchResultPage.tableIsLoaded();
|
||||
@@ -99,6 +93,7 @@ describe('Search component - Text widget', () => {
|
||||
await searchFiltersPage.textFiltersPage().searchByName(newFolderModel.description);
|
||||
await searchResultPage.checkContentIsNotDisplayed(newFolderModel.name);
|
||||
|
||||
const jsonFile= SearchConfiguration.getConfiguration();
|
||||
jsonFile.categories[0].component.settings.field = 'cm:description';
|
||||
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, ElementFinder, protractor, $ } from 'protractor';
|
||||
import { ElementFinder, protractor, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchBarPage {
|
||||
@@ -31,12 +31,6 @@ export class SearchBarPage {
|
||||
|
||||
getRowByRowName = (name: string): ElementFinder => $(`mat-list-item[data-automation-id='autocomplete_for_${name}']`);
|
||||
|
||||
async pressDownArrowAndEnter(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await BrowserActions.clearSendKeys(this.searchBar, protractor.Key.ARROW_DOWN);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
async clickOnSearchIcon(): Promise<void> {
|
||||
await BrowserActions.click(this.searchIcon);
|
||||
}
|
||||
|
@@ -169,10 +169,10 @@ export class SearchConfiguration {
|
||||
field: null,
|
||||
pageSize: 5,
|
||||
options: [
|
||||
{name: 'APP.SEARCH.RADIO.NONE', value: '', default: true},
|
||||
{name: 'APP.SEARCH.RADIO.ALL', value: 'TYPE:\'cm:folder\' OR TYPE:\'cm:content\''},
|
||||
{name: 'APP.SEARCH.RADIO.FOLDER', value: 'TYPE:\'cm:folder\''},
|
||||
{name: 'APP.SEARCH.RADIO.DOCUMENT', value: 'TYPE:\'cm:content\''}
|
||||
{name: 'None', value: '', default: true},
|
||||
{name: 'All', value: 'TYPE:\'cm:folder\' OR TYPE:\'cm:content\''},
|
||||
{name: 'Folder', value: 'TYPE:\'cm:folder\''},
|
||||
{name: 'Document', value: 'TYPE:\'cm:content\''}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -188,8 +188,8 @@ export class SearchConfiguration {
|
||||
maxDate: 'today',
|
||||
field: 'cm:created, cm:modified',
|
||||
displayedLabelsByField: {
|
||||
"cm:created": 'Created Date',
|
||||
"cm:modified": 'Modified Date'
|
||||
'cm:created': 'Created Date',
|
||||
'cm:modified': 'Modified Date'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user