[ACS-6185 ] infoDriver test fix. (#3490)

* infoDriver test fix

* infoDriver test excluded

* infoDriver test delete
This commit is contained in:
Akash Rathod
2023-10-24 08:29:18 +02:00
committed by GitHub
parent f50dfe9dca
commit 9b2cf2bbf1
3 changed files with 10 additions and 136 deletions

View File

@@ -39,5 +39,8 @@
"C325158" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
"C325161" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
"C325162" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
"C325163" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678"
"C325163" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
"C269007" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ",
"C307106" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 ",
"C269003" : "date test fail migrate to playwright https://alfresco.atlassian.net/browse/ACS-6185 "
}

View File

@@ -97,7 +97,7 @@ describe('Extensions - Info Drawer', () => {
});
afterAll(async () => {
await apis.user.nodes.deleteNodes([fileId]);
await apis.user.nodes.deleteNodesById([fileId]);
});
it('[C284646] Add a new tab with icon and title ', async () => {
@@ -156,7 +156,7 @@ describe('Extensions - Info Drawer', () => {
});
afterAll(async () => {
await apis.user.nodes.deleteNodes([fileIdRemove]);
await apis.user.nodes.deleteNodesById([fileIdRemove]);
});
it('[C284650] Remove all tabs', async () => {

View File

@@ -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', () => {
@@ -49,7 +38,6 @@ describe('File / Folder properties', () => {
author: 'file author',
contentType: 'Content'
};
let file1Id: string;
const image1 = {
name: FILES.jpgFile,
@@ -57,7 +45,6 @@ describe('File / Folder properties', () => {
description: 'image description',
author: 'image author'
};
let image1Id: string;
const folder1 = {
name: `folder1-${Utils.random()}`,
@@ -66,7 +53,6 @@ describe('File / Folder properties', () => {
author: 'folder author',
contentType: 'Folder'
};
let folder1Id: string;
const apis = {
user: new RepoClient(username, username)
@@ -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);
});
@@ -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);
@@ -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);