Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3702547
quick check of current URL to skip timepicker
Nov 28, 2022
3a05844
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Nov 28, 2022
84a0bf6
changed setAbsoluteTime to a wrapper that checks URL
Nov 29, 2022
1b69342
resolve merge
Nov 29, 2022
989a21d
Merge branch 'main' of github.com:elastic/kibana into timepickerCheck…
Nov 29, 2022
f90053c
Merge branch 'main' into timepickerChecksUrl
Nov 29, 2022
17ca23e
Merge branch 'main' into timepickerChecksUrl
Nov 29, 2022
d3a2a7c
Merge branch 'main' into timepickerChecksUrl
Nov 30, 2022
bb010e5
add force=false default param to setAbsoluteTime
Nov 30, 2022
d7dbdde
Merge branch 'timepickerChecksUrl' of github.com:LeeDr/kibana into ti…
Nov 30, 2022
15a1d92
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 30, 2022
d535634
fix conditional branch, decoodeURL
Nov 30, 2022
7465da6
fix conditional branch, decoodeURL
Nov 30, 2022
37c2990
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 30, 2022
cb1b50f
Merge branch 'main' into timepickerChecksUrl
Nov 30, 2022
c3375fc
Merge branch 'main' into timepickerChecksUrl
Dec 1, 2022
bee5c67
Merge branch 'main' into timepickerChecksUrl
dmlemeshko Dec 2, 2022
4f4e096
Merge branch 'main' into timepickerChecksUrl
dmlemeshko Dec 2, 2022
a681d41
revert changes in area chart tests
dmlemeshko Dec 4, 2022
61056f4
Merge branch 'main' into timepickerChecksUrl
dmlemeshko Dec 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion test/functional/page_objects/time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,21 @@ export class TimePickerPageObject extends FtrService {
/**
* @param {String} fromTime MMM D, YYYY @ HH:mm:ss.SSS
* @param {String} toTime MMM D, YYYY @ HH:mm:ss.SSS
* @param {Boolean} force time picker force update, default is false
*/
public async setAbsoluteRange(fromTime: string, toTime: string) {
public async setAbsoluteRange(fromTime: string, toTime: string, force = false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances does it make sense to force?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off the top of my head, anytime flakiness is encountered (timepicker can be notorious sometimes).
This pr is a pr from a former elastic employee (our boss) and we did discuss at some length.
Further, there is some use of force flag within this pr.

@dmlemeshko may have more to weigh in on this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewctate , it is a good question. For some reason Lee picked area chart, maybe he was doing some testing.
You might know more about this test, and if there is no good reason re-resetting the time picker with already the same range, I can push an update and remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmlemeshko I agree with Andrew, this test was not flaky. I might miss something here but I would propose to remove it!

if (!force) {
const currentUrl = decodeURI(await this.browser.getCurrentUrl());
const DEFAULT_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS';
const startMoment = moment.utc(fromTime, DEFAULT_DATE_FORMAT).toISOString();
const endMoment = moment.utc(toTime, DEFAULT_DATE_FORMAT).toISOString();
if (currentUrl.includes(`time:(from:'${startMoment}',to:'${endMoment}'`)) {
this.log.debug(
`We already have the desired start (${fromTime}) and end (${toTime}) in the URL, returning from setAbsoluteRange`
);
return;
}
}
this.log.debug(`Setting absolute range to ${fromTime} to ${toTime}`);
await this.showStartEndTimes();
let panel!: WebElementWrapper;
Expand Down