mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACA-2619][ACA-2616] a11y fixes for Share Link dialog (#5454)
* chore: proper disabling of fields for a11y * component fixes * update tests * update tests * fix aria labels * aria-label fixes * update layout * update e2e tests Co-authored-by: Denys Vuika <denys.vuika@gmail.com> Co-authored-by: Cilibiu Bogdan <bogdan.cilibiu@ness.com>
This commit is contained in:
co-authored by
Denys Vuika
Cilibiu Bogdan
parent
57c15a7542
commit
5bcd326891
@@ -121,6 +121,7 @@ describe('Share file', () => {
|
||||
it('[C286578] Should disable today option in expiration day calendar', async () => {
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.clickExpireToggle();
|
||||
await shareDialog.clickDateTimePickerButton();
|
||||
await shareDialog.calendarTodayDayIsDisabled();
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
@@ -129,6 +130,7 @@ describe('Share file', () => {
|
||||
it('[C286548] Should be possible to set expiry date for link', async () => {
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.clickExpireToggle();
|
||||
await shareDialog.setDefaultDay();
|
||||
await shareDialog.setDefaultHour();
|
||||
await shareDialog.setDefaultMinutes();
|
||||
@@ -142,18 +144,11 @@ describe('Share file', () => {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C286578] Should disable today option in expiration day calendar', async () => {
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.clickDateTimePickerButton();
|
||||
await shareDialog.calendarTodayDayIsDisabled();
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C310329] Should be possible to set expiry date only for link', async () => {
|
||||
await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date'));
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.clickExpireToggle();
|
||||
await shareDialog.setDefaultDay();
|
||||
await shareDialog.dateTimePickerDialogIsClosed();
|
||||
const value = await shareDialog.getExpirationDate();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import moment = require('moment');
|
||||
|
||||
@@ -23,17 +23,18 @@ export class ShareDialogPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
dateTimePickerPage = new DateTimePickerPage();
|
||||
shareDialog: ElementFinder = element(by.css('adf-share-dialog'));
|
||||
dialogTitle: ElementFinder = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
||||
shareToggle: ElementFinder = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
shareToggleChecked: ElementFinder = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
||||
shareLink: ElementFinder = element(by.css('[data-automation-id="adf-share-link"]'));
|
||||
closeButton: ElementFinder = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
||||
copySharedLinkButton: ElementFinder = element(by.css('.adf-input-action'));
|
||||
expirationDateInput: ElementFinder = element(by.css('input[formcontrolname="time"]'));
|
||||
confirmationDialog: ElementFinder = element(by.css('adf-confirm-dialog'));
|
||||
confirmationCancelButton: ElementFinder = element(by.id('adf-confirm-cancel'));
|
||||
confirmationRemoveButton: ElementFinder = element(by.id('adf-confirm-accept'));
|
||||
shareDialog = element(by.css('adf-share-dialog'));
|
||||
dialogTitle = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
expireToggle = element(by.css(`[data-automation-id="adf-expire-toggle"] label`));
|
||||
shareToggleChecked = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
||||
shareLink = element(by.css('[data-automation-id="adf-share-link"]'));
|
||||
closeButton = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
||||
copySharedLinkButton = element(by.css('.adf-input-action'));
|
||||
expirationDateInput = element(by.css('input[formcontrolname="time"]'));
|
||||
confirmationDialog = element(by.css('adf-confirm-dialog'));
|
||||
confirmationCancelButton = element(by.id('adf-confirm-cancel'));
|
||||
confirmationRemoveButton = element(by.id('adf-confirm-accept'));
|
||||
|
||||
async checkDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||
@@ -43,6 +44,10 @@ export class ShareDialogPage {
|
||||
await this.togglePage.enableToggle(this.shareToggle);
|
||||
}
|
||||
|
||||
async clickExpireToggle() {
|
||||
await this.togglePage.enableToggle(this.expireToggle);
|
||||
}
|
||||
|
||||
async clickConfirmationDialogCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationCancelButton);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user