diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json index 94ba967406..6dfb46e67f 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -18,8 +18,5 @@ "C279219": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985", "C279221": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985", "C279220": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985", - "C325006": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985", - "C286327": "https://alfresco.atlassian.net/browse/PRODSEC-6575", - "C286332": "https://alfresco.atlassian.net/browse/PRODSEC-6575", - "C286333": "https://alfresco.atlassian.net/browse/PRODSEC-6575" + "C325006": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985" } diff --git a/e2e/protractor/suites/actions/share/share-file.test.ts b/e2e/protractor/suites/actions/share/share-file.test.ts index 79324f5710..ea6a4dd41c 100755 --- a/e2e/protractor/suites/actions/share/share-file.test.ts +++ b/e2e/protractor/suites/actions/share/share-file.test.ts @@ -146,12 +146,12 @@ describe('Share a file', () => { await shareDialog.waitForDialogToOpen(); expect(await shareDialog.getDialogTitle()).toEqual(`Share ${file3}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.labels.get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getInfoText()).toEqual('Share Link'); + expect(await shareDialog.labels.get(0).getText()).toEqual(`Share ${file3}`); expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); expect(await shareDialog.isUrlReadOnly()).toBe(true, 'url is not readonly'); expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.labels.get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.labels.get(1).getText()).toEqual('Link Expiry Date'); expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); }); @@ -197,14 +197,10 @@ describe('Share a file', () => { await BrowserActions.click(shareDialog.datetimePickerButton); expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); - const date = await shareDialog.dateTimePicker.pickDateTime(); + await shareDialog.dateTimePicker.pickDateTime(); await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); - const setDate = `${date}`.replace(',', ''); const inputDate = await shareDialog.getExpireDate(); - - expect(new Date(inputDate)).toEqual(new Date(setDate)); - const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); @@ -231,7 +227,7 @@ describe('Share a file', () => { await BrowserActions.click(shareDialog.expireToggle); expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + expect(await shareDialog.expireInput.isDisplayed()).toBe(false, 'Expire date input is not empty'); await shareDialog.clickClose(); expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe('', `${file7} link still has expiration`); diff --git a/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts b/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts index 339e5df5ac..5858604f76 100755 --- a/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts +++ b/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts @@ -28,18 +28,18 @@ import { isPresentAndDisplayed, waitForStaleness } from '../../utilities/utils'; import { BrowserActions } from '@alfresco/adf-testing'; export class DateTimePicker extends Component { - calendar = this.byCss('.mat-datetimepicker-popup', browser); + calendar = this.byCss('.mat-datepicker-popup', browser); headerTime = this.byCss('.mat-datetimepicker-calendar-header-time'); headerDate = this.byCss('.mat-datetimepicker-calendar-header-date'); headerYear = this.byCss('.mat-datetimepicker-calendar-header-year'); - dayPicker = this.byCss('mat-datetimepicker-month-view'); + dayPicker = this.byCss('mat-month-view'); hourPicker = this.byCss('.mat-datetimepicker-clock-hours'); minutePicker = this.byCss('.mat-datetimepicker-clock-minutes'); - nextMonthBtn = this.byCss('.mat-datetimepicker-calendar-next-button'); - rootElemLocator = by.css('.mat-datetimepicker-popup'); + nextMonthBtn = this.byCss('.mat-calendar-next-button'); + rootElemLocator = by.css('.mat-datepicker-popup'); constructor(ancestor?: string) { - super('.mat-datetimepicker-popup', ancestor); + super('.mat-datepicker-popup', ancestor); } async waitForDateTimePickerToClose(): Promise { @@ -52,7 +52,7 @@ export class DateTimePicker extends Component { return isPresentAndDisplayed(element); } - async pickDateTime(): Promise { + async pickDateTime(): Promise { const today = new Date() const nextAvailableDay = new Date(); nextAvailableDay.setDate(today.getDate() + 2); @@ -60,22 +60,10 @@ export class DateTimePicker extends Component { await BrowserActions.click(this.nextMonthBtn); } await this.selectDay(nextAvailableDay.getDate()); - await this.selectHour(nextAvailableDay.getHours()); - - // getting data from header here since date picker will close after selecting minutes - const date = await this.headerDate.getText(); - const year = await this.headerYear.getText(); - let time = await this.headerTime.getText(); - const parts = time.split(':'); - parts[1] = '00'; - time = parts.join(':'); - - await this.selectMinute(0); - return `${date} ${year} ${time}`; } async selectDay(day: number): Promise { - const firstActiveDay = '.mat-datetimepicker-calendar-body-cell-content'; + const firstActiveDay = '.mat-calendar-body-cell-content'; const firstActiveDayElem = this.dayPicker.element(by.cssContainingText(firstActiveDay, `${day}`)); await BrowserActions.click(firstActiveDayElem); } diff --git a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts index 140622cae4..23e0c7c8ee 100755 --- a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts +++ b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts @@ -39,7 +39,7 @@ export class ShareDialog extends GenericDialog { urlAction = this.childElement(by.css('.adf-input-action')); expireToggle = this.childElement(by.css(`[data-automation-id='adf-expire-toggle']`)); expireInput = this.childElement(by.css('input[formcontrolname="time"]')); - datetimePickerButton = this.childElement(by.css('.mat-datetimepicker-toggle')); + datetimePickerButton = this.childElement(by.css('.mat-datepicker-toggle')); closeButton = this.childElement(by.css(`[data-automation-id='adf-share-dialog-close']`));