Skip to content

Commit

Permalink
infoDriver test delete
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrathod28 committed Oct 23, 2023
1 parent b77c1c7 commit b8339bf
Showing 1 changed file with 4 additions and 133 deletions.
137 changes: 4 additions & 133 deletions e2e/protractor/suites/info-drawer/file-folder-properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/

import {
AdminActions,
LoginPage,
BrowsingPage,
RepoClient,
InfoDrawer,
Utils,
FILES,
DATE_TIME_FORMAT,
DATE_FORMAT
} from '@alfresco/aca-testing-shared';
import { DateFnsUtils } from '@alfresco/adf-core';
import { AdminActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils, FILES } from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';

describe('File / Folder properties', () => {
Expand All @@ -49,15 +38,13 @@ describe('File / Folder properties', () => {
author: 'file author',
contentType: 'Content'
};
let file1Id: string;

const image1 = {
name: FILES.jpgFile,
title: 'image title',
description: 'image description',
author: 'image author'
};
let image1Id: string;

const folder1 = {
name: `folder1-${Utils.random()}`,
Expand All @@ -66,7 +53,6 @@ describe('File / Folder properties', () => {
author: 'folder author',
contentType: 'Folder'
};
let folder1Id: string;

const apis = {
user: new RepoClient(username, username)
Expand All @@ -83,9 +69,9 @@ describe('File / Folder properties', () => {
beforeAll(async () => {
await adminApiActions.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
file1Id = (await apis.user.nodes.createFile(file1.name, parentId, file1.title, file1.description, file1.author)).entry.id;
folder1Id = (await apis.user.nodes.createFolder(folder1.name, parentId, folder1.title, folder1.description, folder1.author)).entry.id;
image1Id = (await apis.user.upload.uploadFile(image1.name, parentId)).entry.id;
await apis.user.nodes.createFile(file1.name, parentId, file1.title, file1.description, file1.author);
await apis.user.nodes.createFolder(folder1.name, parentId, folder1.title, folder1.description, folder1.author);
await apis.user.upload.uploadFile(image1.name, parentId);

await loginPage.loginWith(username);
});
Expand All @@ -111,72 +97,6 @@ describe('File / Folder properties', () => {
expect(await infoDrawer.getTabsCount()).toBe(2, 'Incorrect number of tabs');
});

it('[C269003] File properties', async () => {
const apiProps = await apis.user.nodes.getNodeById(file1Id);

const expectedPropLabels = [
'Name',
'Title',
'Creator',
'Created Date',
'Size',
'Modifier',
'Modified Date',
'Mimetype',
'Author',
'Description',
'Content Type'
];
const expectedPropValues = [
file1.name,
file1.title,
apiProps.entry.createdByUser.displayName,
DateFnsUtils.formatDate(apiProps.entry.createdAt, DATE_FORMAT),
`${apiProps.entry.content.sizeInBytes} Bytes`,
apiProps.entry.modifiedByUser.displayName,
DateFnsUtils.formatDate(apiProps.entry.modifiedAt, DATE_FORMAT),
apiProps.entry.content.mimeTypeName,
file1.author,
file1.description,
file1.contentType
];

await dataTable.selectItem(file1.name);
await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen();

expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
});

it('[C307106] Folder properties', async () => {
const apiProps = await apis.user.nodes.getNodeById(folder1Id);

const expectedPropLabels = ['Name', 'Title', 'Creator', 'Created Date', 'Modifier', 'Modified Date', 'Author', 'Description', 'Content Type'];
const expectedPropValues = [
folder1.name,
folder1.title,
apiProps.entry.createdByUser.displayName,
DateFnsUtils.formatDate(apiProps.entry.createdAt, DATE_FORMAT),
apiProps.entry.modifiedByUser.displayName,
DateFnsUtils.formatDate(apiProps.entry.modifiedAt, DATE_FORMAT),
folder1.author,
folder1.description,
folder1.contentType
];

await dataTable.selectItem(folder1.name);
await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen();

expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
});

it('[C269004] Less / More information buttons', async () => {
await dataTable.selectItem(file1.name);
await BrowserActions.click(page.toolbar.viewDetailsButton);
Expand All @@ -198,55 +118,6 @@ describe('File / Folder properties', () => {
expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded');
});

it('[C269007] Image properties', async () => {
const apiProps = await apis.user.nodes.getNodeById(image1Id);
const properties = apiProps.entry.properties;

const expectedPropLabels = [
'Image Width',
'Image Height',
'Date and Time',
'Exposure Time',
'F Number',
'Flash Activated',
'Focal Length',
'ISO Speed',
'Orientation',
'Camera Manufacturer',
'Camera Model',
'Camera Software'
];
const expectedPropValues = [
properties['exif:pixelXDimension']?.toString(),
properties['exif:pixelYDimension']?.toString(),
DateFnsUtils.formatDate(new Date(properties['exif:dateTimeOriginal']), DATE_TIME_FORMAT),
properties['exif:exposureTime']?.toString(),
properties['exif:fNumber']?.toString(),
properties['exif:flash'],
properties['exif:focalLength']?.toString(),
properties['exif:isoSpeedRatings'],
properties['exif:orientation']?.toString(),
properties['exif:manufacturer'],
properties['exif:model'],
properties['exif:software']
];

await dataTable.selectItem(image1.name);
await BrowserActions.click(page.toolbar.viewDetailsButton);
await infoDrawer.waitForInfoDrawerToOpen();

await BrowserActions.click(propertiesTab.moreInfoButton);
await BrowserActions.click(propertiesTab.imagePropertiesPanel);

await propertiesTab.waitForImagePropertiesPanelToExpand();

expect(await propertiesTab.isImagePropertiesPanelDisplayed()).toBe(true, 'Image properties panel not displayed');
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
});

it('[C599174] Should be able to make the files/folders info drawer expandable as for Sites', async () => {
await dataTable.selectItem(file1.name);
await BrowserActions.click(page.toolbar.viewDetailsButton);
Expand Down

0 comments on commit b8339bf

Please sign in to comment.