From e2c23734c52c61619c04b0dfe269bef4755c0252 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 18 Sep 2024 07:53:08 +0300 Subject: [PATCH 1/4] Fix flaky tests --- test/functional/apps/console/_autocomplete.ts | 10 ++++------ test/functional/apps/console/_comments.ts | 3 +-- test/functional/apps/console/_console.ts | 7 +++---- .../apps/console/_misc_console_behavior.ts | 13 +++++++++---- test/functional/apps/console/_variables.ts | 8 +++++--- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/test/functional/apps/console/_autocomplete.ts b/test/functional/apps/console/_autocomplete.ts index 1123c93cab49c..64db13fa67ec2 100644 --- a/test/functional/apps/console/_autocomplete.ts +++ b/test/functional/apps/console/_autocomplete.ts @@ -62,8 +62,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(PageObjects.console.isAutocompleteVisible()).to.be.eql(true); }); - // FLAKY: https://github.com/elastic/kibana/issues/186501 - describe.skip('Autocomplete behavior', () => { + describe('Autocomplete behavior', () => { beforeEach(async () => { await PageObjects.console.clearEditorText(); }); @@ -86,11 +85,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.isAutocompleteVisible()).to.be.eql(true); for (const [i, method] of methods.entries()) { - expect(await PageObjects.console.getAutocompleteSuggestion(i)).to.be.eql(method); + expect(await PageObjects.console.getAutocompleteSuggestion(i)).to.contain(method); } await PageObjects.console.pressEscape(); - await PageObjects.console.clearEditorText(); + await PageObjects.console.clickClearInput(); } }); @@ -354,8 +353,7 @@ GET _search }); }); - // FLAKY: https://github.com/elastic/kibana/issues/186935 - describe.skip('index fields autocomplete', () => { + describe('index fields autocomplete', () => { const indexName = `index_field_test-${Date.now()}-${Math.random()}`; before(async () => { diff --git a/test/functional/apps/console/_comments.ts b/test/functional/apps/console/_comments.ts index 0e004151d0149..abff76b20c484 100644 --- a/test/functional/apps/console/_comments.ts +++ b/test/functional/apps/console/_comments.ts @@ -15,8 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const log = getService('log'); const PageObjects = getPageObjects(['common', 'console', 'header']); - // flaky - describe.skip('console app', function testComments() { + describe('console app', function testComments() { this.tags('includeFirefox'); before(async () => { log.debug('navigateTo console'); diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index ffba2a7ac41c4..c1283843f75e4 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -53,8 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.isOutputPanelEmptyStateVisible()).to.be(false); }); - // the resizer doesn't work the same as in ace https://github.com/elastic/kibana/issues/184352 - it.skip('should resize the editor', async () => { + it('should resize the editor', async () => { const editor = await PageObjects.console.getEditor(); await browser.setWindowSize(1300, 1100); const initialSize = await editor.getSize(); @@ -149,7 +148,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.console.clearEditorText(); }); it('it should send successful request to Kibana API', async () => { - const expectedResponseContains = 'default space'; + const expectedResponseContains = '"name": "Default"'; await PageObjects.console.enterText('GET kbn:/api/spaces/space'); await PageObjects.console.clickPlay(); await retry.try(async () => { @@ -161,7 +160,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Status badge is not yet implented in phase 2 - describe.skip('with query params', () => { + describe('with query params', () => { it('should issue a successful request', async () => { await PageObjects.console.clearEditorText(); await PageObjects.console.enterText('GET _cat/aliases?format=json&v=true&pretty=true'); diff --git a/test/functional/apps/console/_misc_console_behavior.ts b/test/functional/apps/console/_misc_console_behavior.ts index c0f4ffdd0654a..3d1e71432e73a 100644 --- a/test/functional/apps/console/_misc_console_behavior.ts +++ b/test/functional/apps/console/_misc_console_behavior.ts @@ -25,6 +25,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('console'); // Ensure that the text area can be interacted with await PageObjects.console.skipTourIfExists(); + + await PageObjects.console.openConfig(); + await PageObjects.console.toggleKeyboardShortcuts(true); + await PageObjects.console.openConsole(); }); beforeEach(async () => { @@ -94,7 +98,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // flaky it.skip('should go to line number when Ctrl+L is pressed', async () => { await PageObjects.console.enterText( '\nGET _search/foo\n{\n "query": {\n "match_all": {} \n} \n}' @@ -131,13 +134,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // Settings not yet implemented - it.skip('can toggle keyboard shortcuts', async () => { + it('can toggle keyboard shortcuts', async () => { // Enter a sample command await PageObjects.console.enterText('GET _search'); // Disable keyboard shorcuts + await PageObjects.console.openConfig(); await PageObjects.console.toggleKeyboardShortcuts(false); + await PageObjects.console.openConsole(); // Upon clicking ctrl enter a newline character should be added to the editor await PageObjects.console.pressCtrlEnter(); @@ -145,11 +149,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.isOutputPanelEmptyStateVisible()).to.be(true); // Restore setting + await PageObjects.console.openConfig(); await PageObjects.console.toggleKeyboardShortcuts(true); + await PageObjects.console.openConsole(); }); describe('customizable font size', () => { - // flaky it('should allow the font size to be customized', async () => { await PageObjects.console.openConfig(); await PageObjects.console.setFontSizeSetting(20); diff --git a/test/functional/apps/console/_variables.ts b/test/functional/apps/console/_variables.ts index 8b5cc0f078e3f..298011c8e347d 100644 --- a/test/functional/apps/console/_variables.ts +++ b/test/functional/apps/console/_variables.ts @@ -65,10 +65,12 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { }); }); - describe.skip('with variables in request body', () => { - // bug in monaco https://github.com/elastic/kibana/issues/185999 - it.skip('should send a successful request', async () => { + describe('with variables in request body', () => { + it('should send a successful request', async () => { + await PageObjects.console.openConfig(); await PageObjects.console.addNewVariable({ name: 'query1', value: '{"match_all": {}}' }); + await PageObjects.console.openConsole(); + await PageObjects.console.clickClearInput(); await PageObjects.console.enterText('\n GET _search\n'); await PageObjects.console.enterText(`{\n\t"query": "\${query1}"`); await PageObjects.console.clickPlay(); From 3a751541bb8155ee87e18336d9f07ab1ca45f31c Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 18 Sep 2024 07:53:13 +0300 Subject: [PATCH 2/4] commit with @elastic email From 82dc73b5917c151579de0d03b0b37a35ed68a863 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 18 Sep 2024 08:11:22 +0300 Subject: [PATCH 3/4] Add missing comment --- test/functional/apps/console/_misc_console_behavior.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/apps/console/_misc_console_behavior.ts b/test/functional/apps/console/_misc_console_behavior.ts index 3d1e71432e73a..68bcc6e7558cf 100644 --- a/test/functional/apps/console/_misc_console_behavior.ts +++ b/test/functional/apps/console/_misc_console_behavior.ts @@ -98,6 +98,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); + // flaky it.skip('should go to line number when Ctrl+L is pressed', async () => { await PageObjects.console.enterText( '\nGET _search/foo\n{\n "query": {\n "match_all": {} \n} \n}' From 452a5b0492860fd1f2c082beecae08e6388b313c Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 18 Sep 2024 08:12:24 +0300 Subject: [PATCH 4/4] Add back comment --- test/functional/apps/console/_console.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index c1283843f75e4..3efb5dabef06b 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -159,7 +159,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // Status badge is not yet implented in phase 2 describe('with query params', () => { it('should issue a successful request', async () => { await PageObjects.console.clearEditorText();