[Controls] Fix flaky time slider test (#169553)

Closes https://github.com/elastic/kibana/issues/169404

## Summary

The `Pin start` tooltip has a tendency to get in the way of the
`timeSlider-nextTimeWindow` button:


![image](dc4855ab-6c59-4003-83f1-de778f97b0f8)

To prevent this, I've made it so that the popover is closed **before**
the `next` button is pressed.


### [Flaky Test
Runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3681)


![image](d339d256-dced-4bbd-b287-e04cd1268835)

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Hannah Mudge 2023-10-23 13:57:51 -06:00 committed by GitHub
parent 9d139f6192
commit eea3b1b8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

View file

@ -106,7 +106,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const valueAfter = await dashboardControls.getTimeSliceFromTimeSlider();
expect(valueBefore).to.not.equal(valueAfter);
await dashboardControls.closeTimeSliderPopover();
await dashboard.clickCancelOutOfEditMode();
const valueNow = await dashboardControls.getTimeSliceFromTimeSlider();
expect(valueNow).to.equal(valueBefore);

View file

@ -721,6 +721,7 @@ export class DashboardPageControls extends FtrService {
// Time slider functions
public async gotoNextTimeSlice() {
await this.closeTimeSliderPopover(); // prevents the pin tooltip from getting in the way
await this.testSubjects.click('timeSlider-nextTimeWindow');
}