mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-9749] [E2E] Automated 5513 and 5516 (#4604)
* [ACS-9749] [E2E] Automated 5513 and 5516 * [ACS-9749] fixed setGranularPermission * [ACS-9749] review fixes 1 * [ACS-9749] Excluded flaky tests * [ACS-9749] Test upload npm logs * [ACS-9749] Test upload npm logs v2 * [ACS-9749] updated package-lock.json
This commit is contained in:
19
.github/workflows/pull-request.yml
vendored
19
.github/workflows/pull-request.yml
vendored
@@ -43,6 +43,13 @@ jobs:
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
|
||||
- name: upload npm logs
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: npm-logs
|
||||
path: /home/runner/.npm/_logs/
|
||||
|
||||
- name: lint affected
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: npm run affected:lint -- --base=origin/develop
|
||||
@@ -67,6 +74,12 @@ jobs:
|
||||
cache: 'npm'
|
||||
- uses: ./.github/actions/before-install
|
||||
- run: npm ci
|
||||
- name: upload npm logs
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: npm-logs
|
||||
path: /home/runner/.npm/_logs/
|
||||
- run: npx nx build aca-playwright-shared
|
||||
- run: npm run build -- $BUILD_OPTS
|
||||
|
||||
@@ -93,6 +106,12 @@ jobs:
|
||||
cache: 'npm'
|
||||
- uses: ./.github/actions/before-install
|
||||
- run: npm ci
|
||||
- name: upload npm logs
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: npm-logs
|
||||
path: /home/runner/.npm/_logs/
|
||||
|
||||
- name: Test
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
@@ -32,7 +32,8 @@ import {
|
||||
FileActionsApi,
|
||||
TagsApi,
|
||||
CategoriesApi,
|
||||
PersonalFilesPage
|
||||
PersonalFilesPage,
|
||||
TEST_FILES
|
||||
} from '@alfresco/aca-playwright-shared';
|
||||
|
||||
test.describe('Info Drawer - File Folder Properties', () => {
|
||||
@@ -45,11 +46,16 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
let responseTagsId: string;
|
||||
let Folder17240Id: string;
|
||||
let Folder17242Id: string;
|
||||
let Folder5513Id: string;
|
||||
let Folder5516Id: string;
|
||||
const tagsPhraseForDeletion = 'e2e';
|
||||
const username = `user-e2e-${Utils.random()}`;
|
||||
const manualTagName = `e2e-tag-${Utils.random()}`;
|
||||
const FolderC299162 = `C299162-e2e-${Utils.random()}`;
|
||||
const FolderC599174 = `C599174-e2e-${Utils.random()}`;
|
||||
const Folder5512 = `xat-5512-e2e-${Utils.random()}`;
|
||||
const Folder5513 = `xat-5513-e2e-${Utils.random()}`;
|
||||
const Folder5514 = `xat-5514-e2e-${Utils.random()}`;
|
||||
const Folder5516 = `xat-5516-e2e-${Utils.random()}`;
|
||||
const File5516 = `xat-5516-e2e-${Utils.random()}`;
|
||||
const Folder17238 = `xat-17238-e2e-${Utils.random()}`;
|
||||
const Folder17239 = `xat-17239-e2e-${Utils.random()}`;
|
||||
const Folder17240 = `xat-17240-e2e-${Utils.random()}`;
|
||||
@@ -99,8 +105,10 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
throw new Error('Failed to create category or tag - check API manually');
|
||||
}
|
||||
|
||||
await nodesApi.createFolder(FolderC299162);
|
||||
await nodesApi.createFolder(FolderC599174);
|
||||
await nodesApi.createFolder(Folder5512);
|
||||
Folder5513Id = (await nodesApi.createFolder(Folder5513)).entry.id;
|
||||
await nodesApi.createFolder(Folder5514);
|
||||
Folder5516Id = (await nodesApi.createFolder(Folder5516)).entry.id;
|
||||
await nodesApi.createFolder(Folder17238);
|
||||
await nodesApi.createFolder(Folder17239);
|
||||
Folder17240Id = (await nodesApi.createFolder(Folder17240)).entry.id;
|
||||
@@ -108,6 +116,17 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
Folder17242Id = (await nodesApi.createFolder(Folder17242)).entry.id;
|
||||
await nodesApi.createFolder(Folder17243);
|
||||
await nodesApi.createFolder(Folder17244);
|
||||
|
||||
const Folder5513BodyUpdate = {
|
||||
properties: {
|
||||
'cm:title': '1234',
|
||||
'cm:description': '123',
|
||||
'cm:author': '123'
|
||||
}
|
||||
};
|
||||
|
||||
await nodesApi.updateNode(Folder5513Id, Folder5513BodyUpdate);
|
||||
await fileActionsApi.uploadFileWithRename(TEST_FILES.JPG_FILE.path, File5516, Folder5516Id);
|
||||
} catch (error) {
|
||||
console.error(`beforeAll failed : ${error}`);
|
||||
}
|
||||
@@ -123,31 +142,59 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
await tagsApi.deleteTagsByTagName(tagsPhraseForDeletion);
|
||||
});
|
||||
|
||||
async function navigateAndOpenInfoDrawer(personalFiles: PersonalFilesPage, folderName: string) {
|
||||
await fileActionsApi.waitForNodes(folderName, { expect: 1 });
|
||||
async function navigateAndOpenInfoDrawer(personalFiles: PersonalFilesPage, nodeName: string, subFolderId?: string) {
|
||||
await fileActionsApi.waitForNodes(nodeName, { expect: 1 });
|
||||
if (subFolderId) {
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${subFolderId}` });
|
||||
} else {
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, folderName);
|
||||
await expect(personalFiles.dataTable.getRowByName(folderName)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(folderName).click();
|
||||
}
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, nodeName);
|
||||
await expect(personalFiles.dataTable.getRowByName(nodeName)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(nodeName).click();
|
||||
await personalFiles.acaHeader.viewDetails.click();
|
||||
}
|
||||
|
||||
test('[XAT-5512] View properties - Default tabs', async ({ personalFiles }) => {
|
||||
await navigateAndOpenInfoDrawer(personalFiles, FolderC299162);
|
||||
expect(await personalFiles.infoDrawer.getHeaderTitle()).toEqual(FolderC299162);
|
||||
await navigateAndOpenInfoDrawer(personalFiles, Folder5512);
|
||||
expect(await personalFiles.infoDrawer.getHeaderTitle()).toEqual(Folder5512);
|
||||
await expect(personalFiles.infoDrawer.propertiesTab).toBeVisible();
|
||||
await expect(personalFiles.infoDrawer.commentsTab).toBeVisible();
|
||||
expect(await personalFiles.infoDrawer.getTabsCount()).toEqual(2);
|
||||
});
|
||||
|
||||
test('[XAT-5513] View file properties - General Info fields', async ({ personalFiles }) => {
|
||||
const generalInfoProperties = ['Name', 'Title', 'Creator', 'Created Date', 'Modifier', 'Modified Date', 'Author', 'Description', 'Content Type'];
|
||||
await navigateAndOpenInfoDrawer(personalFiles, Folder5513);
|
||||
await expect(personalFiles.infoDrawer.generalInfoProperties.first()).not.toBeInViewport();
|
||||
await personalFiles.infoDrawer.generalInfoAccordion.click();
|
||||
await expect(personalFiles.infoDrawer.generalInfoProperties.first()).toBeInViewport();
|
||||
const getPropertiesText = (await personalFiles.infoDrawer.generalInfoProperties.allTextContents()).join('');
|
||||
for (const property of generalInfoProperties) {
|
||||
expect(getPropertiesText).toContain(property);
|
||||
}
|
||||
});
|
||||
|
||||
test('[XAT-5516] View image properties', async ({ personalFiles }) => {
|
||||
const imageExifProperties = ['Image Width', 'Image Height'];
|
||||
await navigateAndOpenInfoDrawer(personalFiles, File5516, Folder5516Id);
|
||||
await expect(personalFiles.infoDrawer.exifInfoProperties.first()).not.toBeInViewport();
|
||||
await personalFiles.infoDrawer.exifInfoAccordion.click();
|
||||
await expect(personalFiles.infoDrawer.exifInfoProperties.first()).toBeInViewport();
|
||||
const getPropertiesText = (await personalFiles.infoDrawer.exifInfoProperties.allTextContents()).join('');
|
||||
for (const property of imageExifProperties) {
|
||||
expect(getPropertiesText).toContain(property);
|
||||
}
|
||||
});
|
||||
|
||||
test('[XAT-5514] View properties - Should be able to make the folders info drawer expandable as for Sites', async ({ personalFiles }) => {
|
||||
await navigateAndOpenInfoDrawer(personalFiles, FolderC599174);
|
||||
await navigateAndOpenInfoDrawer(personalFiles, Folder5514);
|
||||
await personalFiles.infoDrawer.expandDetailsButton.click();
|
||||
await expect(personalFiles.infoDrawer.expandedDetailsPermissionsTab).toBeVisible();
|
||||
|
||||
await personalFiles.navigate();
|
||||
await expect(personalFiles.dataTable.getRowByName(FolderC599174)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(FolderC599174).click({ button: 'right' });
|
||||
await expect(personalFiles.dataTable.getRowByName(Folder5514)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(Folder5514).click({ button: 'right' });
|
||||
await personalFiles.pagination.clickMenuItem('Permissions');
|
||||
await expect(personalFiles.infoDrawer.expandedDetailsPermissionsTab).toBeVisible();
|
||||
});
|
||||
|
@@ -1,5 +1,9 @@
|
||||
{
|
||||
"XAT-5601": "https://hyland.atlassian.net/browse/ACS-6928",
|
||||
"XAT-5600": "https://hyland.atlassian.net/browse/ACS-6928",
|
||||
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464"
|
||||
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464",
|
||||
"XAT-5571": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-17700": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-17120": "https://hyland.atlassian.net/browse/ACS-9756",
|
||||
"XAT-5567": "https://hyland.atlassian.net/browse/ACS-9756"
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ test.describe('Search sorting', () => {
|
||||
|
||||
parentId = (await nodesApi1.createFolder(parent)).entry.id;
|
||||
|
||||
await nodesApi1.setGranularPermission(parentId, true, user2, 'Collaborator');
|
||||
await nodesApi1.setGranularPermission(parentId, user2, 'Collaborator', true);
|
||||
|
||||
await fileActionsApi1.uploadFileWithRename(fileJpg.source, fileJpg.name, parentId);
|
||||
await fileActionsApi2.uploadFileWithRename(filePdf.source, filePdf.name, parentId, filePdf.title, filePdf.description);
|
||||
|
@@ -160,7 +160,7 @@ test.describe('Special permissions : ', () => {
|
||||
|
||||
await managerNodeActions.lockNodes([fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId]);
|
||||
|
||||
await managerNodeActions.setGranularPermission(fileGranularPermissionId, false, userConsumer, Site.RoleEnum.SiteManager);
|
||||
await managerNodeActions.setGranularPermission(fileGranularPermissionId, userConsumer, Site.RoleEnum.SiteManager, false);
|
||||
|
||||
await collaboratorFavoritesActions.isFavoriteWithRetry(userCollaborator, fileSharedFavId, { expect: true });
|
||||
await Promise.all([
|
||||
|
5410
package-lock.json
generated
5410
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
import { NodeChildAssociationPaging, NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { NodeChildAssociationPaging, NodeEntry, NodePaging, NodesIncludeQuery, NodeBodyUpdate } from '@alfresco/js-api';
|
||||
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
|
||||
|
||||
export class NodesApi {
|
||||
@@ -159,6 +159,15 @@ export class NodesApi {
|
||||
}
|
||||
}
|
||||
|
||||
async updateNode(nodeId: string, nodeBodyUpdate: NodeBodyUpdate, opts?: NodesIncludeQuery): Promise<NodeEntry | null> {
|
||||
try {
|
||||
return await this.apiService.nodes.updateNode(nodeId, nodeBodyUpdate, opts);
|
||||
} catch (error) {
|
||||
console.error(`${this.constructor.name} ${this.updateNode.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all nodes of the currently logged in user
|
||||
* @param userNodeId The id of User node, all child nodes of "userNodeId" will be gathered as a list and deleted ( e.g.: "-my-" - User Homes folder)
|
||||
@@ -290,7 +299,7 @@ export class NodesApi {
|
||||
});
|
||||
}
|
||||
|
||||
async setGranularPermission(nodeId: string, inheritPermissions: boolean = false, username: string, role: string): Promise<NodeEntry | null> {
|
||||
async setGranularPermission(nodeId: string, username: string, role: string, inheritPermissions = false): Promise<NodeEntry | null> {
|
||||
const data = {
|
||||
permissions: {
|
||||
isInheritanceEnabled: inheritPermissions,
|
||||
|
@@ -82,6 +82,10 @@ export class AdfInfoDrawerComponent extends BaseComponent {
|
||||
public categoriesListItems = this.categoriesManagement.locator('.adf-category');
|
||||
public categoriesItemRemoveButton = this.categoriesManagement.locator('[data-automation-id="categories-remove-category-button"]');
|
||||
public categoriesCreatedList = this.getChild('.adf-metadata-categories');
|
||||
public generalInfoAccordion = this.getChild('[data-automation-id="adf-metadata-group-properties"]');
|
||||
public generalInfoProperties = this.generalInfoAccordion.locator('.adf-property');
|
||||
public exifInfoAccordion = this.getChild('[data-automation-id="adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE"]');
|
||||
public exifInfoProperties = this.exifInfoAccordion.locator('.adf-property');
|
||||
|
||||
async checkCommentsHeaderCount(): Promise<number> {
|
||||
const commentsCountTextContent = await this.commentsHeader.textContent();
|
||||
|
Reference in New Issue
Block a user