mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[no-issue] fix share dialog test for scenario of last day of the month (#3937)
* fix share dialog test for scenario of last day of the month * fix today and tomorrow * remove fit * fix spec share file * use moment to calculate tomorrow
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import Util = require('../../../util/util');
|
||||
import moment = require('moment');
|
||||
import { FormControllersPage } from '../material/formControllersPage';
|
||||
|
||||
export class ShareDialog {
|
||||
@@ -110,17 +111,17 @@ export class ShareDialog {
|
||||
this.timeDatePickerButton.click();
|
||||
}
|
||||
|
||||
async calendarTodayDayIsDisabled() {
|
||||
const today = await this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
|
||||
calendarTodayDayIsDisabled() {
|
||||
const today = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
|
||||
Util.waitUntilElementIsPresent(element(by.cssContainingText('.mat-datetimepicker-calendar-body-disabled', today)));
|
||||
}
|
||||
|
||||
async setDefaultDay() {
|
||||
setDefaultDay() {
|
||||
const selector = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
|
||||
Util.waitUntilElementIsVisible(this.dayPicker);
|
||||
const today = await this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
|
||||
const tomorrow = (parseInt(today, 10) + 1).toString();
|
||||
this.dayPicker.element(by.cssContainingText(selector, tomorrow )).click();
|
||||
const tomorrow = moment().add(1, 'day').date();
|
||||
let tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).getDate().toString();
|
||||
this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click();
|
||||
}
|
||||
|
||||
setDefaultHour() {
|
||||
|
Reference in New Issue
Block a user