[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:
Denys Vuika
2023-08-08 14:09:41 +01:00
committed by GitHub
parent 17535c9f53
commit 4f2b3bce3c
257 changed files with 528 additions and 15154 deletions

View File

@@ -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');
});

View File

@@ -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);

View File

@@ -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);
});
});
});

View File

@@ -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();
});
});