[Discover] Unskip ES|QL switch modal tests and fix other flaky tests in the same suite (#200923)

- Closes https://github.com/elastic/kibana/issues/189636
- Closes https://github.com/elastic/kibana/issues/200805
- Closes https://github.com/elastic/kibana/issues/195479

### 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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
This commit is contained in:
Julia Rechkunova 2024-11-21 11:51:12 +01:00 committed by GitHub
parent 55a5b9f865
commit 65cb53c28b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 41 additions and 14 deletions

View file

@ -142,9 +142,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should perform test query correctly', async function () {
await timePicker.setDefaultAbsoluteRange();
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
@ -158,7 +162,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render when switching to a time range with no data, then back to a time range with data', async () => {
await discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
@ -181,8 +188,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should query an index pattern that doesnt translate to a dataview correctly', async function () {
await discover.selectTextBaseLang();
const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
@ -296,6 +305,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await discover.saveSearch('esql_test2');
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');

View file

@ -204,10 +204,9 @@ export class UnifiedFieldListPageObject extends FtrService {
if (!isActive) {
// expand the field to show the "Visualize" button
await field.click();
await this.clickFieldListItem(fieldName);
}
await this.waitUntilFieldPopoverIsOpen();
const visualizeButtonTestSubject = `fieldVisualize-${fieldName}`;
// wrap visualize button click in retry to ensure button is clicked and retry if button click is not registered
await this.retry.try(async () => {

View file

@ -51,14 +51,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('discover field visualize button', () => {
before(async () => {
await kibanaServer.uiSettings.replace(defaultSettings);
});
beforeEach(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
});
beforeEach(async () => {
await common.navigateToApp('discover');
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await setDiscoverTimeRange();
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
});
after(async () => {
@ -73,7 +78,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await unifiedFieldList.expectFieldListItemVisualize('bytes');
});
it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
it('visualizes field to Lens and loads fields to the dimension editor', async () => {
await unifiedFieldList.findFieldByName('bytes');
await unifiedFieldList.clickFieldListItemVisualize('bytes');
await header.waitUntilLoadingHasFinished();

View file

@ -141,8 +141,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should perform test query correctly', async function () {
await PageObjects.timePicker.setDefaultAbsoluteRange();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
@ -157,7 +161,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render when switching to a time range with no data, then back to a time range with data', async () => {
await PageObjects.discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await PageObjects.header.waitUntilLoadingHasFinished();
@ -183,7 +190,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
const testQuery = `from logstash* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await PageObjects.header.waitUntilLoadingHasFinished();
@ -256,8 +263,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});
// FLAKY: https://github.com/elastic/kibana/issues/189636
describe.skip('switch modal', () => {
describe('switch modal', () => {
beforeEach(async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
@ -302,6 +308,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.saveSearch('esql_test2');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');

View file

@ -48,7 +48,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
beforeEach(async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await setDiscoverTimeRange();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
});
after(async () => {
@ -64,7 +68,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.unifiedFieldList.expectFieldListItemVisualize('bytes');
});
it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
it('visualizes field to Lens and loads fields to the dimension editor', async () => {
await PageObjects.unifiedFieldList.findFieldByName('bytes');
await PageObjects.unifiedFieldList.clickFieldListItemVisualize('bytes');
await PageObjects.header.waitUntilLoadingHasFinished();