[ES|QL] Fixes the field controls FT flakiness (#216747)

## Summary

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

I also stabilized the values FT as it was also flaky 🤞 

### Checklist

- [ ] [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
This commit is contained in:
Stratoula Kalafateli 2025-04-02 15:31:48 +02:00 committed by GitHub
parent 03f4b4892d
commit cf289cbd1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -46,6 +46,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardAddPanel.clickEditorMenuButton();
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
await dashboard.waitForRenderComplete();
await elasticChart.setNewChartUiDebugFlag(true);
await retry.try(async () => {
const panelCount = await dashboard.getPanelCount();
@ -87,13 +88,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('should update the Lens chart accordingly', async () => {
await elasticChart.setNewChartUiDebugFlag(true);
// change the control value
await comboBox.set('esqlControlValuesDropdown', 'clientip');
await dashboard.waitForRenderComplete();
const data = await elasticChart.getChartDebugData('xyVisChart');
expect(data?.axes?.x[0]?.title).to.be('clientip');
await retry.try(async () => {
const data = await elasticChart.getChartDebugData('xyVisChart');
expect(data?.axes?.x[0]?.title).to.be('clientip');
});
});
});
}

View file

@ -14,11 +14,12 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const { dashboard, timePicker, common, dashboardControls } = getPageObjects([
const { dashboard, timePicker, common, dashboardControls, header } = getPageObjects([
'dashboard',
'timePicker',
'common',
'dashboardControls',
'header',
]);
const find = getService('find');
const testSubjects = getService('testSubjects');
@ -26,6 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardAddPanel = getService('dashboardAddPanel');
const browser = getService('browser');
const comboBox = getService('comboBox');
const dashboardPanelActions = getService('dashboardPanelActions');
describe('dashboard - add a value type ES|QL control', function () {
before(async () => {
@ -86,9 +88,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// Check Lens editor has been updated accordingly
const editorValue = await esql.getEsqlEditorQuery();
expect(editorValue).to.contain('FROM logstash-* | WHERE geo.dest == ?geo_dest');
await testSubjects.click('applyFlyoutButton');
await dashboard.waitForRenderComplete();
});
it('should update the Lens chart accordingly', async () => {
// now edit the panel and click on Cancel
await dashboardPanelActions.clickInlineEdit();
// change the table to keep only the column with the control
await esql.setEsqlEditorQuery(
'FROM logstash-* | WHERE geo.dest == ?geo_dest | KEEP geo.dest'
@ -96,10 +103,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// run the query
await testSubjects.click('ESQLEditor-run-query-button');
await dashboard.waitForRenderComplete();
await header.waitUntilLoadingHasFinished();
// save the changes
await testSubjects.click('applyFlyoutButton');
await dashboard.waitForRenderComplete();
await header.waitUntilLoadingHasFinished();
// change the control value
await comboBox.set('esqlControlValuesDropdown', 'AO');
await dashboard.waitForRenderComplete();