Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Fix flaky and skipped tests #193114

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions test/functional/apps/console/_autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand All @@ -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();
}
});

Expand Down Expand Up @@ -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 () => {
Expand Down
3 changes: 1 addition & 2 deletions test/functional/apps/console/_comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
7 changes: 3 additions & 4 deletions test/functional/apps/console/_console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 () => {
Expand All @@ -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');
Expand Down
13 changes: 9 additions & 4 deletions test/functional/apps/console/_misc_console_behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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}'
Expand Down Expand Up @@ -131,25 +134,27 @@ 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();
// Shortcut shouldn't have generated any request so output panel should still be in empty state
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);
Expand Down
8 changes: 5 additions & 3 deletions test/functional/apps/console/_variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down