mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user