mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[6.x] Fix issue with disabled lab mode (#16351) | Properly wait for search list to load (#16388) (#16394)
* Fix issue with disabled lab mode (#16351) * Fix saved object finder issue * Add functional test * Properly wait for search list to load (#16388)
This commit is contained in:
parent
1d0c16eb36
commit
eceb08d407
5 changed files with 51 additions and 1 deletions
|
@ -267,7 +267,7 @@ module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Pr
|
|||
self.service.find(filter)
|
||||
.then(function (hits) {
|
||||
|
||||
hits.hits = hits.hits.filter((hit) => (isLabsEnabled || hit.type.stage !== 'lab'));
|
||||
hits.hits = hits.hits.filter((hit) => (isLabsEnabled || _.get(hit, 'type.stage') !== 'lab'));
|
||||
hits.total = hits.hits.length;
|
||||
|
||||
// ensure that we don't display old results
|
||||
|
|
36
test/functional/apps/visualize/_lab_mode.js
Normal file
36
test/functional/apps/visualize/_lab_mode.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import expect from 'expect.js';
|
||||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
const log = getService('log');
|
||||
const PageObjects = getPageObjects(['common', 'header', 'discover', 'settings']);
|
||||
|
||||
describe('visualize lab mode', () => {
|
||||
|
||||
it('disabling does not break loading saved searches', async () => {
|
||||
await PageObjects.common.navigateToUrl('discover', '');
|
||||
await PageObjects.discover.saveSearch('visualize_lab_mode_test');
|
||||
const hasSaved = await PageObjects.discover.hasSavedSearch('visualize_lab_mode_test');
|
||||
expect(hasSaved).to.be(true);
|
||||
|
||||
log.info('found saved search before toggling enableLabs mode');
|
||||
|
||||
// Navigate to advanced setting and disable lab mode
|
||||
await PageObjects.header.clickManagement();
|
||||
await PageObjects.settings.clickKibanaSettings();
|
||||
await PageObjects.settings.toggleAdvancedSettingCheckbox('visualize:enableLabs');
|
||||
|
||||
// Expect the discover still to list that saved visualization in the open list
|
||||
await PageObjects.header.clickDiscover();
|
||||
const stillHasSaved = await PageObjects.discover.hasSavedSearch('visualize_lab_mode_test');
|
||||
expect(stillHasSaved).to.be(true);
|
||||
log.info('found saved search after toggling enableLabs mode');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.header.clickManagement();
|
||||
await PageObjects.settings.clickKibanaSettings();
|
||||
await PageObjects.settings.clearAdvancedSettings('visualize:enableLabs');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
|
@ -33,5 +33,6 @@ export default function ({ getService, loadTestFile }) {
|
|||
loadTestFile(require.resolve('./_input_control_vis'));
|
||||
loadTestFile(require.resolve('./_histogram_request_start'));
|
||||
loadTestFile(require.resolve('./_vega_chart'));
|
||||
loadTestFile(require.resolve('./_lab_mode'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -53,6 +53,13 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
return await Promise.all(headerElements.map(el => el.getVisibleText()));
|
||||
}
|
||||
|
||||
async hasSavedSearch(searchName) {
|
||||
await this.clickLoadSavedSearchButton();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const searchLink = await find.byPartialLinkText(searchName);
|
||||
return searchLink.isDisplayed();
|
||||
}
|
||||
|
||||
async loadSavedSearch(searchName) {
|
||||
await this.clickLoadSavedSearchButton();
|
||||
const searchLink = await find.byPartialLinkText(searchName);
|
||||
|
|
|
@ -37,6 +37,12 @@ export function HeaderPageProvider({ getService, getPageObjects }) {
|
|||
await this.isGlobalLoadingIndicatorHidden();
|
||||
}
|
||||
|
||||
async clickManagement() {
|
||||
log.debug('click Management tab');
|
||||
await this.clickSelector('a[href*=\'management\']');
|
||||
await this.isGlobalLoadingIndicatorHidden();
|
||||
}
|
||||
|
||||
async clickSettings() {
|
||||
log.debug('click Settings tab');
|
||||
await this.clickSelector('a[href*=\'settings\']');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue