forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Could not locate that index-pattern" recreate link is not working (
elastic#67280) added a functional test, because we've recently fixed this link and it regressed again
- Loading branch information
Showing
5 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
test/functional/apps/dashboard/dashboard_error_handling.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const PageObjects = getPageObjects(['dashboard', 'header', 'common']); | ||
const browser = getService('browser'); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
/** | ||
* Common test suite for testing exception scenarious within dashboard | ||
*/ | ||
describe('dashboard error handling', () => { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('dashboard/current/kibana'); | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
}); | ||
|
||
// wrapping into own describe to make sure new tab is cleaned up even if test failed | ||
// see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122 | ||
describe('recreate index pattern link works', () => { | ||
let tabsCount = 1; | ||
it('recreate index pattern link works', async () => { | ||
await PageObjects.dashboard.gotoDashboardLandingPage(); | ||
await PageObjects.dashboard.loadSavedDashboard('dashboard with missing index pattern'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const errorEmbeddable = await testSubjects.find('embeddableStackError'); | ||
await (await errorEmbeddable.findByTagName('a')).click(); | ||
await browser.switchTab(1); | ||
tabsCount++; | ||
await testSubjects.existOrFail('createIndexPatternButton'); | ||
}); | ||
|
||
after(async () => { | ||
if (tabsCount > 1) { | ||
await browser.closeCurrentWindow(); | ||
await browser.switchTab(0); | ||
} | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+549 Bytes
(100%)
test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters