mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
e2e fix tomorrow date (#770)
This commit is contained in:
committed by
Denys Vuika
parent
b5cf1bf18d
commit
ad111cb712
@@ -26,6 +26,7 @@
|
|||||||
import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
|
import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
|
||||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||||
import { Component } from '../component';
|
import { Component } from '../component';
|
||||||
|
import moment = require('moment');
|
||||||
|
|
||||||
export class DateTimePicker extends Component {
|
export class DateTimePicker extends Component {
|
||||||
private static selectors = {
|
private static selectors = {
|
||||||
@@ -72,11 +73,12 @@ export class DateTimePicker extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setDefaultDay() {
|
async setDefaultDay() {
|
||||||
const today = await this.dayPicker.element(by.css(DateTimePicker.selectors.today)).getText();
|
const today = moment();
|
||||||
const tomorrow = (parseInt(today, 10) + 1).toString();
|
const tomorrow = today.add(1, 'day');
|
||||||
|
const dayOfTomorrow = tomorrow.date();
|
||||||
const date = await this.getDate();
|
const date = await this.getDate();
|
||||||
const year = await this.getYear();
|
const year = await this.getYear();
|
||||||
const elem = this.dayPicker.element(by.cssContainingText(DateTimePicker.selectors.firstActiveDay, tomorrow));
|
const elem = this.dayPicker.element(by.cssContainingText(DateTimePicker.selectors.firstActiveDay, `${dayOfTomorrow}`));
|
||||||
await elem.click();
|
await elem.click();
|
||||||
return `${date} ${year}`;
|
return `${date} ${year}`;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user