From 8cab6fc4d34fc610d4a592af3364e1ae7d41e5e5 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 09:21:18 +0300 Subject: [PATCH 1/7] Fix tests --- test/functional/apps/console/_autocomplete.ts | 10 ++++------ test/functional/apps/console/_comments.ts | 3 +-- test/functional/apps/console/_console.ts | 5 ++--- test/functional/apps/console/_variables.ts | 8 +++++--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/test/functional/apps/console/_autocomplete.ts b/test/functional/apps/console/_autocomplete.ts index bb0ac20234b27..817a7121ca0d0 100644 --- a/test/functional/apps/console/_autocomplete.ts +++ b/test/functional/apps/console/_autocomplete.ts @@ -61,8 +61,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(); }); @@ -85,11 +84,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(); } }); @@ -353,8 +352,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..a503219ca663c 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(); @@ -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/_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 af100505bf2e689c96b232ce9639756e718ad88d Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 09:21:22 +0300 Subject: [PATCH 2/7] commit with @elastic email From 01b8ed9463bbbd1b88cd7748d26f450e036ba892 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 09:27:44 +0300 Subject: [PATCH 3/7] Unskip tests --- .../functional/apps/console/_misc_console_behavior.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/console/_misc_console_behavior.ts b/test/functional/apps/console/_misc_console_behavior.ts index c0f4ffdd0654a..084f39b461d0e 100644 --- a/test/functional/apps/console/_misc_console_behavior.ts +++ b/test/functional/apps/console/_misc_console_behavior.ts @@ -94,8 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // flaky - it.skip('should go to line number when Ctrl+L is pressed', async () => { + it.only('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 +130,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 +145,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); From 842dd77192b3f8097faebb26620787292efa8f54 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 10:08:35 +0300 Subject: [PATCH 4/7] Fix broken test --- test/functional/apps/console/_console.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index a503219ca663c..fc99defa652f5 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -143,12 +143,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('with kbn: prefix in request', () => { + describe.only('with kbn: prefix in request', () => { before(async () => { 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 () => { From b08fe2e6204a9b3bab7207b4ebd1fe9a980add13 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 10:53:58 +0300 Subject: [PATCH 5/7] Skip failing test --- test/functional/apps/console/_misc_console_behavior.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/console/_misc_console_behavior.ts b/test/functional/apps/console/_misc_console_behavior.ts index 084f39b461d0e..2b4ee72ac5de3 100644 --- a/test/functional/apps/console/_misc_console_behavior.ts +++ b/test/functional/apps/console/_misc_console_behavior.ts @@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - it.only('should go to line number when Ctrl+L is pressed', async () => { + 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 bc74237b7ecf8b1a140a153c67ab5d4fc47ff3f3 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 11:28:38 +0300 Subject: [PATCH 6/7] Remove only --- test/functional/apps/console/_console.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index fc99defa652f5..c1283843f75e4 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -143,7 +143,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe.only('with kbn: prefix in request', () => { + describe('with kbn: prefix in request', () => { before(async () => { await PageObjects.console.clearEditorText(); }); From 90f9b9fab9eef9ab879c357b67b45c6db3389373 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 17 Sep 2024 14:59:47 +0300 Subject: [PATCH 7/7] ensure shortcuts are enabled --- test/functional/apps/console/_misc_console_behavior.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/functional/apps/console/_misc_console_behavior.ts b/test/functional/apps/console/_misc_console_behavior.ts index 2b4ee72ac5de3..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 () => {