diff --git a/test/functional/apps/dashboard_elements/controls/replace_controls.ts b/test/functional/apps/dashboard_elements/controls/replace_controls.ts index 5d975bb1a9522..f6af399905077 100644 --- a/test/functional/apps/dashboard_elements/controls/replace_controls.ts +++ b/test/functional/apps/dashboard_elements/controls/replace_controls.ts @@ -11,15 +11,15 @@ import expect from '@kbn/expect'; import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL, - /** Because the time slider is temporarily disabled as of https://github.com/elastic/kibana/pull/130978, - ** I simply commented out the time slider tests for now :) **/ - // TIME_SLIDER_CONTROL, + TIME_SLIDER_CONTROL, } from '@kbn/controls-plugin/common'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); + const { dashboardControls, timePicker, common, dashboard } = getPageObjects([ 'dashboardControls', 'timePicker', @@ -46,16 +46,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const replaceWithRangeSlider = async (controlId: string) => { await dashboardControls.controlEditorSetType(RANGE_SLIDER_CONTROL); await changeFieldType('weightLbs'); - await dashboardControls.rangeSliderWaitForLoading(); - await dashboardControls.verifyControlType(controlId, 'range-slider-control'); + await retry.try(async () => { + await dashboardControls.rangeSliderWaitForLoading(); + await dashboardControls.verifyControlType(controlId, 'range-slider-control'); + }); }; - // const replaceWithTimeSlider = async (controlId: string) => { - // await dashboardControls.controlEditorSetType(TIME_SLIDER_CONTROL); - // await changeFieldType('@timestamp'); - // await testSubjects.waitForDeleted('timeSlider-loading-spinner'); - // await dashboardControls.verifyControlType(controlId, 'timeSlider'); - // }; + const replaceWithTimeSlider = async (controlId: string) => { + await dashboardControls.controlEditorSetType(TIME_SLIDER_CONTROL); + await changeFieldType('@timestamp'); + await testSubjects.waitForDeleted('timeSlider-loading-spinner'); + await dashboardControls.verifyControlType(controlId, 'timeSlider'); + }; describe('Replacing controls', async () => { let controlId: string; @@ -83,9 +85,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await replaceWithRangeSlider(controlId); }); - // it('with time slider', async () => { - // await replaceWithTimeSlider(controlId); - // }); + /** Because the time slider is temporarily disabled as of https://github.com/elastic/kibana/pull/130978, + ** I simply skipped all time slider tests for now :) **/ + it.skip('with time slider', async () => { + await replaceWithTimeSlider(controlId); + }); }); describe('Replace range slider', async () => { @@ -105,31 +109,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await replaceWithOptionsList(controlId); }); - // it('with time slider', async () => { - // await replaceWithTimeSlider(controlId); - // }); + it.skip('with time slider', async () => { + await replaceWithTimeSlider(controlId); + }); }); - // describe('Replace time slider', async () => { - // beforeEach(async () => { - // await dashboardControls.clearAllControls(); - // await dashboardControls.createControl({ - // controlType: TIME_SLIDER_CONTROL, - // dataViewTitle: 'animals-*', - // fieldName: '@timestamp', - // }); - // await testSubjects.waitForDeleted('timeSlider-loading-spinner'); - // controlId = (await dashboardControls.getAllControlIds())[0]; - // await dashboardControls.editExistingControl(controlId); - // }); - - // it('with options list', async () => { - // await replaceWithOptionsList(controlId); - // }); - - // it('with range slider', async () => { - // await replaceWithRangeSlider(controlId); - // }); - // }); + describe.skip('Replace time slider', async () => { + beforeEach(async () => { + await dashboardControls.clearAllControls(); + await dashboardControls.createControl({ + controlType: TIME_SLIDER_CONTROL, + dataViewTitle: 'animals-*', + fieldName: '@timestamp', + }); + await testSubjects.waitForDeleted('timeSlider-loading-spinner'); + controlId = (await dashboardControls.getAllControlIds())[0]; + await dashboardControls.editExistingControl(controlId); + }); + + it('with options list', async () => { + await replaceWithOptionsList(controlId); + }); + + it('with range slider', async () => { + await replaceWithRangeSlider(controlId); + }); + }); }); }