[ACS-6233] Enable metadata e2es (#9391)

* [ACS-6233] enable metadata e2es

* [ACS-6233][ci:force]

* [ACS-6233] cr fix

* [ACS-6233] cr fix

* [ACS-6233] fix e2e C260181
This commit is contained in:
Mykyta Maliarchuk
2024-03-13 15:40:04 +01:00
committed by GitHub
parent 32f2bf995d
commit e675a12dfd
7 changed files with 29 additions and 18 deletions

View File

@@ -140,8 +140,8 @@ describe('CardView Component - properties', () => {
await CheckboxPage.uncheck(metadataViewPage.defaultPropertiesSwitch); await CheckboxPage.uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.checkMetadataGroupIsNotPresent('properties'); await metadataViewPage.checkMetadataGroupIsNotPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF'); await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF'); await metadataViewPage.checkMetadataGroupIsExpand('Versionable');
await CheckboxPage.check(metadataViewPage.defaultPropertiesSwitch); await CheckboxPage.check(metadataViewPage.defaultPropertiesSwitch);

View File

@@ -191,8 +191,7 @@ describe('Metadata component', () => {
await metadataViewPage.clickOnPropertiesTab(); await metadataViewPage.clickOnPropertiesTab();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB); await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await metadataViewPage.clickMetadataGroup('EXIF'); await metadataViewPage.clickMetadataGroupEditIcon('EXIF');
await metadataViewPage.editIconClick();
await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software'); await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
await metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings'); await metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');

View File

@@ -46,6 +46,8 @@ export class MetadataViewPage {
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`[data-automation-id="adf-metadata-group-${groupName}"]`); $(`[data-automation-id="adf-metadata-group-${groupName}"]`);
private getMetadataGroupEditIconLocator = async (groupName: string): Promise<ElementFinder> =>
$(`[data-automation-id="adf-metadata-group-${groupName}"]`).$(this.editIcon.locator().value);
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`[data-automation-id="adf-metadata-group-${groupName}"] > ${materialLocators.Expansion.panel.header.root}`); $(`[data-automation-id="adf-metadata-group-${groupName}"] > ${materialLocators.Expansion.panel.header.root}`);
@@ -105,10 +107,6 @@ export class MetadataViewPage {
await BrowserVisibility.waitUntilElementIsVisible(this.editIconGeneral); await BrowserVisibility.waitUntilElementIsVisible(this.editIconGeneral);
} }
async editIconClick(): Promise<void> {
await BrowserActions.clickExecuteScript('button[data-automation-id="meta-data-card-toggle-edit"]');
}
async clickEditIconGeneral(): Promise<void> { async clickEditIconGeneral(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.editIconGeneral); await BrowserVisibility.waitUntilElementIsVisible(this.editIconGeneral);
await BrowserActions.click(this.editIconGeneral); await BrowserActions.click(this.editIconGeneral);
@@ -149,6 +147,11 @@ export class MetadataViewPage {
await BrowserActions.click(group); await BrowserActions.click(group);
} }
async clickMetadataGroupEditIcon(groupName: string): Promise<void> {
const group = await this.getMetadataGroupEditIconLocator(groupName);
await BrowserActions.click(group);
}
async checkMetadataGroupIsPresent(groupName: string): Promise<void> { async checkMetadataGroupIsPresent(groupName: string): Promise<void> {
const group = await this.getMetadataGroupLocator(groupName); const group = await this.getMetadataGroupLocator(groupName);
await BrowserVisibility.waitUntilElementIsVisible(group); await BrowserVisibility.waitUntilElementIsVisible(group);

View File

@@ -12,13 +12,6 @@
"C311319-2": "https://alfresco.atlassian.net/browse/APPS-2254", "C311319-2": "https://alfresco.atlassian.net/browse/APPS-2254",
"C311319-4": "https://alfresco.atlassian.net/browse/APPS-2254", "C311319-4": "https://alfresco.atlassian.net/browse/APPS-2254",
"C297691": "https://alfresco.atlassian.net/browse/APPS-2254", "C297691": "https://alfresco.atlassian.net/browse/APPS-2254",
"C246516": "https://alfresco.atlassian.net/browse/ACS-6233",
"C268965": "https://alfresco.atlassian.net/browse/ACS-6233",
"C280559": "https://alfresco.atlassian.net/browse/ACS-6233",
"C307975": "https://alfresco.atlassian.net/browse/ACS-6233",
"C279971": "https://alfresco.atlassian.net/browse/ACS-6233",
"C279972": "https://alfresco.atlassian.net/browse/ACS-6233",
"C260181": "https://alfresco.atlassian.net/browse/ACS-6233",
"C297692": "https://alfresco.atlassian.net/browse/ACS-6244", "C297692": "https://alfresco.atlassian.net/browse/ACS-6244",
"C260418": "https://alfresco.atlassian.net/browse/ACS-6425", "C260418": "https://alfresco.atlassian.net/browse/ACS-6425",
"C268070": "https://alfresco.atlassian.net/browse/ACS-6425", "C268070": "https://alfresco.atlassian.net/browse/ACS-6425",

View File

@@ -204,9 +204,9 @@
<div *ngFor="let group of groupedProperties; let first = first" class="adf-metadata-grouped-properties-container"> <div *ngFor="let group of groupedProperties; let first = first" class="adf-metadata-grouped-properties-container">
<mat-expansion-panel <mat-expansion-panel
[attr.data-automation-id]="'adf-metadata-group-' + group.title" [attr.data-automation-id]="'adf-metadata-group-' + group.title"
[expanded]="currentPanel.panelTitle === group.title && currentPanel.expanded" [expanded]="multi ? !displayDefaultProperties && first || group.expanded : !displayDefaultProperties && first || currentPanel.panelTitle === group.title && currentPanel.expanded"
(opened)="expandPanel(group.title)" (opened)="expandPanel(group.title); group.expanded = true"
(closed)="closePanel(group.title)" (closed)="closePanel(group.title); group.expanded = false"
class="adf-content-metadata-panel" class="adf-content-metadata-panel"
hideToggle> hideToggle>
<mat-expansion-panel-header <mat-expansion-panel-header

View File

@@ -831,6 +831,18 @@ describe('ContentMetadataComponent', () => {
it('should have displayDefaultProperties input param as true by default', () => { it('should have displayDefaultProperties input param as true by default', () => {
expect(component.displayDefaultProperties).toBe(true); expect(component.displayDefaultProperties).toBe(true);
}); });
it('should set default properties as active panel on displayDefaultProperties toggle', () => {
component.displayDefaultProperties = false;
component.currentPanel.panelTitle = 'test';
component.currentPanel.expanded = false;
component.ngOnChanges({ displayDefaultProperties: new SimpleChange(false, true, false) });
fixture.detectChanges();
expect(component.currentPanel.panelTitle).toBe(component.DefaultPanels.PROPERTIES);
expect(component.currentPanel.expanded).toBe(true);
});
}); });
describe('Display properties with aspect oriented config', () => { describe('Display properties with aspect oriented config', () => {

View File

@@ -247,6 +247,10 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
this.currentPanel.expanded = true; this.currentPanel.expanded = true;
} }
if (changes.displayDefaultProperties?.currentValue) {
this.expandPanel(this.DefaultPanels.PROPERTIES);
}
} }
ngOnDestroy() { ngOnDestroy() {