Skip to content

Commit

Permalink
[Discover] Unskip functional test of saved queries (#94705) (#95450)
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Mar 25, 2021
1 parent 7e196a0 commit e5c5875
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/functional/apps/discover/_saved_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const savedQueryManagementComponent = getService('savedQueryManagementComponent');
const testSubjects = getService('testSubjects');

// FLAKY: https://github.com/elastic/kibana/issues/89477
describe.skip('saved queries saved objects', function describeIndexTests() {
describe('saved queries saved objects', function describeIndexTests() {
before(async function () {
log.debug('load kibana index with default index pattern');
await esArchiver.load('discover');
Expand Down Expand Up @@ -120,6 +119,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('does not allow saving a query with a non-unique name', async () => {
// this check allows this test to run stand alone, also should fix occacional flakiness
const savedQueryExists = await savedQueryManagementComponent.savedQueryExist('OkResponse');
if (!savedQueryExists) {
await savedQueryManagementComponent.saveNewQuery(
'OkResponse',
'200 responses for .jpg over 24 hours',
true,
true
);
await savedQueryManagementComponent.clearCurrentlyLoadedQuery();
}
await savedQueryManagementComponent.saveNewQueryWithNameError('OkResponse');
});

Expand Down
7 changes: 7 additions & 0 deletions test/functional/services/saved_query_management_component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ export function SavedQueryManagementComponentProvider({
await testSubjects.click('savedQueryFormSaveButton');
}

async savedQueryExist(title: string) {
await this.openSavedQueryManagementComponent();
const exists = testSubjects.exists(`~load-saved-query-${title}-button`);
await this.closeSavedQueryManagementComponent();
return exists;
}

async savedQueryExistOrFail(title: string) {
await this.openSavedQueryManagementComponent();
await testSubjects.existOrFail(`~load-saved-query-${title}-button`);
Expand Down

0 comments on commit e5c5875

Please sign in to comment.