mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
E2E test default properties (#3671)
This commit is contained in:
committed by
Eugenio Romano
parent
dc797feacb
commit
7172d5b631
@@ -23,10 +23,6 @@
|
|||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-menu {
|
|
||||||
padding-top: 55px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.adf-app-layout {
|
.adf-app-layout {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
<p class="toggle">
|
<p class="toggle">
|
||||||
<mat-slide-toggle
|
<mat-slide-toggle
|
||||||
id="adf-toggle-display-properties"
|
id="adf-metadata-default-properties"
|
||||||
[color]="'primary'"
|
[color]="'primary'"
|
||||||
(change)="toggleDisplayProperties()"
|
(change)="toggleDisplayProperties()"
|
||||||
[checked]="displayDefaultProperties">
|
[checked]="displayDefaultProperties">
|
||||||
Display Properties
|
Display Default Properties
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@@ -151,4 +151,35 @@ describe('CardView Component - properties', () => {
|
|||||||
metadataViewPage.chekMetadatGroupIsExpand('properties');
|
metadataViewPage.chekMetadatGroupIsExpand('properties');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C280559] Should show/hide the default metadata properties when displayDefaultProperties is true/false', () => {
|
||||||
|
viewerPage.viewFile(pngFileModel.name);
|
||||||
|
viewerPage.clickInfoButton();
|
||||||
|
viewerPage.checkInfoSideBarIsDisplayed();
|
||||||
|
metadataViewPage.clickOnPropertiesTab();
|
||||||
|
|
||||||
|
metadataViewPage.disabledDefaultProperties();
|
||||||
|
|
||||||
|
metadataViewPage.checkkMetadatGroupIsNotPresent('properties');
|
||||||
|
metadataViewPage.checkkMetadatGroupIsPresent('EXIF');
|
||||||
|
metadataViewPage.chekMetadatGroupIsExpand('EXIF');
|
||||||
|
|
||||||
|
metadataViewPage.enabledDefaultProperties();
|
||||||
|
|
||||||
|
metadataViewPage.checkkMetadatGroupIsPresent('properties');
|
||||||
|
metadataViewPage.chekMetadatGroupIsExpand('properties');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280560] Should show/hide the more properties button when displayDefaultProperties is true/false', () => {
|
||||||
|
viewerPage.viewFile(pngFileModel.name);
|
||||||
|
viewerPage.clickInfoButton();
|
||||||
|
viewerPage.checkInfoSideBarIsDisplayed();
|
||||||
|
metadataViewPage.clickOnPropertiesTab();
|
||||||
|
|
||||||
|
metadataViewPage.informationButtonIsDisplayed();
|
||||||
|
|
||||||
|
metadataViewPage.disabledDefaultProperties();
|
||||||
|
|
||||||
|
metadataViewPage.informationButtonIsNotDisplayed();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -41,6 +41,7 @@ var MetadataViewPage = function () {
|
|||||||
var readonlySwitch = element(by.id("adf-metadata-readonly"));
|
var readonlySwitch = element(by.id("adf-metadata-readonly"));
|
||||||
var multiSwitch = element(by.id("adf-metadata-multi"));
|
var multiSwitch = element(by.id("adf-metadata-multi"));
|
||||||
var presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
var presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||||
|
var defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||||
|
|
||||||
this.getTitle = function () {
|
this.getTitle = function () {
|
||||||
Util.waitUntilElementIsVisible(title);
|
Util.waitUntilElementIsVisible(title);
|
||||||
@@ -120,6 +121,10 @@ var MetadataViewPage = function () {
|
|||||||
Util.waitUntilElementIsClickable(informationButton);
|
Util.waitUntilElementIsClickable(informationButton);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.informationButtonIsNotDisplayed = function () {
|
||||||
|
Util.waitUntilElementIsNotVisible(informationButton);
|
||||||
|
};
|
||||||
|
|
||||||
this.clickOnInformationButton = function () {
|
this.clickOnInformationButton = function () {
|
||||||
this.informationButtonIsDisplayed();
|
this.informationButtonIsDisplayed();
|
||||||
informationButton.click();
|
informationButton.click();
|
||||||
@@ -379,6 +384,32 @@ var MetadataViewPage = function () {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* disables preset
|
||||||
|
*/
|
||||||
|
this.disabledDefaultProperties = function () {
|
||||||
|
Util.waitUntilElementIsVisible(defaultPropertiesSwitch);
|
||||||
|
defaultPropertiesSwitch.getAttribute('class').then(function (check) {
|
||||||
|
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||||
|
defaultPropertiesSwitch.click();
|
||||||
|
expect(defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enables preset
|
||||||
|
*/
|
||||||
|
this.enabledDefaultProperties = function () {
|
||||||
|
Util.waitUntilElementIsVisible(defaultPropertiesSwitch);
|
||||||
|
defaultPropertiesSwitch.getAttribute('class').then(function (check) {
|
||||||
|
if (check === 'mat-slide-toggle mat-primary') {
|
||||||
|
defaultPropertiesSwitch.click();
|
||||||
|
expect(defaultPropertiesSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
this.checkPopertyIsVisible = function (propertyName, type) {
|
this.checkPopertyIsVisible = function (propertyName, type) {
|
||||||
var property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
var property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||||
Util.waitUntilElementIsVisible(property);
|
Util.waitUntilElementIsVisible(property);
|
||||||
|
Reference in New Issue
Block a user