mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4298] Improve Info drawer e2e tests (#4532)
* [ADF-4298] Improve Info drawer e2e tests * [ADF-4298] Add new tab with single icon and update e2e tests
This commit is contained in:
committed by
Eugenio Romano
parent
2b4d748a66
commit
b60e9a7c6e
@@ -250,11 +250,21 @@
|
|||||||
|
|
||||||
<p class="toggle">
|
<p class="toggle">
|
||||||
<mat-slide-toggle
|
<mat-slide-toggle
|
||||||
id="adf-show-tab-with-icon"
|
id="adf-tab-with-icon"
|
||||||
[color]="'primary'"
|
[color]="'primary'"
|
||||||
(change)="toggleShowInfoDrawerTabIcon()"
|
(change)="toggleShowTabWithIcon()"
|
||||||
[checked]="showInfoDrawerTabWithIcon">
|
[checked]="showTabWithIcon">
|
||||||
Show info drawer tab con
|
Show tab with icon
|
||||||
|
</mat-slide-toggle>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="toggle">
|
||||||
|
<mat-slide-toggle
|
||||||
|
id="adf-icon-and-label-tab"
|
||||||
|
[color]="'primary'"
|
||||||
|
(change)="toggleShowTabWithIconAndLabel()"
|
||||||
|
[checked]="showTabWithIconAndLabel">
|
||||||
|
Show tab with icon and label
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -272,13 +282,19 @@
|
|||||||
|
|
||||||
</adf-info-drawer-tab>
|
</adf-info-drawer-tab>
|
||||||
|
|
||||||
<adf-info-drawer-tab
|
<adf-info-drawer-tab
|
||||||
*ngIf="showInfoDrawerTabWithIcon"
|
*ngIf="showTabWithIcon"
|
||||||
[label]="'Settings'"
|
[label]=""
|
||||||
[icon]="'comment'"
|
[icon]="'face'"
|
||||||
data-automation-id="adf-settings-tab">
|
data-automation-id="adf-settings-tab">
|
||||||
</adf-info-drawer-tab>
|
</adf-info-drawer-tab>
|
||||||
|
|
||||||
|
<adf-info-drawer-tab
|
||||||
|
*ngIf="showTabWithIconAndLabel"
|
||||||
|
[label]="'Comments'"
|
||||||
|
[icon]="'comment'"
|
||||||
|
data-automation-id="adf-settings-tab">
|
||||||
|
</adf-info-drawer-tab>
|
||||||
</adf-info-drawer>
|
</adf-info-drawer>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
@@ -53,7 +53,8 @@ export class FileViewComponent implements OnInit {
|
|||||||
showRightSidebar = false;
|
showRightSidebar = false;
|
||||||
customToolbar = false;
|
customToolbar = false;
|
||||||
isCommentEnabled = false;
|
isCommentEnabled = false;
|
||||||
showInfoDrawerTabWithIcon = false;
|
showTabWithIcon = false;
|
||||||
|
showTabWithIconAndLabel = false;
|
||||||
|
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@@ -146,8 +147,12 @@ export class FileViewComponent implements OnInit {
|
|||||||
this.allowLeftSidebar = !this.allowLeftSidebar;
|
this.allowLeftSidebar = !this.allowLeftSidebar;
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleShowInfoDrawerTabIcon() {
|
toggleShowTabWithIcon() {
|
||||||
this.showInfoDrawerTabWithIcon = !this.showInfoDrawerTabWithIcon;
|
this.showTabWithIcon = !this.showTabWithIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleShowTabWithIconAndLabel() {
|
||||||
|
this.showTabWithIconAndLabel = !this.showTabWithIconAndLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleCustomName() {
|
toggleCustomName() {
|
||||||
|
@@ -74,30 +74,36 @@ describe('Info Drawer', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C277251] Should display only the icon when the icon property is defined', () => {
|
afterAll(async (done) => {
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||||
|
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngFileUploaded.entry.id);
|
||||||
navigationBarPage.goToSite(site);
|
done();
|
||||||
contentServicesPage.checkAcsContainer();
|
|
||||||
|
|
||||||
viewerPage.viewFile(pngFileUploaded.entry.name);
|
|
||||||
viewerPage.clickLeftSidebarButton();
|
|
||||||
viewerPage.enableShowTabWithIcon();
|
|
||||||
viewerPage.checkTabHasIcon(1);
|
|
||||||
expect(viewerPage.getTabLabelById(1)).not.toBe('COMMENT');
|
|
||||||
expect(viewerPage.getTabIconById(1)).toBe('comment');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C277252] Should display the label when the icon property is not defined', () => {
|
beforeEach(() => {
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
navigationBarPage.goToSite(site);
|
navigationBarPage.goToSite(site);
|
||||||
contentServicesPage.checkAcsContainer();
|
contentServicesPage.checkAcsContainer();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C277251] Should display the icon when the icon property is defined', () => {
|
||||||
viewerPage.viewFile(pngFileUploaded.entry.name);
|
viewerPage.viewFile(pngFileUploaded.entry.name);
|
||||||
viewerPage.clickLeftSidebarButton();
|
viewerPage.clickLeftSidebarButton();
|
||||||
viewerPage.enableShowTabWithIcon();
|
viewerPage.enableShowTabWithIcon();
|
||||||
|
viewerPage.enableShowTabWithIconAndLabel();
|
||||||
viewerPage.checkTabHasNoIcon(0);
|
viewerPage.checkTabHasNoIcon(0);
|
||||||
|
expect(viewerPage.getTabIconById(1)).toBe('face');
|
||||||
|
expect(viewerPage.getTabIconById(2)).toBe('comment');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C277252] Should display the label when the label property is defined', () => {
|
||||||
|
viewerPage.viewFile(pngFileUploaded.entry.name);
|
||||||
|
viewerPage.clickLeftSidebarButton();
|
||||||
|
viewerPage.enableShowTabWithIcon();
|
||||||
|
viewerPage.enableShowTabWithIconAndLabel();
|
||||||
expect(viewerPage.getTabLabelById(0)).toBe('SETTINGS');
|
expect(viewerPage.getTabLabelById(0)).toBe('SETTINGS');
|
||||||
|
viewerPage.checkTabHasNoLabel(1);
|
||||||
|
expect(viewerPage.getTabLabelById(2)).toBe('COMMENTS');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -98,7 +98,8 @@ export class ViewerPage {
|
|||||||
codeViewer = element(by.id('adf-monaco-file-editor'));
|
codeViewer = element(by.id('adf-monaco-file-editor'));
|
||||||
moveRightChevron = element(by.css('.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron'));
|
moveRightChevron = element(by.css('.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron'));
|
||||||
|
|
||||||
showTabWithIconSwitch = element(by.id('adf-show-tab-with-icon'));
|
showTabWithIconSwitch = element(by.id('adf-tab-with-icon'));
|
||||||
|
showTabWithIconAndLabelSwitch = element(by.id('adf-icon-and-label-tab'));
|
||||||
|
|
||||||
checkCodeViewerIsDisplayed() {
|
checkCodeViewerIsDisplayed() {
|
||||||
return BrowserVisibility.waitUntilElementIsVisible(this.codeViewer);
|
return BrowserVisibility.waitUntilElementIsVisible(this.codeViewer);
|
||||||
@@ -513,6 +514,14 @@ export class ViewerPage {
|
|||||||
this.formControllersPage.enableToggle(this.showTabWithIconSwitch);
|
this.formControllersPage.enableToggle(this.showTabWithIconSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disableShowTabWithIconAndLabel() {
|
||||||
|
this.formControllersPage.disableToggle(this.showTabWithIconAndLabelSwitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
enableShowTabWithIconAndLabel() {
|
||||||
|
this.formControllersPage.enableToggle(this.showTabWithIconAndLabelSwitch);
|
||||||
|
}
|
||||||
|
|
||||||
checkDownloadButtonDisplayed() {
|
checkDownloadButtonDisplayed() {
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.downloadButton);
|
BrowserVisibility.waitUntilElementIsVisible(this.downloadButton);
|
||||||
return this;
|
return this;
|
||||||
@@ -649,8 +658,14 @@ export class ViewerPage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkTabHasNoLabel(index: number) {
|
||||||
|
const tab = element(by.css(`div[id="mat-tab-label-1-${index}"] div[class="mat-tab-label-content"] span`));
|
||||||
|
BrowserVisibility.waitUntilElementIsNotVisible(tab);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
getTabLabelById(index: number) {
|
getTabLabelById(index: number) {
|
||||||
const tab = element(by.css(`div[id="mat-tab-label-1-${index}"] div[class="mat-tab-label-content"]`));
|
const tab = element(by.css(`div[id="mat-tab-label-1-${index}"] div[class="mat-tab-label-content"] span`));
|
||||||
BrowserVisibility.waitUntilElementIsVisible(tab);
|
BrowserVisibility.waitUntilElementIsVisible(tab);
|
||||||
return tab.getText();
|
return tab.getText();
|
||||||
}
|
}
|
||||||
|
@@ -510,7 +510,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.adf-datatable-body {
|
.adf-datatable-body {
|
||||||
margin-top: 56px;
|
margin-top: 57px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user