mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[Dashboard] Remove library and drilldown notifications (#190797)
## Summary Pre-req for #182535. We're removing the linked to library and drilldown notifications as part of the panel hover actions redesign which gets rid of the title bar in edit mode. We want to prevent panels from having a title bar when titles are hidden and believe these notifications are no longer necessary. The only notification retained is the panel filter notification. <img width="421" alt="Screenshot 2024-08-20 at 6 34 16 AM" src="https://github.com/user-attachments/assets/9f954a6f-3a70-43c9-a3c3-28f92f1efba8"> <img width="269" alt="Screenshot 2024-08-20 at 6 37 18 AM" src="https://github.com/user-attachments/assets/b6c154d5-0b8c-4c8b-ac72-a190d03f8801"> I also did some cleanup and removed unused page objects from the vis, dashboard, and discover functional tests. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
a8d758b758
commit
3d8fad56f2
378 changed files with 10016 additions and 11076 deletions
|
@ -17,10 +17,8 @@ import { CopyToDashboardAction } from './copy_to_dashboard_action';
|
||||||
import { ExpandPanelAction } from './expand_panel_action';
|
import { ExpandPanelAction } from './expand_panel_action';
|
||||||
import { ExportCSVAction } from './export_csv_action';
|
import { ExportCSVAction } from './export_csv_action';
|
||||||
import { FiltersNotificationAction } from './filters_notification_action';
|
import { FiltersNotificationAction } from './filters_notification_action';
|
||||||
import { LegacyLibraryNotificationAction } from './legacy_library_notification_action';
|
|
||||||
import { UnlinkFromLibraryAction } from './unlink_from_library_action';
|
import { UnlinkFromLibraryAction } from './unlink_from_library_action';
|
||||||
import { LegacyUnlinkFromLibraryAction } from './legacy_unlink_from_library_action';
|
import { LegacyUnlinkFromLibraryAction } from './legacy_unlink_from_library_action';
|
||||||
import { LibraryNotificationAction } from './library_notification_action';
|
|
||||||
|
|
||||||
interface BuildAllDashboardActionsProps {
|
interface BuildAllDashboardActionsProps {
|
||||||
core: CoreStart;
|
core: CoreStart;
|
||||||
|
@ -64,20 +62,10 @@ export const buildAllDashboardActions = async ({
|
||||||
uiActions.registerAction(unlinkFromLibraryAction);
|
uiActions.registerAction(unlinkFromLibraryAction);
|
||||||
uiActions.attachAction(CONTEXT_MENU_TRIGGER, unlinkFromLibraryAction.id);
|
uiActions.attachAction(CONTEXT_MENU_TRIGGER, unlinkFromLibraryAction.id);
|
||||||
|
|
||||||
const libraryNotificationAction = new LibraryNotificationAction(unlinkFromLibraryAction);
|
|
||||||
uiActions.registerAction(libraryNotificationAction);
|
|
||||||
uiActions.attachAction(PANEL_NOTIFICATION_TRIGGER, libraryNotificationAction.id);
|
|
||||||
|
|
||||||
const legacyUnlinkFromLibraryAction = new LegacyUnlinkFromLibraryAction();
|
const legacyUnlinkFromLibraryAction = new LegacyUnlinkFromLibraryAction();
|
||||||
uiActions.registerAction(legacyUnlinkFromLibraryAction);
|
uiActions.registerAction(legacyUnlinkFromLibraryAction);
|
||||||
uiActions.attachAction(CONTEXT_MENU_TRIGGER, legacyUnlinkFromLibraryAction.id);
|
uiActions.attachAction(CONTEXT_MENU_TRIGGER, legacyUnlinkFromLibraryAction.id);
|
||||||
|
|
||||||
const legacyLibraryNotificationAction = new LegacyLibraryNotificationAction(
|
|
||||||
legacyUnlinkFromLibraryAction
|
|
||||||
);
|
|
||||||
uiActions.registerAction(legacyLibraryNotificationAction);
|
|
||||||
uiActions.attachAction(PANEL_NOTIFICATION_TRIGGER, legacyLibraryNotificationAction.id);
|
|
||||||
|
|
||||||
const copyToDashboardAction = new CopyToDashboardAction(core);
|
const copyToDashboardAction = new CopyToDashboardAction(core);
|
||||||
uiActions.registerAction(copyToDashboardAction);
|
uiActions.registerAction(copyToDashboardAction);
|
||||||
uiActions.attachAction(CONTEXT_MENU_TRIGGER, copyToDashboardAction.id);
|
uiActions.attachAction(CONTEXT_MENU_TRIGGER, copyToDashboardAction.id);
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the "Elastic License
|
|
||||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
||||||
* Public License v 1"; you may not use this file except in compliance with, at
|
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ViewMode } from '@kbn/presentation-publishing';
|
|
||||||
import { waitFor } from '@testing-library/react';
|
|
||||||
import { BehaviorSubject } from 'rxjs';
|
|
||||||
import { LegacyLibraryNotificationAction } from './legacy_library_notification_action';
|
|
||||||
import {
|
|
||||||
LegacyUnlinkFromLibraryAction,
|
|
||||||
LegacyUnlinkPanelFromLibraryActionApi,
|
|
||||||
} from './legacy_unlink_from_library_action';
|
|
||||||
|
|
||||||
describe('library notification action', () => {
|
|
||||||
let action: LegacyLibraryNotificationAction;
|
|
||||||
let unlinkAction: LegacyUnlinkFromLibraryAction;
|
|
||||||
let context: { embeddable: LegacyUnlinkPanelFromLibraryActionApi };
|
|
||||||
|
|
||||||
let updateViewMode: (viewMode: ViewMode) => void;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
const viewModeSubject = new BehaviorSubject<ViewMode>('edit');
|
|
||||||
updateViewMode = (viewMode) => viewModeSubject.next(viewMode);
|
|
||||||
|
|
||||||
unlinkAction = new LegacyUnlinkFromLibraryAction();
|
|
||||||
action = new LegacyLibraryNotificationAction(unlinkAction);
|
|
||||||
context = {
|
|
||||||
embeddable: {
|
|
||||||
viewMode: viewModeSubject,
|
|
||||||
canUnlinkFromLibrary: jest.fn().mockResolvedValue(true),
|
|
||||||
unlinkFromLibrary: jest.fn(),
|
|
||||||
canLinkToLibrary: jest.fn().mockResolvedValue(true),
|
|
||||||
linkToLibrary: jest.fn(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('is compatible when api meets all conditions', async () => {
|
|
||||||
expect(await action.isCompatible(context)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('is incompatible when api is missing required functions', async () => {
|
|
||||||
const emptyContext = { embeddable: {} };
|
|
||||||
expect(await action.isCompatible(emptyContext)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('is incompatible when can unlink from library resolves to false', async () => {
|
|
||||||
context.embeddable.canUnlinkFromLibrary = jest.fn().mockResolvedValue(false);
|
|
||||||
expect(await action.isCompatible(context)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('calls onChange when view mode changes', async () => {
|
|
||||||
const onChange = jest.fn();
|
|
||||||
action.subscribeToCompatibilityChanges(context, onChange);
|
|
||||||
updateViewMode('view');
|
|
||||||
await waitFor(() => expect(onChange).toHaveBeenCalledWith(false, action));
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the "Elastic License
|
|
||||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
||||||
* Public License v 1"; you may not use this file except in compliance with, at
|
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import {
|
|
||||||
EmbeddableApiContext,
|
|
||||||
getInheritedViewMode,
|
|
||||||
getViewModeSubject,
|
|
||||||
} from '@kbn/presentation-publishing';
|
|
||||||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
|
||||||
import { LibraryNotificationPopover } from './library_notification_popover';
|
|
||||||
import {
|
|
||||||
legacyUnlinkActionIsCompatible,
|
|
||||||
LegacyUnlinkFromLibraryAction,
|
|
||||||
} from './legacy_unlink_from_library_action';
|
|
||||||
import { dashboardLibraryNotificationStrings } from './_dashboard_actions_strings';
|
|
||||||
|
|
||||||
export const LEGACY_ACTION_LIBRARY_NOTIFICATION = 'LEGACY_ACTION_LIBRARY_NOTIFICATION';
|
|
||||||
|
|
||||||
export class LegacyLibraryNotificationAction implements Action<EmbeddableApiContext> {
|
|
||||||
public readonly id = LEGACY_ACTION_LIBRARY_NOTIFICATION;
|
|
||||||
public readonly type = LEGACY_ACTION_LIBRARY_NOTIFICATION;
|
|
||||||
public readonly order = 1;
|
|
||||||
|
|
||||||
constructor(private unlinkAction: LegacyUnlinkFromLibraryAction) {}
|
|
||||||
|
|
||||||
public readonly MenuItem = ({ context }: { context: EmbeddableApiContext }) => {
|
|
||||||
const { embeddable } = context;
|
|
||||||
if (!legacyUnlinkActionIsCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return <LibraryNotificationPopover unlinkAction={this.unlinkAction} api={embeddable} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
public couldBecomeCompatible({ embeddable }: EmbeddableApiContext) {
|
|
||||||
return legacyUnlinkActionIsCompatible(embeddable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public subscribeToCompatibilityChanges(
|
|
||||||
{ embeddable }: EmbeddableApiContext,
|
|
||||||
onChange: (isCompatible: boolean, action: LegacyLibraryNotificationAction) => void
|
|
||||||
) {
|
|
||||||
if (!legacyUnlinkActionIsCompatible(embeddable)) return;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Upgrade this action by subscribing to changes in the existance of a saved object id. Currently,
|
|
||||||
* this is unnecessary because a link or unlink operation will cause the panel to unmount and remount.
|
|
||||||
*/
|
|
||||||
return getViewModeSubject(embeddable)?.subscribe((viewMode) => {
|
|
||||||
embeddable.canUnlinkFromLibrary().then((canUnlink) => {
|
|
||||||
onChange(viewMode === 'edit' && canUnlink, this);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public getDisplayName({ embeddable }: EmbeddableApiContext) {
|
|
||||||
if (!legacyUnlinkActionIsCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return dashboardLibraryNotificationStrings.getDisplayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public getIconType({ embeddable }: EmbeddableApiContext) {
|
|
||||||
if (!legacyUnlinkActionIsCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return 'folderCheck';
|
|
||||||
}
|
|
||||||
|
|
||||||
public isCompatible = async ({ embeddable }: EmbeddableApiContext) => {
|
|
||||||
if (!legacyUnlinkActionIsCompatible(embeddable)) return false;
|
|
||||||
return getInheritedViewMode(embeddable) === 'edit' && embeddable.canUnlinkFromLibrary();
|
|
||||||
};
|
|
||||||
|
|
||||||
public execute = async () => {};
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the "Elastic License
|
|
||||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
||||||
* Public License v 1"; you may not use this file except in compliance with, at
|
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import {
|
|
||||||
apiHasInPlaceLibraryTransforms,
|
|
||||||
EmbeddableApiContext,
|
|
||||||
getInheritedViewMode,
|
|
||||||
getViewModeSubject,
|
|
||||||
} from '@kbn/presentation-publishing';
|
|
||||||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
|
||||||
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
||||||
import { LibraryNotificationPopover } from './library_notification_popover';
|
|
||||||
import { isApiCompatible, UnlinkFromLibraryAction } from './unlink_from_library_action';
|
|
||||||
import { dashboardLibraryNotificationStrings } from './_dashboard_actions_strings';
|
|
||||||
|
|
||||||
export const ACTION_LIBRARY_NOTIFICATION = 'ACTION_LIBRARY_NOTIFICATION';
|
|
||||||
|
|
||||||
export class LibraryNotificationAction implements Action<EmbeddableApiContext> {
|
|
||||||
public readonly id = ACTION_LIBRARY_NOTIFICATION;
|
|
||||||
public readonly type = ACTION_LIBRARY_NOTIFICATION;
|
|
||||||
public readonly order = 1;
|
|
||||||
|
|
||||||
constructor(private unlinkAction: UnlinkFromLibraryAction) {}
|
|
||||||
|
|
||||||
public readonly MenuItem = ({ context }: { context: EmbeddableApiContext }) => {
|
|
||||||
const { embeddable } = context;
|
|
||||||
if (!isApiCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return <LibraryNotificationPopover unlinkAction={this.unlinkAction} api={embeddable} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
public couldBecomeCompatible({ embeddable }: EmbeddableApiContext) {
|
|
||||||
return isApiCompatible(embeddable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public subscribeToCompatibilityChanges = (
|
|
||||||
{ embeddable }: EmbeddableApiContext,
|
|
||||||
onChange: (isCompatible: boolean, action: LibraryNotificationAction) => void
|
|
||||||
) => {
|
|
||||||
if (!isApiCompatible(embeddable)) return;
|
|
||||||
const libraryIdSubject = apiHasInPlaceLibraryTransforms(embeddable)
|
|
||||||
? embeddable.libraryId$
|
|
||||||
: new BehaviorSubject<string | undefined>(undefined);
|
|
||||||
const viewModeSubject = getViewModeSubject(embeddable);
|
|
||||||
if (!viewModeSubject) throw new IncompatibleActionError();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Upgrade this action by subscribing to changes in the existance of a saved object id. Currently,
|
|
||||||
* this is unnecessary because a link or unlink operation will cause the panel to unmount and remount.
|
|
||||||
*/
|
|
||||||
return combineLatest([libraryIdSubject, viewModeSubject]).subscribe(([libraryId, viewMode]) => {
|
|
||||||
this.unlinkAction.canUnlinkFromLibrary(embeddable).then((canUnlink) => {
|
|
||||||
onChange(viewMode === 'edit' && canUnlink, this);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
public getDisplayName({ embeddable }: EmbeddableApiContext) {
|
|
||||||
if (!isApiCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return dashboardLibraryNotificationStrings.getDisplayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public getIconType({ embeddable }: EmbeddableApiContext) {
|
|
||||||
if (!isApiCompatible(embeddable)) throw new IncompatibleActionError();
|
|
||||||
return 'folderCheck';
|
|
||||||
}
|
|
||||||
|
|
||||||
public isCompatible = async ({ embeddable }: EmbeddableApiContext) => {
|
|
||||||
if (!isApiCompatible(embeddable)) return false;
|
|
||||||
return (
|
|
||||||
getInheritedViewMode(embeddable) === 'edit' &&
|
|
||||||
this.unlinkAction.canUnlinkFromLibrary(embeddable)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
public execute = async () => {};
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the "Elastic License
|
|
||||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
||||||
* Public License v 1"; you may not use this file except in compliance with, at
|
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
|
||||||
import { I18nProvider } from '@kbn/i18n-react';
|
|
||||||
import { ViewMode } from '@kbn/presentation-publishing';
|
|
||||||
import { render, screen } from '@testing-library/react';
|
|
||||||
import userEvent from '@testing-library/user-event';
|
|
||||||
import React from 'react';
|
|
||||||
import { BehaviorSubject } from 'rxjs';
|
|
||||||
import { LibraryNotificationPopover } from './library_notification_popover';
|
|
||||||
import {
|
|
||||||
LegacyUnlinkFromLibraryAction,
|
|
||||||
LegacyUnlinkPanelFromLibraryActionApi,
|
|
||||||
} from './legacy_unlink_from_library_action';
|
|
||||||
|
|
||||||
const mockUnlinkFromLibraryAction = {
|
|
||||||
execute: jest.fn(),
|
|
||||||
isCompatible: jest.fn().mockResolvedValue(true),
|
|
||||||
getDisplayName: jest.fn().mockReturnValue('Test Unlink'),
|
|
||||||
} as unknown as LegacyUnlinkFromLibraryAction;
|
|
||||||
|
|
||||||
describe('library notification popover', () => {
|
|
||||||
let api: LegacyUnlinkPanelFromLibraryActionApi;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
api = {
|
|
||||||
viewMode: new BehaviorSubject<ViewMode>('edit'),
|
|
||||||
canUnlinkFromLibrary: jest.fn().mockResolvedValue(true),
|
|
||||||
unlinkFromLibrary: jest.fn(),
|
|
||||||
canLinkToLibrary: jest.fn().mockResolvedValue(true),
|
|
||||||
linkToLibrary: jest.fn(),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
const renderAndOpenPopover = async () => {
|
|
||||||
render(
|
|
||||||
<I18nProvider>
|
|
||||||
<LibraryNotificationPopover api={api} unlinkAction={mockUnlinkFromLibraryAction} />
|
|
||||||
</I18nProvider>
|
|
||||||
);
|
|
||||||
await userEvent.click(
|
|
||||||
await screen.findByTestId('embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION')
|
|
||||||
);
|
|
||||||
await waitForEuiPopoverOpen();
|
|
||||||
};
|
|
||||||
|
|
||||||
it('renders the unlink button', async () => {
|
|
||||||
await renderAndOpenPopover();
|
|
||||||
expect(await screen.findByText('Test Unlink')).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('calls the unlink action execute method on click', async () => {
|
|
||||||
await renderAndOpenPopover();
|
|
||||||
const button = await screen.findByTestId('libraryNotificationUnlinkButton');
|
|
||||||
await userEvent.click(button);
|
|
||||||
expect(mockUnlinkFromLibraryAction.execute).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,86 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the "Elastic License
|
|
||||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
||||||
* Public License v 1"; you may not use this file except in compliance with, at
|
|
||||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
import {
|
|
||||||
EuiButton,
|
|
||||||
EuiButtonIcon,
|
|
||||||
EuiFlexGroup,
|
|
||||||
EuiFlexItem,
|
|
||||||
EuiPopover,
|
|
||||||
EuiPopoverFooter,
|
|
||||||
EuiPopoverTitle,
|
|
||||||
EuiText,
|
|
||||||
} from '@elastic/eui';
|
|
||||||
|
|
||||||
import {
|
|
||||||
LegacyUnlinkFromLibraryAction,
|
|
||||||
LegacyUnlinkPanelFromLibraryActionApi,
|
|
||||||
} from './legacy_unlink_from_library_action';
|
|
||||||
import { dashboardLibraryNotificationStrings } from './_dashboard_actions_strings';
|
|
||||||
import {
|
|
||||||
UnlinkFromLibraryAction,
|
|
||||||
UnlinkPanelFromLibraryActionApi,
|
|
||||||
} from './unlink_from_library_action';
|
|
||||||
|
|
||||||
export interface LibraryNotificationProps {
|
|
||||||
api: UnlinkPanelFromLibraryActionApi | LegacyUnlinkPanelFromLibraryActionApi;
|
|
||||||
unlinkAction: UnlinkFromLibraryAction | LegacyUnlinkFromLibraryAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function LibraryNotificationPopover({ unlinkAction, api }: LibraryNotificationProps) {
|
|
||||||
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<EuiPopover
|
|
||||||
button={
|
|
||||||
<EuiButtonIcon
|
|
||||||
color="text"
|
|
||||||
iconType={'folderCheck'}
|
|
||||||
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
|
|
||||||
data-test-subj={'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION'}
|
|
||||||
aria-label={dashboardLibraryNotificationStrings.getPopoverAriaLabel()}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
isOpen={isPopoverOpen}
|
|
||||||
closePopover={() => setIsPopoverOpen(false)}
|
|
||||||
anchorPosition="upCenter"
|
|
||||||
>
|
|
||||||
<EuiPopoverTitle>{dashboardLibraryNotificationStrings.getDisplayName()}</EuiPopoverTitle>
|
|
||||||
<div style={{ width: '300px' }}>
|
|
||||||
<EuiText>
|
|
||||||
<p>{dashboardLibraryNotificationStrings.getTooltip()}</p>
|
|
||||||
</EuiText>
|
|
||||||
</div>
|
|
||||||
<EuiPopoverFooter>
|
|
||||||
<EuiFlexGroup
|
|
||||||
gutterSize="s"
|
|
||||||
alignItems="center"
|
|
||||||
justifyContent="flexEnd"
|
|
||||||
responsive={false}
|
|
||||||
wrap={true}
|
|
||||||
>
|
|
||||||
<EuiFlexItem grow={false}>
|
|
||||||
<EuiButton
|
|
||||||
data-test-subj={'libraryNotificationUnlinkButton'}
|
|
||||||
size="s"
|
|
||||||
fill
|
|
||||||
onClick={() => {
|
|
||||||
setIsPopoverOpen(false);
|
|
||||||
unlinkAction.execute({ embeddable: api });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{unlinkAction.getDisplayName({ embeddable: api })}
|
|
||||||
</EuiButton>
|
|
||||||
</EuiFlexItem>
|
|
||||||
</EuiFlexGroup>
|
|
||||||
</EuiPopoverFooter>
|
|
||||||
</EuiPopover>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -10,7 +10,7 @@
|
||||||
import { FtrProviderContext } from '../ftr_provider_context';
|
import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'home', 'settings']);
|
const { common, dashboard } = getPageObjects(['common', 'dashboard']);
|
||||||
const a11y = getService('a11y');
|
const a11y = getService('a11y');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const dashboardSettings = getService('dashboardSettings');
|
const dashboardSettings = getService('dashboardSettings');
|
||||||
|
@ -22,22 +22,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const clonedDashboardName = 'Dashboard Listing A11y (1)';
|
const clonedDashboardName = 'Dashboard Listing A11y (1)';
|
||||||
|
|
||||||
it('navitate to dashboard app', async () => {
|
it('navitate to dashboard app', async () => {
|
||||||
await PageObjects.common.navigateToApp('dashboard');
|
await common.navigateToApp('dashboard');
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create dashboard button', async () => {
|
it('create dashboard button', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save empty dashboard', async () => {
|
it('save empty dashboard', async () => {
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
await dashboard.saveDashboard(dashboardName);
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Open Edit mode', async () => {
|
it('Open Edit mode', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,17 +58,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save the dashboard', async () => {
|
it('save the dashboard', async () => {
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Open Edit mode again', async () => {
|
it('Open Edit mode again', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('open settings flyout', async () => {
|
it('open settings flyout', async () => {
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -106,35 +106,35 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Exit out of edit mode', async () => {
|
it('Exit out of edit mode', async () => {
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Discard changes', async () => {
|
it('Discard changes', async () => {
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
await PageObjects.dashboard.getIsInViewMode();
|
await dashboard.getIsInViewMode();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://github.com/elastic/kibana/issues/153597
|
// https://github.com/elastic/kibana/issues/153597
|
||||||
it.skip('Test full screen', async () => {
|
it.skip('Test full screen', async () => {
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://github.com/elastic/kibana/issues/153597
|
// https://github.com/elastic/kibana/issues/153597
|
||||||
it.skip('Exit out of full screen mode', async () => {
|
it.skip('Exit out of full screen mode', async () => {
|
||||||
await PageObjects.dashboard.exitFullScreenMode();
|
await dashboard.exitFullScreenMode();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Make a clone of the dashboard', async () => {
|
it('Make a clone of the dashboard', async () => {
|
||||||
await PageObjects.dashboard.duplicateDashboard();
|
await dashboard.duplicateDashboard();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Dashboard listing table', async () => {
|
it('Dashboard listing table', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await listingTable.checkListingSelectAllCheckbox();
|
await listingTable.checkListingSelectAllCheckbox();
|
||||||
await listingTable.clickDeleteSelected();
|
await listingTable.clickDeleteSelected();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
await listingTable.isShowingEmptyPromptCreateNewButton();
|
await listingTable.isShowingEmptyPromptCreateNewButton();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,10 +10,9 @@
|
||||||
import { FtrProviderContext } from '../ftr_provider_context';
|
import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, share, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
|
||||||
'share',
|
'share',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
|
@ -30,8 +29,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('Discover a11y tests', () => {
|
describe('Discover a11y tests', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setCommonlyUsedTime('Last_7 days');
|
await timePicker.setCommonlyUsedTime('Last_7 days');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Discover main page', async () => {
|
it('Discover main page', async () => {
|
||||||
|
@ -39,29 +38,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on save button', async () => {
|
it('a11y test on save button', async () => {
|
||||||
await PageObjects.discover.clickSaveSearchButton();
|
await discover.clickSaveSearchButton();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on save search panel', async () => {
|
it('a11y test on save search panel', async () => {
|
||||||
await PageObjects.discover.inputSavedSearchTitle('a11ySearch');
|
await discover.inputSavedSearchTitle('a11ySearch');
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on clicking on confirm save', async () => {
|
it('a11y test on clicking on confirm save', async () => {
|
||||||
await PageObjects.discover.clickConfirmSavedSearch();
|
await discover.clickConfirmSavedSearch();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on click new to reload discover', async () => {
|
it('a11y test on click new to reload discover', async () => {
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on load saved search panel', async () => {
|
it('a11y test on load saved search panel', async () => {
|
||||||
await PageObjects.discover.openLoadSavedSearchPanel();
|
await discover.openLoadSavedSearchPanel();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.discover.closeLoadSavedSearchPanel();
|
await discover.closeLoadSavedSearchPanel();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on inspector panel', async () => {
|
it('a11y test on inspector panel', async () => {
|
||||||
|
@ -71,45 +70,45 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on share panel', async () => {
|
it('a11y test on share panel', async () => {
|
||||||
await PageObjects.share.clickShareTopNavButton();
|
await share.clickShareTopNavButton();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.share.closeShareModal();
|
await share.closeShareModal();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on open sidenav filter', async () => {
|
it('a11y test on open sidenav filter', async () => {
|
||||||
await PageObjects.share.closeShareModal();
|
await share.closeShareModal();
|
||||||
await PageObjects.unifiedFieldList.openSidebarFieldFilter();
|
await unifiedFieldList.openSidebarFieldFilter();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.unifiedFieldList.closeSidebarFieldFilter();
|
await unifiedFieldList.closeSidebarFieldFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on tables with columns view', async () => {
|
it('a11y test on tables with columns view', async () => {
|
||||||
for (const columnName of TEST_COLUMN_NAMES) {
|
for (const columnName of TEST_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemToggle(columnName);
|
await unifiedFieldList.clickFieldListItemToggle(columnName);
|
||||||
}
|
}
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on save queries popover', async () => {
|
it('a11y test on save queries popover', async () => {
|
||||||
await PageObjects.discover.clickSavedQueriesPopOver();
|
await discover.clickSavedQueriesPopOver();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on save queries panel', async () => {
|
it('a11y test on save queries panel', async () => {
|
||||||
await PageObjects.discover.clickCurrentSavedQuery();
|
await discover.clickCurrentSavedQuery();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on toggle include filters option on saved queries panel', async () => {
|
it('a11y test on toggle include filters option on saved queries panel', async () => {
|
||||||
await PageObjects.discover.setSaveQueryFormTitle('test');
|
await discover.setSaveQueryFormTitle('test');
|
||||||
await PageObjects.discover.toggleIncludeFilters();
|
await discover.toggleIncludeFilters();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.discover.saveCurrentSavedQuery();
|
await discover.saveCurrentSavedQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on saved queries list panel', async () => {
|
it('a11y test on saved queries list panel', async () => {
|
||||||
await savedQueryManagementComponent.loadSavedQuery('test');
|
await savedQueryManagementComponent.loadSavedQuery('test');
|
||||||
await PageObjects.discover.clickSavedQueriesPopOver();
|
await discover.clickSavedQueriesPopOver();
|
||||||
await testSubjects.click('saved-query-management-load-button');
|
await testSubjects.click('saved-query-management-load-button');
|
||||||
await savedQueryManagementComponent.deleteSavedQuery('test');
|
await savedQueryManagementComponent.deleteSavedQuery('test');
|
||||||
await a11y.testAppSnapshot({
|
await a11y.testAppSnapshot({
|
||||||
|
@ -128,12 +127,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on JSON view of the document', async () => {
|
it('a11y test on JSON view of the document', async () => {
|
||||||
await PageObjects.discover.clickDocViewerTab('doc_view_source');
|
await discover.clickDocViewerTab('doc_view_source');
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for actions on a field', async () => {
|
it('a11y test for actions on a field', async () => {
|
||||||
await PageObjects.discover.clickDocViewerTab('doc_view_table');
|
await discover.clickDocViewerTab('doc_view_table');
|
||||||
await dataGrid.expandFieldNameCellInFlyout('Cancelled');
|
await dataGrid.expandFieldNameCellInFlyout('Cancelled');
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await browser.pressKeys(browser.keys.ESCAPE);
|
await browser.pressKeys(browser.keys.ESCAPE);
|
||||||
|
@ -165,9 +164,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for data grid with hidden chart', async () => {
|
it('a11y test for data grid with hidden chart', async () => {
|
||||||
await PageObjects.discover.closeHistogramPanel();
|
await discover.closeHistogramPanel();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.discover.openHistogramPanel();
|
await discover.openHistogramPanel();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for time interval panel', async () => {
|
it('a11y test for time interval panel', async () => {
|
||||||
|
@ -194,14 +193,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for field statistics data grid view', async () => {
|
it('a11y test for field statistics data grid view', async () => {
|
||||||
await PageObjects.discover.clickViewModeFieldStatsButton();
|
await discover.clickViewModeFieldStatsButton();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for data grid with collapsed side bar', async () => {
|
it('a11y test for data grid with collapsed side bar', async () => {
|
||||||
await PageObjects.discover.closeSidebar();
|
await discover.closeSidebar();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.discover.openSidebar();
|
await discover.openSidebar();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test for adding a field from side bar', async () => {
|
it('a11y test for adding a field from side bar', async () => {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
import { FtrProviderContext } from '../ftr_provider_context';
|
import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'discover']);
|
const { common, discover } = getPageObjects(['common', 'discover']);
|
||||||
const a11y = getService('a11y');
|
const a11y = getService('a11y');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
@ -18,13 +18,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('Filter panel', () => {
|
describe('Filter panel', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a11y test on add filter panel', async () => {
|
it('a11y test on add filter panel', async () => {
|
||||||
await PageObjects.discover.openAddFilterPanel();
|
await discover.openAddFilterPanel();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
await PageObjects.discover.closeAddFilterPanel();
|
await discover.closeAddFilterPanel();
|
||||||
await filterBar.addFilter({ field: 'OriginCityName', operation: 'is', value: 'Rome' });
|
await filterBar.addFilter({ field: 'OriginCityName', operation: 'is', value: 'Rome' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,24 +10,24 @@
|
||||||
import { FtrProviderContext } from '../ftr_provider_context';
|
import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'visualize', 'header']);
|
const { visualize } = getPageObjects(['visualize']);
|
||||||
const a11y = getService('a11y');
|
const a11y = getService('a11y');
|
||||||
|
|
||||||
describe('Visualize', () => {
|
describe('Visualize', () => {
|
||||||
it('visualize', async () => {
|
it('visualize', async () => {
|
||||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
await visualize.gotoVisualizationLandingPage();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('click on create visualize wizard', async () => {
|
it('click on create visualize wizard', async () => {
|
||||||
await PageObjects.visualize.navigateToNewVisualization();
|
await visualize.navigateToNewVisualization();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create visualize button', async () => {
|
it('create visualize button', async () => {
|
||||||
await PageObjects.visualize.clickAggBasedVisualizations();
|
await visualize.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.waitForVisualizationSelectPage();
|
await visualize.waitForVisualizationSelectPage();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ const TEST_END_TIME = 'Sep 23, 2015 @ 18:31:44.000';
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
// eslint-disable-next-line import/no-default-export
|
||||||
export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'header']);
|
const { common, timePicker, header } = getPageObjects(['common', 'timePicker', 'header']);
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
@ -30,14 +30,14 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
||||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
|
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('home');
|
await common.navigateToApp('home');
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const customizationUrl =
|
const customizationUrl =
|
||||||
currentUrl.substring(0, currentUrl.indexOf('/app/home')) +
|
currentUrl.substring(0, currentUrl.indexOf('/app/home')) +
|
||||||
'/app/discoverCustomizationExamples';
|
'/app/discoverCustomizationExamples';
|
||||||
await browser.get(customizationUrl);
|
await browser.get(customizationUrl);
|
||||||
await PageObjects.timePicker.setAbsoluteRange(TEST_START_TIME, TEST_END_TIME);
|
await timePicker.setAbsoluteRange(TEST_START_TIME, TEST_END_TIME);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -62,9 +62,9 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
||||||
it('Search bar', async () => {
|
it('Search bar', async () => {
|
||||||
await testSubjects.click('logsViewSelectorButton');
|
await testSubjects.click('logsViewSelectorButton');
|
||||||
await testSubjects.click('logsViewSelectorOption-ASavedSearch');
|
await testSubjects.click('logsViewSelectorOption-ASavedSearch');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
|
const { title, description } = await common.getSharedItemTitleAndDescription();
|
||||||
const expected = {
|
const expected = {
|
||||||
title: 'A Saved Search',
|
title: 'A Saved Search',
|
||||||
description: 'A Saved Search Description',
|
description: 'A Saved Search Description',
|
||||||
|
@ -73,7 +73,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
||||||
expect(description).to.eql(expected.description);
|
expect(description).to.eql(expected.description);
|
||||||
});
|
});
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Search bar Prepend Filters exists and should apply filter properly', async () => {
|
it('Search bar Prepend Filters exists and should apply filter properly', async () => {
|
||||||
|
@ -97,7 +97,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
|
||||||
|
|
||||||
// Click the item to apply filter
|
// Click the item to apply filter
|
||||||
await item.click();
|
await item.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// Validate that filter is applied
|
// Validate that filter is applied
|
||||||
const rows = await dataGrid.getDocTableRows();
|
const rows = await dataGrid.getDocTableRows();
|
||||||
|
|
|
@ -16,12 +16,12 @@ export default function ({
|
||||||
loadTestFile,
|
loadTestFile,
|
||||||
}: PluginFunctionalProviderContext) {
|
}: PluginFunctionalProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const PageObjects = getPageObjects(['common', 'header']);
|
const { common } = getPageObjects(['common']);
|
||||||
|
|
||||||
describe('expressions explorer', function () {
|
describe('expressions explorer', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await browser.setWindowSize(1300, 900);
|
await browser.setWindowSize(1300, 900);
|
||||||
await PageObjects.common.navigateToApp('expressionsExplorer');
|
await common.navigateToApp('expressionsExplorer');
|
||||||
});
|
});
|
||||||
|
|
||||||
loadTestFile(require.resolve('./expressions'));
|
loadTestFile(require.resolve('./expressions'));
|
||||||
|
|
|
@ -16,12 +16,12 @@ export default function ({
|
||||||
loadTestFile,
|
loadTestFile,
|
||||||
}: PluginFunctionalProviderContext) {
|
}: PluginFunctionalProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const PageObjects = getPageObjects(['common', 'header']);
|
const { common } = getPageObjects(['common']);
|
||||||
|
|
||||||
describe('ui actions explorer', function () {
|
describe('ui actions explorer', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await browser.setWindowSize(1300, 900);
|
await browser.setWindowSize(1300, 900);
|
||||||
await PageObjects.common.navigateToApp('uiActionsExplorer');
|
await common.navigateToApp('uiActionsExplorer');
|
||||||
});
|
});
|
||||||
|
|
||||||
loadTestFile(require.resolve('./ui_actions'));
|
loadTestFile(require.resolve('./ui_actions'));
|
||||||
|
|
|
@ -20,16 +20,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, dashboard, context, header, unifiedFieldList } =
|
||||||
'common',
|
getPageObjects([
|
||||||
'discover',
|
'common',
|
||||||
'timePicker',
|
'discover',
|
||||||
'settings',
|
'timePicker',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'context',
|
'context',
|
||||||
'header',
|
'header',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
]);
|
]);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
@ -37,20 +37,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('context link in discover', () => {
|
describe('context link in discover', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update({
|
await kibanaServer.uiSettings.update({
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
for (const columnName of TEST_COLUMN_NAMES) {
|
for (const columnName of TEST_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(columnName);
|
await unifiedFieldList.clickFieldListItemAdd(columnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
||||||
await filterBar.addFilter({ field: columnName, operation: 'is', value });
|
await filterBar.addFilter({ field: columnName, operation: 'is', value });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[1].click();
|
await rowActions[1].click();
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
const anchorTimestamp = await getTimestamp(true);
|
const anchorTimestamp = await getTimestamp(true);
|
||||||
return anchorTimestamp === firstDiscoverTimestamp;
|
return anchorTimestamp === firstDiscoverTimestamp;
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[1].click();
|
await rowActions[1].click();
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
const anchorTimestamp = await getTimestamp(true);
|
const anchorTimestamp = await getTimestamp(true);
|
||||||
return anchorTimestamp === firstContextTimestamp;
|
return anchorTimestamp === firstContextTimestamp;
|
||||||
});
|
});
|
||||||
|
@ -111,7 +111,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate to the first document and then back to discover', async () => {
|
it('should navigate to the first document and then back to discover', async () => {
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
|
|
||||||
// click the open action
|
// click the open action
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
|
@ -126,26 +126,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(hasDocHit).to.be(true);
|
expect(hasDocHit).to.be(true);
|
||||||
|
|
||||||
await testSubjects.click('~breadcrumb & ~first');
|
await testSubjects.click('~breadcrumb & ~first');
|
||||||
await PageObjects.discover.waitForDiscoverAppOnScreen();
|
await discover.waitForDiscoverAppOnScreen();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('navigates to doc view from embeddable', async () => {
|
it('navigates to doc view from embeddable', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.saveSearch('my search');
|
await discover.saveSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await dashboardAddPanel.addSavedSearch('my search');
|
await dashboardAddPanel.addSavedSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[0].click();
|
await rowActions[0].click();
|
||||||
await PageObjects.common.sleep(250);
|
await common.sleep(250);
|
||||||
|
|
||||||
// close popup
|
// close popup
|
||||||
const alert = await browser.getAlert();
|
const alert = await browser.getAlert();
|
||||||
|
@ -159,7 +159,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
return currentUrl.includes('#/doc');
|
return currentUrl.includes('#/doc');
|
||||||
});
|
});
|
||||||
await retry.waitFor('doc view being rendered', async () => {
|
await retry.waitFor('doc view being rendered', async () => {
|
||||||
return await PageObjects.discover.isShowingDocViewer();
|
return await discover.isShowingDocViewer();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,16 +20,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const docTable = getService('docTable');
|
const docTable = getService('docTable');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, dashboard, context, header, unifiedFieldList } =
|
||||||
'common',
|
getPageObjects([
|
||||||
'discover',
|
'common',
|
||||||
'timePicker',
|
'discover',
|
||||||
'settings',
|
'timePicker',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'context',
|
'context',
|
||||||
'header',
|
'header',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
]);
|
]);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
@ -37,20 +37,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('context link in discover classic', () => {
|
describe('context link in discover classic', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update({
|
await kibanaServer.uiSettings.update({
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
for (const columnName of TEST_COLUMN_NAMES) {
|
for (const columnName of TEST_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(columnName);
|
await unifiedFieldList.clickFieldListItemAdd(columnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItem(columnName);
|
await unifiedFieldList.clickFieldListItem(columnName);
|
||||||
await PageObjects.unifiedFieldList.clickFieldListPlusFilter(columnName, value);
|
await unifiedFieldList.clickFieldListPlusFilter(columnName, value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -76,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await docTable.clickRowToggle({ rowIndex: 0 });
|
await docTable.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[0].click();
|
await rowActions[0].click();
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
const anchorTimestamp = await getTimestamp(true);
|
const anchorTimestamp = await getTimestamp(true);
|
||||||
return anchorTimestamp === firstDiscoverTimestamp;
|
return anchorTimestamp === firstDiscoverTimestamp;
|
||||||
});
|
});
|
||||||
|
@ -87,7 +87,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await docTable.clickRowToggle({ rowIndex: 0 });
|
await docTable.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[0].click();
|
await rowActions[0].click();
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
const anchorTimestamp = await getTimestamp(true);
|
const anchorTimestamp = await getTimestamp(true);
|
||||||
return anchorTimestamp === firstContextTimestamp;
|
return anchorTimestamp === firstContextTimestamp;
|
||||||
});
|
});
|
||||||
|
@ -110,7 +110,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// bugfix: https://github.com/elastic/kibana/issues/92099
|
// bugfix: https://github.com/elastic/kibana/issues/92099
|
||||||
it('should navigate to the first document and then back to discover', async () => {
|
it('should navigate to the first document and then back to discover', async () => {
|
||||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
await context.waitUntilContextLoadingHasFinished();
|
||||||
|
|
||||||
// navigate to the doc view
|
// navigate to the doc view
|
||||||
await docTable.clickRowToggle({ rowIndex: 0 });
|
await docTable.clickRowToggle({ rowIndex: 0 });
|
||||||
|
@ -128,26 +128,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(hasDocHit).to.be(true);
|
expect(hasDocHit).to.be(true);
|
||||||
|
|
||||||
await testSubjects.click('~breadcrumb & ~first');
|
await testSubjects.click('~breadcrumb & ~first');
|
||||||
await PageObjects.discover.waitForDiscoverAppOnScreen();
|
await discover.waitForDiscoverAppOnScreen();
|
||||||
await PageObjects.discover.waitForDocTableLoadingComplete();
|
await discover.waitForDocTableLoadingComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('navigates to doc view from embeddable', async () => {
|
it('navigates to doc view from embeddable', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.saveSearch('my classic search');
|
await discover.saveSearch('my classic search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await dashboardAddPanel.addSavedSearch('my classic search');
|
await dashboardAddPanel.addSavedSearch('my classic search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await docTable.clickRowToggle({ rowIndex: 0 });
|
await docTable.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[1].click();
|
await rowActions[1].click();
|
||||||
await PageObjects.common.sleep(250);
|
await common.sleep(250);
|
||||||
|
|
||||||
// close popup
|
// close popup
|
||||||
const alert = await browser.getAlert();
|
const alert = await browser.getAlert();
|
||||||
|
@ -161,7 +161,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
return currentUrl.includes('#/doc');
|
return currentUrl.includes('#/doc');
|
||||||
});
|
});
|
||||||
await retry.waitFor('doc view being rendered', async () => {
|
await retry.waitFor('doc view being rendered', async () => {
|
||||||
return await PageObjects.discover.isShowingDocViewer();
|
return await discover.isShowingDocViewer();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
const { dashboard, header, visualize } = getPageObjects(['dashboard', 'header', 'visualize']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
|
@ -31,9 +31,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ensure toolbar popover closes on add', async () => {
|
it('ensure toolbar popover closes on add', async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Log stream (deprecated)');
|
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Log stream (deprecated)');
|
||||||
await dashboardAddPanel.expectEditorMenuClosed();
|
await dashboardAddPanel.expectEditorMenuClosed();
|
||||||
|
@ -45,73 +45,70 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('add new visualization link', () => {
|
describe('add new visualization link', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds new visualization via the top nav link', async () => {
|
it('adds new visualization via the top nav link', async () => {
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
await visualize.saveVisualizationExpectSuccess('visualization from top nav add new panel', {
|
||||||
'visualization from top nav add new panel',
|
redirectToOrigin: true,
|
||||||
{ redirectToOrigin: true }
|
});
|
||||||
);
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds a new visualization', async () => {
|
it('adds a new visualization', async () => {
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
await visualize.saveVisualizationExpectSuccess('visualization from add new link', {
|
||||||
'visualization from add new link',
|
redirectToOrigin: true,
|
||||||
{ redirectToOrigin: true }
|
});
|
||||||
);
|
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds a new timelion visualization', async () => {
|
it('adds a new timelion visualization', async () => {
|
||||||
// adding this case, as the timelion agg-based viz doesn't need the `clickNewSearch()` step
|
// adding this case, as the timelion agg-based viz doesn't need the `clickNewSearch()` step
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickTimelion();
|
await visualize.clickTimelion();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
await visualize.saveVisualizationExpectSuccess('timelion visualization from add new link', {
|
||||||
'timelion visualization from add new link',
|
redirectToOrigin: true,
|
||||||
{ redirectToOrigin: true }
|
});
|
||||||
);
|
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('saves the listing page instead of the visualization to the app link', async () => {
|
it('saves the listing page instead of the visualization to the app link', async () => {
|
||||||
await PageObjects.header.clickVisualize(true);
|
await header.clickVisualize(true);
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
expect(currentUrl).not.to.contain(VisualizeConstants.EDIT_PATH);
|
expect(currentUrl).not.to.contain(VisualizeConstants.EDIT_PATH);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
const { dashboard, header, visualize } = getPageObjects(['dashboard', 'header', 'visualize']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
|
@ -27,9 +27,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// add an area chart by value
|
// add an area chart by value
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
// add a metric by reference
|
// add a metric by reference
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test: metric');
|
await dashboardAddPanel.addVisualization('Rendering-Test: metric');
|
||||||
|
@ -43,8 +43,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -52,126 +52,126 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('lists unsaved changes to existing dashboards', async () => {
|
it('lists unsaved changes to existing dashboards', async () => {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardTitle);
|
await dashboard.loadSavedDashboard(dashboardTitle);
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await addSomePanels();
|
await addSomePanels();
|
||||||
existingDashboardPanelCount = await PageObjects.dashboard.getPanelCount();
|
existingDashboardPanelCount = await dashboard.getPanelCount();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingExists(dashboardTitle);
|
await dashboard.expectUnsavedChangesListingExists(dashboardTitle);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('restores unsaved changes to existing dashboards', async () => {
|
it('restores unsaved changes to existing dashboards', async () => {
|
||||||
await PageObjects.dashboard.clickUnsavedChangesContinueEditing(dashboardTitle);
|
await dashboard.clickUnsavedChangesContinueEditing(dashboardTitle);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(existingDashboardPanelCount);
|
expect(currentPanelCount).to.eql(existingDashboardPanelCount);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('lists unsaved changes to new dashboards', async () => {
|
it('lists unsaved changes to new dashboards', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await addSomePanels();
|
await addSomePanels();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingExists(unsavedDashboardTitle);
|
await dashboard.expectUnsavedChangesListingExists(unsavedDashboardTitle);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('restores unsaved changes to new dashboards', async () => {
|
it('restores unsaved changes to new dashboards', async () => {
|
||||||
await PageObjects.dashboard.clickUnsavedChangesContinueEditing(unsavedDashboardTitle);
|
await dashboard.clickUnsavedChangesContinueEditing(unsavedDashboardTitle);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await PageObjects.dashboard.getPanelCount()).to.eql(2);
|
expect(await dashboard.getPanelCount()).to.eql(2);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows a warning on create new, and restores panels if continue is selected', async () => {
|
it('shows a warning on create new, and restores panels if continue is selected', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard({ continueEditing: true, expectWarning: true });
|
await dashboard.clickNewDashboard({ continueEditing: true, expectWarning: true });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await PageObjects.dashboard.getPanelCount()).to.eql(2);
|
expect(await dashboard.getPanelCount()).to.eql(2);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows a warning on create new, and clears unsaved panels if discard is selected', async () => {
|
it('shows a warning on create new, and clears unsaved panels if discard is selected', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard({
|
await dashboard.clickNewDashboard({
|
||||||
continueEditing: false,
|
continueEditing: false,
|
||||||
expectWarning: true,
|
expectWarning: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await PageObjects.dashboard.getPanelCount()).to.eql(0);
|
expect(await dashboard.getPanelCount()).to.eql(0);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not show unsaved changes on new dashboard when no panels have been added', async () => {
|
it('does not show unsaved changes on new dashboard when no panels have been added', async () => {
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingDoesNotExist(unsavedDashboardTitle);
|
await dashboard.expectUnsavedChangesListingDoesNotExist(unsavedDashboardTitle);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can discard unsaved changes using the discard link', async () => {
|
it('can discard unsaved changes using the discard link', async () => {
|
||||||
await PageObjects.dashboard.clickUnsavedChangesDiscard(
|
await dashboard.clickUnsavedChangesDiscard(
|
||||||
`discard-unsaved-${dashboardTitle.split(' ').join('-')}`
|
`discard-unsaved-${dashboardTitle.split(' ').join('-')}`
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingDoesNotExist(dashboardTitle);
|
await dashboard.expectUnsavedChangesListingDoesNotExist(dashboardTitle);
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardTitle);
|
await dashboard.loadSavedDashboard(dashboardTitle);
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(existingDashboardPanelCount - 2);
|
expect(currentPanelCount).to.eql(existingDashboardPanelCount - 2);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('loses unsaved changes to new dashboard upon saving', async () => {
|
it('loses unsaved changes to new dashboard upon saving', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await addSomePanels();
|
await addSomePanels();
|
||||||
|
|
||||||
// ensure that the unsaved listing exists first
|
// ensure that the unsaved listing exists first
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.clickUnsavedChangesContinueEditing(unsavedDashboardTitle);
|
await dashboard.clickUnsavedChangesContinueEditing(unsavedDashboardTitle);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// Save the dashboard, and check that it now does not exist
|
// Save the dashboard, and check that it now does not exist
|
||||||
await PageObjects.dashboard.saveDashboard(newDashboartTitle);
|
await dashboard.saveDashboard(newDashboartTitle);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingDoesNotExist(unsavedDashboardTitle);
|
await dashboard.expectUnsavedChangesListingDoesNotExist(unsavedDashboardTitle);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not list unsaved changes when unsaved version of the dashboard is the same', async () => {
|
it('does not list unsaved changes when unsaved version of the dashboard is the same', async () => {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(newDashboartTitle);
|
await dashboard.loadSavedDashboard(newDashboartTitle);
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
|
|
||||||
// add another panel so we can delete it later
|
// add another panel so we can delete it later
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess('Wildvis', {
|
await visualize.saveVisualizationExpectSuccess('Wildvis', {
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
// wait for the unsaved changes badge to appear.
|
// wait for the unsaved changes badge to appear.
|
||||||
await PageObjects.dashboard.expectUnsavedChangesBadge();
|
await dashboard.expectUnsavedChangesBadge();
|
||||||
|
|
||||||
// ensure that the unsaved listing exists
|
// ensure that the unsaved listing exists
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingExists(newDashboartTitle);
|
await dashboard.expectUnsavedChangesListingExists(newDashboartTitle);
|
||||||
await PageObjects.dashboard.clickUnsavedChangesContinueEditing(newDashboartTitle);
|
await dashboard.clickUnsavedChangesContinueEditing(newDashboartTitle);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// Remove the panel that was just added
|
// Remove the panel that was just added
|
||||||
await dashboardPanelActions.removePanelByTitle('Wildvis');
|
await dashboardPanelActions.removePanelByTitle('Wildvis');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// Check that it now does not exist
|
// Check that it now does not exist
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.expectUnsavedChangesListingDoesNotExist(newDashboartTitle);
|
await dashboard.expectUnsavedChangesListingDoesNotExist(newDashboartTitle);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
const { dashboard, header, visualize } = getPageObjects(['dashboard', 'header', 'visualize']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
|
@ -33,12 +33,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
originalPanelCount = await dashboard.getPanelCount();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -60,21 +60,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
it('persists after navigating to the listing page and back', async () => {
|
it('persists after navigating to the listing page and back', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await validateQueryAndFilter();
|
await validateQueryAndFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('persists after navigating to Visualize and back', async () => {
|
it('persists after navigating to Visualize and back', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
await visualize.gotoVisualizationLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await validateQueryAndFilter();
|
await validateQueryAndFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -82,13 +82,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
const alert = await browser.getAlert();
|
const alert = await browser.getAlert();
|
||||||
await alert?.accept();
|
await alert?.accept();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await validateQueryAndFilter();
|
await validateQueryAndFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can discard changes', async () => {
|
it('can discard changes', async () => {
|
||||||
await PageObjects.dashboard.clickDiscardChanges();
|
await dashboard.clickDiscardChanges();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.eql('');
|
expect(query).to.eql('');
|
||||||
|
@ -102,9 +102,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// add an area chart by value
|
// add an area chart by value
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
// add a metric by reference
|
// add a metric by reference
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test: metric');
|
await dashboardAddPanel.addVisualization('Rendering-Test: metric');
|
||||||
|
@ -115,67 +115,67 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows the unsaved changes badge after adding panels', async () => {
|
it('shows the unsaved changes badge after adding panels', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await addPanels();
|
await addPanels();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await testSubjects.existOrFail('dashboardUnsavedChangesBadge');
|
await testSubjects.existOrFail('dashboardUnsavedChangesBadge');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has correct number of panels', async () => {
|
it('has correct number of panels', async () => {
|
||||||
unsavedPanelCount = await PageObjects.dashboard.getPanelCount();
|
unsavedPanelCount = await dashboard.getPanelCount();
|
||||||
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('retains unsaved panel count after navigating to listing page and back', async () => {
|
it('retains unsaved panel count after navigating to listing page and back', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(unsavedPanelCount);
|
expect(currentPanelCount).to.eql(unsavedPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('retains unsaved panel count after navigating to another app and back', async () => {
|
it('retains unsaved panel count after navigating to another app and back', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
await visualize.gotoVisualizationLandingPage();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
if (await PageObjects.dashboard.onDashboardLandingPage()) {
|
if (await dashboard.onDashboardLandingPage()) {
|
||||||
await testSubjects.existOrFail('unsavedDashboardsCallout');
|
await testSubjects.existOrFail('unsavedDashboardsCallout');
|
||||||
}
|
}
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(unsavedPanelCount);
|
expect(currentPanelCount).to.eql(unsavedPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can discard changes', async () => {
|
it('can discard changes', async () => {
|
||||||
unsavedPanelCount = await PageObjects.dashboard.getPanelCount();
|
unsavedPanelCount = await dashboard.getPanelCount();
|
||||||
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickDiscardChanges();
|
await dashboard.clickDiscardChanges();
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(originalPanelCount);
|
expect(currentPanelCount).to.eql(originalPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resets to original panel count after switching to view mode and discarding changes', async () => {
|
it('resets to original panel count after switching to view mode and discarding changes', async () => {
|
||||||
await addPanels();
|
await addPanels();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
unsavedPanelCount = await PageObjects.dashboard.getPanelCount();
|
unsavedPanelCount = await dashboard.getPanelCount();
|
||||||
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
expect(unsavedPanelCount).to.eql(originalPanelCount + 2);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const currentPanelCount = await PageObjects.dashboard.getPanelCount();
|
const currentPanelCount = await dashboard.getPanelCount();
|
||||||
expect(currentPanelCount).to.eql(originalPanelCount);
|
expect(currentPanelCount).to.eql(originalPanelCount);
|
||||||
expect(PageObjects.dashboard.getIsInViewMode()).to.eql(true);
|
expect(dashboard.getIsInViewMode()).to.eql(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not show unsaved changes badge after saving', async () => {
|
it('does not show unsaved changes badge after saving', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await addPanels();
|
await addPanels();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.saveDashboard('Unsaved State Test');
|
await dashboard.saveDashboard('Unsaved State Test');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await testSubjects.missingOrFail('dashboardUnsavedChangesBadge');
|
await testSubjects.missingOrFail('dashboardUnsavedChangesBadge');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
const { dashboard, header, visualize } = getPageObjects(['dashboard', 'header', 'visualize']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
|
@ -26,10 +26,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -38,64 +38,64 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('redirects via save and return button after edit', async () => {
|
it('redirects via save and return button after edit', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('redirects via save as button after edit, renaming itself', async () => {
|
it('redirects via save as button after edit, renaming itself', async () => {
|
||||||
const newTitle = 'wowee, looks like I have a new title';
|
const newTitle = 'wowee, looks like I have a new title';
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, {
|
await visualize.saveVisualizationExpectSuccess(newTitle, {
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.eql(originalPanelCount);
|
expect(newPanelCount).to.eql(originalPanelCount);
|
||||||
const titles = await PageObjects.dashboard.getPanelTitles();
|
const titles = await dashboard.getPanelTitles();
|
||||||
expect(titles.indexOf(newTitle)).to.not.be(-1);
|
expect(titles.indexOf(newTitle)).to.not.be(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('redirects via save as button after edit, adding a new panel', async () => {
|
it('redirects via save as button after edit, adding a new panel', async () => {
|
||||||
const newTitle = 'wowee, my title just got cooler';
|
const newTitle = 'wowee, my title just got cooler';
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, {
|
await visualize.saveVisualizationExpectSuccess(newTitle, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.eql(originalPanelCount + 1);
|
expect(newPanelCount).to.eql(originalPanelCount + 1);
|
||||||
const titles = await PageObjects.dashboard.getPanelTitles();
|
const titles = await dashboard.getPanelTitles();
|
||||||
expect(titles.indexOf(newTitle)).to.not.be(-1);
|
expect(titles.indexOf(newTitle)).to.not.be(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('loses originatingApp connection after save as when redirectToOrigin is false', async () => {
|
it('loses originatingApp connection after save as when redirectToOrigin is false', async () => {
|
||||||
const newTitle = 'wowee, my title just got cooler again';
|
const newTitle = 'wowee, my title just got cooler again';
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardPanelActions.editPanelByTitle('wowee, my title just got cooler');
|
await dashboardPanelActions.editPanelByTitle('wowee, my title just got cooler');
|
||||||
await PageObjects.visualize.linkedToOriginatingApp();
|
await visualize.linkedToOriginatingApp();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, {
|
await visualize.saveVisualizationExpectSuccess(newTitle, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
redirectToOrigin: false,
|
redirectToOrigin: false,
|
||||||
});
|
});
|
||||||
await PageObjects.visualize.notLinkedToOriginatingApp();
|
await visualize.notLinkedToOriginatingApp();
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('loses originatingApp connection after first save when redirectToOrigin is false', async () => {
|
it('loses originatingApp connection after first save when redirectToOrigin is false', async () => {
|
||||||
const newTitle = 'test create panel originatingApp';
|
const newTitle = 'test create panel originatingApp';
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await dashboardAddPanel.clickMarkdownQuickButton();
|
await dashboardAddPanel.clickMarkdownQuickButton();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, {
|
await visualize.saveVisualizationExpectSuccess(newTitle, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
redirectToOrigin: false,
|
redirectToOrigin: false,
|
||||||
});
|
});
|
||||||
await PageObjects.visualize.notLinkedToOriginatingApp();
|
await visualize.notLinkedToOriginatingApp();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,13 @@
|
||||||
import expect from '@kbn/expect';
|
import expect from '@kbn/expect';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }) {
|
export default function ({ getService, getPageObjects }) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common', 'visEditor']);
|
const { dashboard, header, visualize, common, visEditor } = getPageObjects([
|
||||||
|
'dashboard',
|
||||||
|
'header',
|
||||||
|
'visualize',
|
||||||
|
'common',
|
||||||
|
'visEditor',
|
||||||
|
]);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const appsMenu = getService('appsMenu');
|
const appsMenu = getService('appsMenu');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
|
@ -22,23 +28,23 @@ export default function ({ getService, getPageObjects }) {
|
||||||
|
|
||||||
const createMarkdownVis = async (title) => {
|
const createMarkdownVis = async (title) => {
|
||||||
await dashboardAddPanel.clickMarkdownQuickButton();
|
await dashboardAddPanel.clickMarkdownQuickButton();
|
||||||
await PageObjects.visEditor.setMarkdownTxt(originalMarkdownText);
|
await visEditor.setMarkdownTxt(originalMarkdownText);
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
if (title) {
|
if (title) {
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(title, {
|
await visualize.saveVisualizationExpectSuccess(title, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const editMarkdownVis = async () => {
|
const editMarkdownVis = async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.visEditor.setMarkdownTxt(modifiedMarkdownText);
|
await visEditor.setMarkdownTxt(modifiedMarkdownText);
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('edit visualizations from dashboard', () => {
|
describe('edit visualizations from dashboard', () => {
|
||||||
|
@ -50,7 +56,7 @@ export default function ({ getService, getPageObjects }) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -59,13 +65,13 @@ export default function ({ getService, getPageObjects }) {
|
||||||
|
|
||||||
it('save button returns to dashboard after editing visualization with changes saved', async () => {
|
it('save button returns to dashboard after editing visualization with changes saved', async () => {
|
||||||
const title = 'test save';
|
const title = 'test save';
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await createMarkdownVis(title);
|
await createMarkdownVis(title);
|
||||||
|
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
||||||
|
@ -73,13 +79,13 @@ export default function ({ getService, getPageObjects }) {
|
||||||
|
|
||||||
it('cancel button returns to dashboard after editing visualization without saving', async () => {
|
it('cancel button returns to dashboard after editing visualization without saving', async () => {
|
||||||
const title = 'test cancel';
|
const title = 'test cancel';
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await createMarkdownVis(title);
|
await createMarkdownVis(title);
|
||||||
|
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.cancelAndReturn(true);
|
await visualize.cancelAndReturn(true);
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
||||||
|
@ -87,106 +93,106 @@ export default function ({ getService, getPageObjects }) {
|
||||||
|
|
||||||
it('cancel button returns to dashboard with no modal if there are no changes to apply', async () => {
|
it('cancel button returns to dashboard with no modal if there are no changes to apply', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.visualize.cancelAndReturn(false);
|
await visualize.cancelAndReturn(false);
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('visualize app menu navigates to the visualize listing page if the last opened visualization was by value', async () => {
|
it('visualize app menu navigates to the visualize listing page if the last opened visualization was by value', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
// Create markdown by value.
|
// Create markdown by value.
|
||||||
await createMarkdownVis();
|
await createMarkdownVis();
|
||||||
|
|
||||||
// Edit then save and return
|
// Edit then save and return
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await appsMenu.clickLink('Visualize Library');
|
await appsMenu.clickLink('Visualize Library');
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
|
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('visualize app menu navigates to the visualize listing page if the last opened visualization was linked to dashboard', async () => {
|
it('visualize app menu navigates to the visualize listing page if the last opened visualization was linked to dashboard', async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
// Create markdown by reference.
|
// Create markdown by reference.
|
||||||
await createMarkdownVis('by reference');
|
await createMarkdownVis('by reference');
|
||||||
|
|
||||||
// Edit then save and return
|
// Edit then save and return
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await appsMenu.clickLink('Visualize Library');
|
await appsMenu.clickLink('Visualize Library');
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
|
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('by value', () => {
|
describe('by value', () => {
|
||||||
it('save and return button returns to dashboard after editing visualization with changes saved', async () => {
|
it('save and return button returns to dashboard after editing visualization with changes saved', async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await createMarkdownVis();
|
await createMarkdownVis();
|
||||||
|
|
||||||
const originalPanelCount = PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = dashboard.getPanelCount();
|
||||||
|
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
||||||
|
|
||||||
const newPanelCount = PageObjects.dashboard.getPanelCount();
|
const newPanelCount = dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.eql(originalPanelCount);
|
expect(newPanelCount).to.eql(originalPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('cancel button returns to dashboard after editing visualization without saving', async () => {
|
it('cancel button returns to dashboard after editing visualization without saving', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await createMarkdownVis();
|
await createMarkdownVis();
|
||||||
|
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.cancelAndReturn(true);
|
await visualize.cancelAndReturn(true);
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(originalMarkdownText);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save to library button returns to dashboard after editing visualization with changes saved', async () => {
|
it('save to library button returns to dashboard after editing visualization with changes saved', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await createMarkdownVis();
|
await createMarkdownVis();
|
||||||
|
|
||||||
const originalPanelCount = PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = dashboard.getPanelCount();
|
||||||
|
|
||||||
await editMarkdownVis();
|
await editMarkdownVis();
|
||||||
await PageObjects.visualize.saveVisualization('test save to library', {
|
await visualize.saveVisualization('test save to library', {
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const markdownText = await testSubjects.find('markdownBody');
|
const markdownText = await testSubjects.find('markdownBody');
|
||||||
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
expect(await markdownText.getVisibleText()).to.eql(modifiedMarkdownText);
|
||||||
|
|
||||||
const newPanelCount = PageObjects.dashboard.getPanelCount();
|
const newPanelCount = dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.eql(originalPanelCount);
|
expect(newPanelCount).to.eql(originalPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should lose its connection to the dashboard when creating new visualization', async () => {
|
it('should lose its connection to the dashboard when creating new visualization', async () => {
|
||||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
await visualize.gotoVisualizationLandingPage();
|
||||||
await PageObjects.visualize.clickNewVisualization();
|
await visualize.clickNewVisualization();
|
||||||
await PageObjects.visualize.clickMarkdownWidget();
|
await visualize.clickMarkdownWidget();
|
||||||
await PageObjects.visualize.notLinkedToOriginatingApp();
|
await visualize.notLinkedToOriginatingApp();
|
||||||
|
|
||||||
// return to origin should not be present in save modal
|
// return to origin should not be present in save modal
|
||||||
await testSubjects.click('visualizeSaveButton');
|
await testSubjects.click('visualizeSaveButton');
|
||||||
|
|
|
@ -16,7 +16,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker', 'discover']);
|
const { common, dashboard, header, timePicker } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'dashboard',
|
||||||
|
'header',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
|
|
||||||
|
@ -33,13 +38,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
'doc_table:legacy': false,
|
'doc_table:legacy': false,
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -59,11 +64,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('are added when a cell filter is clicked', async function () {
|
it('are added when a cell filter is clicked', async function () {
|
||||||
await find.clickByCssSelector(`[role="gridcell"]:nth-child(4)`);
|
await find.clickByCssSelector(`[role="gridcell"]:nth-child(4)`);
|
||||||
// needs a short delay between becoming visible & being clickable
|
// needs a short delay between becoming visible & being clickable
|
||||||
await PageObjects.common.sleep(250);
|
await common.sleep(250);
|
||||||
await find.clickByCssSelector(`[data-test-subj="filterOutButton"]`);
|
await find.clickByCssSelector(`[data-test-subj="filterOutButton"]`);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await find.clickByCssSelector(`[role="gridcell"]:nth-child(4)`);
|
await find.clickByCssSelector(`[role="gridcell"]:nth-child(4)`);
|
||||||
await PageObjects.common.sleep(250);
|
await common.sleep(250);
|
||||||
await find.clickByCssSelector(`[data-test-subj="filterForButton"]`);
|
await find.clickByCssSelector(`[data-test-subj="filterForButton"]`);
|
||||||
const filterCount = await filterBar.getFilterCount();
|
const filterCount = await filterBar.getFilterCount();
|
||||||
expect(filterCount).to.equal(2);
|
expect(filterCount).to.equal(2);
|
||||||
|
|
|
@ -29,13 +29,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardExpect = getService('dashboardExpect');
|
const dashboardExpect = getService('dashboardExpect');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const PageObjects = getPageObjects([
|
const { common, dashboard, header, timePicker } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'visualize',
|
|
||||||
'visChart',
|
|
||||||
'discover',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
]);
|
]);
|
||||||
let visNames: string[] = [];
|
let visNames: string[] = [];
|
||||||
|
@ -114,10 +111,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.common.setTime({ from, to });
|
await common.setTime({ from, to });
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -127,7 +124,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const newUrl = currentUrl.replace(/\?.*$/, '');
|
const newUrl = currentUrl.replace(/\?.*$/, '');
|
||||||
await browser.get(newUrl, false);
|
await browser.get(newUrl, false);
|
||||||
await security.testUser.restoreDefaults();
|
await security.testUser.restoreDefaults();
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -138,10 +135,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// This one is rendered via svg which lets us do better testing of what is being rendered.
|
// This one is rendered via svg which lets us do better testing of what is being rendered.
|
||||||
visNames.push(await dashboardAddPanel.addVisualization('Filter Bytes Test: vega'));
|
visNames.push(await dashboardAddPanel.addVisualization('Filter Bytes Test: vega'));
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardExpect.visualizationsArePresent(visNames);
|
await dashboardExpect.visualizationsArePresent(visNames);
|
||||||
expect(visNames.length).to.be.equal(25);
|
expect(visNames.length).to.be.equal(25);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adding saved searches', async () => {
|
it('adding saved searches', async () => {
|
||||||
|
@ -149,20 +146,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardAddPanel.addEverySavedSearch('"Rendering Test"')
|
await dashboardAddPanel.addEverySavedSearch('"Rendering Test"')
|
||||||
);
|
);
|
||||||
await dashboardAddPanel.closeAddPanel();
|
await dashboardAddPanel.closeAddPanel();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardExpect.visualizationsArePresent(visAndSearchNames);
|
await dashboardExpect.visualizationsArePresent(visAndSearchNames);
|
||||||
expect(visAndSearchNames.length).to.be.equal(26);
|
expect(visAndSearchNames.length).to.be.equal(26);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard('embeddable rendering test', {
|
await dashboard.saveDashboard('embeddable rendering test', {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('initial render test', async () => {
|
it('initial render test', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await expectAllDataRenders();
|
await expectAllDataRenders();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -170,9 +167,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// Change the time to make sure that it's updated when re-opened from the listing page.
|
// Change the time to make sure that it's updated when re-opened from the listing page.
|
||||||
const fromTime = 'May 10, 2018 @ 00:00:00.000';
|
const fromTime = 'May 10, 2018 @ 00:00:00.000';
|
||||||
const toTime = 'May 11, 2018 @ 00:00:00.000';
|
const toTime = 'May 11, 2018 @ 00:00:00.000';
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.dashboard.loadSavedDashboard('embeddable rendering test');
|
await dashboard.loadSavedDashboard('embeddable rendering test');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await expectAllDataRenders();
|
await expectAllDataRenders();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -184,28 +181,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// setNewChartUiDebugFlag required because window._echDebugStateFlag flag is reset after refresh
|
// setNewChartUiDebugFlag required because window._echDebugStateFlag flag is reset after refresh
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
// call query refresh to guarantee all panels are rendered after window._echDebugStateFlag is set
|
// call query refresh to guarantee all panels are rendered after window._echDebugStateFlag is set
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await expectAllDataRenders();
|
await expectAllDataRenders();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('panels are updated when time changes outside of data', async () => {
|
it('panels are updated when time changes outside of data', async () => {
|
||||||
const fromTime = 'May 11, 2018 @ 00:00:00.000';
|
const fromTime = 'May 11, 2018 @ 00:00:00.000';
|
||||||
const toTime = 'May 12, 2018 @ 00:00:00.000';
|
const toTime = 'May 12, 2018 @ 00:00:00.000';
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await expectNoDataRenders();
|
await expectNoDataRenders();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('panels are updated when time changes inside of data', async () => {
|
it('panels are updated when time changes inside of data', async () => {
|
||||||
const fromTime = 'Jan 1, 2018 @ 00:00:00.000';
|
const fromTime = 'Jan 1, 2018 @ 00:00:00.000';
|
||||||
const toTime = 'Apr 13, 2018 @ 00:00:00.000';
|
const toTime = 'Apr 13, 2018 @ 00:00:00.000';
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await expectAllDataRenders();
|
await expectAllDataRenders();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,12 +23,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, discover, header, timePicker } = getPageObjects([
|
||||||
'common',
|
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
'header',
|
||||||
'visualize',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -48,7 +46,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -58,11 +56,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('Add a filter bar', function () {
|
describe('Add a filter bar', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show on an empty dashboard', async function () {
|
it('should show on an empty dashboard', async function () {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
const hasAddFilter = await testSubjects.exists('addFilter');
|
const hasAddFilter = await testSubjects.exists('addFilter');
|
||||||
expect(hasAddFilter).to.be(true);
|
expect(hasAddFilter).to.be(true);
|
||||||
});
|
});
|
||||||
|
@ -78,8 +76,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
this.tags(['skipFirefox']);
|
this.tags(['skipFirefox']);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses default index pattern on an empty dashboard', async () => {
|
it('uses default index pattern on an empty dashboard', async () => {
|
||||||
|
@ -90,7 +88,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('shows index pattern of vis when one is added', async () => {
|
it('shows index pattern of vis when one is added', async () => {
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await testSubjects.click('addFilter');
|
await testSubjects.click('addFilter');
|
||||||
await dashboardExpect.fieldSuggestions(['animal']);
|
await dashboardExpect.fieldSuggestions(['animal']);
|
||||||
|
@ -99,7 +97,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('works when a vis with no index pattern is added', async () => {
|
it('works when a vis with no index pattern is added', async () => {
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test:-markdown');
|
await dashboardAddPanel.addVisualization('Rendering-Test:-markdown');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await testSubjects.click('addFilter');
|
await testSubjects.click('addFilter');
|
||||||
await dashboardExpect.fieldSuggestions(['animal']);
|
await dashboardExpect.fieldSuggestions(['animal']);
|
||||||
|
@ -109,9 +107,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('filter pills', function () {
|
describe('filter pills', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -122,7 +120,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('are added when a pie chart slice is clicked', async function () {
|
it('are added when a pie chart slice is clicked', async function () {
|
||||||
await dashboardAddPanel.addVisualization('Rendering Test: pie');
|
await dashboardAddPanel.addVisualization('Rendering Test: pie');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.filterOnPieSlice('4886');
|
await pieChart.filterOnPieSlice('4886');
|
||||||
const filterCount = await filterBar.getFilterCount();
|
const filterCount = await filterBar.getFilterCount();
|
||||||
expect(filterCount).to.equal(1);
|
expect(filterCount).to.equal(1);
|
||||||
|
@ -131,8 +129,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are preserved after saving a dashboard', async () => {
|
it('are preserved after saving a dashboard', async () => {
|
||||||
await PageObjects.dashboard.saveDashboard('with filters');
|
await dashboard.saveDashboard('with filters');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
|
|
||||||
const filterCount = await filterBar.getFilterCount();
|
const filterCount = await filterBar.getFilterCount();
|
||||||
|
@ -142,9 +140,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are preserved after opening a dashboard saved with filters', async () => {
|
it('are preserved after opening a dashboard saved with filters', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('with filters');
|
await dashboard.loadSavedDashboard('with filters');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
|
|
||||||
|
@ -155,10 +153,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it("restoring filters doesn't break back button", async () => {
|
it("restoring filters doesn't break back button", async () => {
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
await PageObjects.dashboard.expectExistsDashboardLandingPage();
|
await dashboard.expectExistsDashboardLandingPage();
|
||||||
await browser.goForward();
|
await browser.goForward();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await pieChart.expectPieSliceCount(1);
|
await pieChart.expectPieSliceCount(1);
|
||||||
|
@ -167,26 +165,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it("saving with pinned filter doesn't unpin them", async () => {
|
it("saving with pinned filter doesn't unpin them", async () => {
|
||||||
const filterKey = 'bytes';
|
const filterKey = 'bytes';
|
||||||
await filterBar.toggleFilterPinned(filterKey);
|
await filterBar.toggleFilterPinned(filterKey);
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.saveDashboard('saved with pinned filters');
|
await dashboard.saveDashboard('saved with pinned filters');
|
||||||
expect(await filterBar.isFilterPinned(filterKey)).to.be(true);
|
expect(await filterBar.isFilterPinned(filterKey)).to.be(true);
|
||||||
await pieChart.expectPieSliceCount(1);
|
await pieChart.expectPieSliceCount(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("navigating to a dashboard with global filter doesn't unpin it if same filter is saved with dashboard", async () => {
|
it("navigating to a dashboard with global filter doesn't unpin it if same filter is saved with dashboard", async () => {
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('with filters');
|
await dashboard.loadSavedDashboard('with filters');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await filterBar.isFilterPinned('bytes')).to.be(true);
|
expect(await filterBar.isFilterPinned('bytes')).to.be(true);
|
||||||
await pieChart.expectPieSliceCount(1);
|
await pieChart.expectPieSliceCount(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("pinned filters aren't saved", async () => {
|
it("pinned filters aren't saved", async () => {
|
||||||
await filterBar.removeFilter('bytes');
|
await filterBar.removeFilter('bytes');
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('saved with pinned filters');
|
await dashboard.loadSavedDashboard('saved with pinned filters');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await filterBar.getFilterCount()).to.be(0);
|
expect(await filterBar.getFilterCount()).to.be(0);
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
@ -195,15 +193,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('saved search filtering', function () {
|
describe('saved search filtering', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are added when a cell magnifying glass is clicked', async function () {
|
it('are added when a cell magnifying glass is clicked', async function () {
|
||||||
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const isLegacyDefault = await PageObjects.discover.useLegacyTable();
|
const isLegacyDefault = await discover.useLegacyTable();
|
||||||
if (isLegacyDefault) {
|
if (isLegacyDefault) {
|
||||||
await testSubjects.click('docTableCellFilter');
|
await testSubjects.click('docTableCellFilter');
|
||||||
} else {
|
} else {
|
||||||
|
@ -217,8 +215,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('bad filters are loaded properly', function () {
|
describe('bad filters are loaded properly', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with bad filters');
|
await dashboard.loadSavedDashboard('dashboard with bad filters');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('filter with non-existent index pattern renders if it matches a field', async function () {
|
it('filter with non-existent index pattern renders if it matches a field', async function () {
|
||||||
|
|
|
@ -27,13 +27,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'visualize', 'timePicker']);
|
const { dashboard, header, visualize, timePicker } = getPageObjects([
|
||||||
|
'dashboard',
|
||||||
|
'header',
|
||||||
|
'visualize',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
|
|
||||||
// Failing: See https://github.com/elastic/kibana/issues/160062
|
// Failing: See https://github.com/elastic/kibana/issues/160062
|
||||||
describe.skip('dashboard filtering', function () {
|
describe.skip('dashboard filtering', function () {
|
||||||
const populateDashboard = async () => {
|
const populateDashboard = async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
await dashboardAddPanel.addEveryVisualization('"Filter Bytes Test"');
|
await dashboardAddPanel.addEveryVisualization('"Filter Bytes Test"');
|
||||||
await dashboardAddPanel.addEverySavedSearch('"Filter Bytes Test"');
|
await dashboardAddPanel.addEverySavedSearch('"Filter Bytes Test"');
|
||||||
|
|
||||||
|
@ -41,15 +46,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const addFilterAndRefresh = async () => {
|
const addFilterAndRefresh = async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
// first round of requests sometimes times out, refresh all visualizations to fetch again
|
// first round of requests sometimes times out, refresh all visualizations to fetch again
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,9 +73,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -85,7 +90,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('filters on pie charts', async () => {
|
it('filters on pie charts', async () => {
|
||||||
|
@ -144,13 +149,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await addFilterAndRefresh();
|
await addFilterAndRefresh();
|
||||||
|
|
||||||
await filterBar.toggleFilterPinned('bytes');
|
await filterBar.toggleFilterPinned('bytes');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await filterBar.toggleFilterPinned('bytes');
|
await filterBar.toggleFilterPinned('bytes');
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('filters on pie charts', async () => {
|
it('filters on pie charts', async () => {
|
||||||
|
@ -205,8 +210,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await addFilterAndRefresh();
|
await addFilterAndRefresh();
|
||||||
|
|
||||||
await filterBar.toggleFilterEnabled('bytes');
|
await filterBar.toggleFilterEnabled('bytes');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('pie charts', async () => {
|
it('pie charts', async () => {
|
||||||
|
@ -256,67 +261,63 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('nested filtering', () => {
|
describe('nested filtering', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('visualization saved with a query filters data', async () => {
|
it('visualization saved with a query filters data', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
|
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await queryBar.setQuery('weightLbs:>50');
|
await queryBar.setQuery('weightLbs:>50');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// We are on the visualize page, not dashboard, so can't use "PageObjects.dashboard.waitForRenderComplete();"
|
// We are on the visualize page, not dashboard, so can't use "dashboard.waitForRenderComplete();"
|
||||||
// as that expects an item with the `data-shared-items-count` tag.
|
// as that expects an item with the `data-shared-items-count` tag.
|
||||||
await renderable.waitForRender();
|
await renderable.waitForRender();
|
||||||
await pieChart.expectPieSliceCount(3);
|
await pieChart.expectPieSliceCount(3);
|
||||||
|
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
await visualize.saveVisualizationExpectSuccess('Rendering Test: animal sounds pie');
|
||||||
'Rendering Test: animal sounds pie'
|
await header.clickDashboard();
|
||||||
);
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.header.clickDashboard();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
|
||||||
await pieChart.expectPieSliceCount(3);
|
await pieChart.expectPieSliceCount(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Nested visualization filter pills filters data as expected', async () => {
|
it('Nested visualization filter pills filters data as expected', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await renderable.waitForRender();
|
await renderable.waitForRender();
|
||||||
await pieChart.filterOnPieSlice('grr');
|
await pieChart.filterOnPieSlice('grr');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await pieChart.expectPieSliceCount(1);
|
await pieChart.expectPieSliceCount(1);
|
||||||
|
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess('animal sounds pie');
|
await visualize.saveVisualizationExpectSuccess('animal sounds pie');
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
|
|
||||||
await pieChart.expectPieSliceCount(1);
|
await pieChart.expectPieSliceCount(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Removing filter pills and query unfiters data as expected', async () => {
|
it('Removing filter pills and query unfiters data as expected', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await renderable.waitForRender();
|
await renderable.waitForRender();
|
||||||
await queryBar.setQuery('');
|
await queryBar.setQuery('');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await filterBar.removeFilter('sound.keyword');
|
await filterBar.removeFilter('sound.keyword');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
|
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
await visualize.saveVisualizationExpectSuccess('Rendering Test: animal sounds pie');
|
||||||
'Rendering Test: animal sounds pie'
|
await header.clickDashboard();
|
||||||
);
|
|
||||||
await PageObjects.header.clickDashboard();
|
|
||||||
|
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
@ -333,7 +334,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await queryBar.setQuery('weightLbs<40');
|
await queryBar.setQuery('weightLbs<40');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'common']);
|
const { dashboard, common } = getPageObjects(['dashboard', 'common']);
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
|
|
||||||
describe('full screen mode', () => {
|
describe('full screen mode', () => {
|
||||||
|
@ -28,9 +28,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -38,80 +38,80 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('option not available in edit mode', async () => {
|
it('option not available in edit mode', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
|
const exists = await dashboard.fullScreenModeMenuItemExists();
|
||||||
expect(exists).to.be(false);
|
expect(exists).to.be(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('available in view mode', async () => {
|
it('available in view mode', async () => {
|
||||||
await PageObjects.dashboard.saveDashboard('full screen test', {
|
await dashboard.saveDashboard('full screen test', {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
exitFromEditMode: true,
|
exitFromEditMode: true,
|
||||||
});
|
});
|
||||||
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
|
const exists = await dashboard.fullScreenModeMenuItemExists();
|
||||||
expect(exists).to.be(true);
|
expect(exists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('hides the chrome', async () => {
|
it('hides the chrome', async () => {
|
||||||
const isChromeVisible = await PageObjects.common.isChromeVisible();
|
const isChromeVisible = await common.isChromeVisible();
|
||||||
expect(isChromeVisible).to.be(true);
|
expect(isChromeVisible).to.be(true);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeHidden = await PageObjects.common.isChromeHidden();
|
const isChromeHidden = await common.isChromeHidden();
|
||||||
expect(isChromeHidden).to.be(true);
|
expect(isChromeHidden).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays exit full screen logo button', async () => {
|
it('displays exit full screen logo button', async () => {
|
||||||
const exists = await PageObjects.dashboard.exitFullScreenLogoButtonExists();
|
const exists = await dashboard.exitFullScreenLogoButtonExists();
|
||||||
expect(exists).to.be(true);
|
expect(exists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays exit full screen logo button when panel is expanded', async () => {
|
it('displays exit full screen logo button when panel is expanded', async () => {
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
|
|
||||||
const exists = await PageObjects.dashboard.exitFullScreenTextButtonExists();
|
const exists = await dashboard.exitFullScreenTextButtonExists();
|
||||||
expect(exists).to.be(true);
|
expect(exists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exits when the text button is clicked on', async () => {
|
it('exits when the text button is clicked on', async () => {
|
||||||
await PageObjects.dashboard.exitFullScreenMode();
|
await dashboard.exitFullScreenMode();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeVisible = await PageObjects.common.isChromeVisible();
|
const isChromeVisible = await common.isChromeVisible();
|
||||||
expect(isChromeVisible).to.be(true);
|
expect(isChromeVisible).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows filter bar in fullscreen mode', async () => {
|
it('shows filter bar in fullscreen mode', async () => {
|
||||||
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeHidden = await PageObjects.common.isChromeHidden();
|
const isChromeHidden = await common.isChromeHidden();
|
||||||
expect(isChromeHidden).to.be(true);
|
expect(isChromeHidden).to.be(true);
|
||||||
});
|
});
|
||||||
expect(await filterBar.getFilterCount()).to.be(1);
|
expect(await filterBar.getFilterCount()).to.be(1);
|
||||||
await PageObjects.dashboard.clickExitFullScreenLogoButton();
|
await dashboard.clickExitFullScreenLogoButton();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeVisible = await PageObjects.common.isChromeVisible();
|
const isChromeVisible = await common.isChromeVisible();
|
||||||
expect(isChromeVisible).to.be(true);
|
expect(isChromeVisible).to.be(true);
|
||||||
});
|
});
|
||||||
await filterBar.removeFilter('bytes');
|
await filterBar.removeFilter('bytes');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exits full screen mode when back button pressed', async () => {
|
it('exits full screen mode when back button pressed', async () => {
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeVisible = await PageObjects.common.isChromeVisible();
|
const isChromeVisible = await common.isChromeVisible();
|
||||||
expect(isChromeVisible).to.be(true);
|
expect(isChromeVisible).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
await browser.goForward();
|
await browser.goForward();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const isChromeVisible = await PageObjects.common.isChromeVisible();
|
const isChromeVisible = await common.isChromeVisible();
|
||||||
expect(isChromeVisible).to.be(true);
|
expect(isChromeVisible).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,28 +19,33 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker', 'home']);
|
const { common, dashboard, timePicker, home } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'dashboard',
|
||||||
|
'timePicker',
|
||||||
|
'home',
|
||||||
|
]);
|
||||||
|
|
||||||
describe('dashboard multiple data views', () => {
|
describe('dashboard multiple data views', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await kibanaServer.uiSettings.update({ 'courier:ignoreFilterIfFieldNotInIndex': true });
|
await kibanaServer.uiSettings.update({ 'courier:ignoreFilterIfFieldNotInIndex': true });
|
||||||
await PageObjects.common.navigateToApp('home');
|
await common.navigateToApp('home');
|
||||||
await PageObjects.home.goToSampleDataPage();
|
await home.goToSampleDataPage();
|
||||||
await PageObjects.home.addSampleDataSet('flights');
|
await home.addSampleDataSet('flights');
|
||||||
await PageObjects.home.addSampleDataSet('logs');
|
await home.addSampleDataSet('logs');
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await dashboardAddPanel.addSavedSearches(['[Flights] Flight Log', '[Logs] Visits']);
|
await dashboardAddPanel.addSavedSearches(['[Flights] Flight Log', '[Logs] Visits']);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.timePicker.setCommonlyUsedTime('This_week');
|
await timePicker.setCommonlyUsedTime('This_week');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.common.navigateToApp('home');
|
await common.navigateToApp('home');
|
||||||
await PageObjects.home.goToSampleDataPage();
|
await home.goToSampleDataPage();
|
||||||
await PageObjects.home.removeSampleDataSet('flights');
|
await home.removeSampleDataSet('flights');
|
||||||
await PageObjects.home.removeSampleDataSet('logs');
|
await home.removeSampleDataSet('logs');
|
||||||
await kibanaServer.uiSettings.unset('courier:ignoreFilterIfFieldNotInIndex');
|
await kibanaServer.uiSettings.unset('courier:ignoreFilterIfFieldNotInIndex');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -56,9 +61,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('applies filters on panels using a data view without the filter field', async () => {
|
it('applies filters on panels using a data view without the filter field', async () => {
|
||||||
await kibanaServer.uiSettings.update({ 'courier:ignoreFilterIfFieldNotInIndex': false });
|
await kibanaServer.uiSettings.update({ 'courier:ignoreFilterIfFieldNotInIndex': false });
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await testSubjects.click('edit-unsaved-New-Dashboard');
|
await testSubjects.click('edit-unsaved-New-Dashboard');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const logsSavedSearchPanel = (await testSubjects.findAll('embeddedSavedSearchDocTable'))[1];
|
const logsSavedSearchPanel = (await testSubjects.findAll('embeddedSavedSearchDocTable'))[1];
|
||||||
expect(
|
expect(
|
||||||
await (
|
await (
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'visualize', 'header', 'common']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
describe('expanding a panel', () => {
|
describe('expanding a panel', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -26,9 +26,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -38,13 +38,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('hides other panels', async () => {
|
it('hides other panels', async () => {
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(1);
|
expect(panelCount).to.eql(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows other panels after being minimized', async () => {
|
it('shows other panels after being minimized', async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
// Panels are all minimized on a fresh open of a dashboard, so we need to re-expand in order to then minimize.
|
// Panels are all minimized on a fresh open of a dashboard, so we need to re-expand in order to then minimize.
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
|
@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// Add a retry to fix https://github.com/elastic/kibana/issues/14574. Perhaps the recent changes to this
|
// Add a retry to fix https://github.com/elastic/kibana/issues/14574. Perhaps the recent changes to this
|
||||||
// being a CSS update is causing the UI to change slower than grabbing the panels?
|
// being a CSS update is causing the UI to change slower than grabbing the panels?
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCountAfterMaxThenMinimize = await PageObjects.dashboard.getPanelCount();
|
const panelCountAfterMaxThenMinimize = await dashboard.getPanelCount();
|
||||||
expect(panelCountAfterMaxThenMinimize).to.be(panelCount);
|
expect(panelCountAfterMaxThenMinimize).to.be(panelCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header']);
|
const { dashboard, header } = getPageObjects(['dashboard', 'header']);
|
||||||
const toasts = getService('toasts');
|
const toasts = getService('toasts');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const log = getService('log');
|
const log = getService('log');
|
||||||
|
@ -43,8 +43,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('bwc shared urls', function describeIndexTests() {
|
describe('bwc shared urls', function describeIndexTests() {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
|
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
kibanaLegacyBaseUrl =
|
kibanaLegacyBaseUrl =
|
||||||
|
@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard?${url56}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard?${url56}`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal('memory:>220000');
|
expect(query).to.equal('memory:>220000');
|
||||||
|
@ -82,7 +82,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const warningToast = await toasts.getElementByIndex(1);
|
const warningToast = await toasts.getElementByIndex(1);
|
||||||
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');
|
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -93,74 +93,74 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard?${urlQuery}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard?${urlQuery}`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal('memory:>220000');
|
expect(query).to.equal('memory:>220000');
|
||||||
|
|
||||||
const warningToast = await toasts.getElementByIndex(1);
|
const warningToast = await toasts.getElementByIndex(1);
|
||||||
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');
|
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('loads a saved dashboard', async function () {
|
it('loads a saved dashboard', async function () {
|
||||||
await PageObjects.dashboard.saveDashboard('saved with colors', {
|
await dashboard.saveDashboard('saved with colors', {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
savedDashboardId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
savedDashboardId = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard/${savedDashboardId}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard/${savedDashboardId}`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal('memory:>220000');
|
expect(query).to.equal('memory:>220000');
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('loads a saved dashboard with query via dashboard_no_match', async function () {
|
it('loads a saved dashboard with query via dashboard_no_match', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const dashboardBaseUrl = currentUrl.substring(0, currentUrl.indexOf('/app/dashboards'));
|
const dashboardBaseUrl = currentUrl.substring(0, currentUrl.indexOf('/app/dashboards'));
|
||||||
const url = `${dashboardBaseUrl}/app/dashboards#/dashboard/${savedDashboardId}?_a=(query:(language:kuery,query:'boop'))`;
|
const url = `${dashboardBaseUrl}/app/dashboards#/dashboard/${savedDashboardId}?_a=(query:(language:kuery,query:'boop'))`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
await browser.get(url);
|
await browser.get(url);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal('boop');
|
expect(query).to.equal('boop');
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uiState in url takes precedence over saved dashboard state', async function () {
|
it('uiState in url takes precedence over saved dashboard state', async function () {
|
||||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const id = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
const updatedQuery = urlQuery.replace(/F9D9F9/g, '000000');
|
const updatedQuery = urlQuery.replace(/F9D9F9/g, '000000');
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard/${id}?${updatedQuery}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard/${id}?${updatedQuery}`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
|
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('back button works for old dashboards after state migrations', async () => {
|
it('back button works for old dashboards after state migrations', async () => {
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
const oldId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const oldId = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard?${urlQuery}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard?${urlQuery}`;
|
||||||
log.debug(`Navigating to ${url}`);
|
log.debug(`Navigating to ${url}`);
|
||||||
await browser.get(url);
|
await browser.get(url);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const newId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const newId = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
expect(newId).to.be.equal(oldId);
|
expect(newId).to.be.equal(oldId);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,14 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
|
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, timePicker } = getPageObjects(['dashboard', 'timePicker']);
|
||||||
'header',
|
|
||||||
'common',
|
|
||||||
'discover',
|
|
||||||
'dashboard',
|
|
||||||
'visualize',
|
|
||||||
'timePicker',
|
|
||||||
]);
|
|
||||||
|
|
||||||
const fewPanelsTitle = 'few panels';
|
const fewPanelsTitle = 'few panels';
|
||||||
const markdownTitle = 'Copy To Markdown';
|
const markdownTitle = 'Copy To Markdown';
|
||||||
|
@ -46,15 +39,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard(fewPanelsTitle);
|
await dashboard.loadSavedDashboard(fewPanelsTitle);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
fewPanelsPanelCount = await PageObjects.dashboard.getPanelCount();
|
fewPanelsPanelCount = await dashboard.getPanelCount();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
await dashboardVisualizations.createAndAddMarkdown({
|
await dashboardVisualizations.createAndAddMarkdown({
|
||||||
name: markdownTitle,
|
name: markdownTitle,
|
||||||
markdown: 'Please add me to some other dashboard',
|
markdown: 'Please add me to some other dashboard',
|
||||||
|
@ -62,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -91,16 +84,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await testSubjects.click(`dashboard-picker-option-few-panels`);
|
await testSubjects.click(`dashboard-picker-option-few-panels`);
|
||||||
await testSubjects.click('confirmCopyToButton');
|
await testSubjects.click('confirmCopyToButton');
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.dashboard.expectOnDashboard(`Editing ${fewPanelsTitle}`);
|
await dashboard.expectOnDashboard(`Editing ${fewPanelsTitle}`);
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.be(fewPanelsPanelCount + 1);
|
expect(newPanelCount).to.be(fewPanelsPanelCount + 1);
|
||||||
|
|
||||||
// Save & ensure that view mode is applied properly.
|
// Save & ensure that view mode is applied properly.
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
await testSubjects.existOrFail('saveDashboardSuccess');
|
await testSubjects.existOrFail('saveDashboardSuccess');
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
await dashboardPanelActions.expectMissingEditPanelAction(markdownTitle);
|
await dashboardPanelActions.expectMissingEditPanelAction(markdownTitle);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -126,12 +119,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await label.click();
|
await label.click();
|
||||||
await testSubjects.click('confirmCopyToButton');
|
await testSubjects.click('confirmCopyToButton');
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.dashboard.expectOnDashboard(`Editing New Dashboard`);
|
await dashboard.expectOnDashboard(`Editing New Dashboard`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it always appends new panels instead of overwriting', async () => {
|
it('it always appends new panels instead of overwriting', async () => {
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.be(2);
|
expect(newPanelCount).to.be(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,17 +16,16 @@ import { PIE_CHART_VIS_NAME, AREA_CHART_VIS_NAME } from '../../../page_objects/d
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, header, discover, visChart, share, timePicker, unifiedFieldList } =
|
||||||
'common',
|
getPageObjects([
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'visualize',
|
'header',
|
||||||
'header',
|
'discover',
|
||||||
'discover',
|
'visChart',
|
||||||
'visChart',
|
'share',
|
||||||
'share',
|
'timePicker',
|
||||||
'timePicker',
|
'unifiedFieldList',
|
||||||
'unifiedFieldList',
|
]);
|
||||||
]);
|
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
|
@ -67,7 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const enableNewChartLibraryDebug = async (force = false) => {
|
const enableNewChartLibraryDebug = async (force = false) => {
|
||||||
if ((await PageObjects.visChart.isNewChartsLibraryEnabled()) || force) {
|
if ((await visChart.isNewChartsLibraryEnabled()) || force) {
|
||||||
await elasticChart.setNewChartUiDebugFlag();
|
await elasticChart.setNewChartUiDebugFlag();
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
}
|
}
|
||||||
|
@ -75,42 +74,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('dashboard state', function () {
|
describe('dashboard state', function () {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Overriding colors on an area chart is preserved', async () => {
|
it('Overriding colors on an area chart is preserved', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
|
|
||||||
const visName = AREA_CHART_VIS_NAME;
|
const visName = AREA_CHART_VIS_NAME;
|
||||||
await dashboardAddPanel.addVisualization(visName);
|
await dashboardAddPanel.addVisualization(visName);
|
||||||
const dashboardName = 'Overridden colors - new charts library';
|
const dashboardName = 'Overridden colors - new charts library';
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
await dashboard.saveDashboard(dashboardName);
|
||||||
|
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
|
|
||||||
await PageObjects.visChart.openLegendOptionColorsForXY('Count', `[data-title="${visName}"]`);
|
await visChart.openLegendOptionColorsForXY('Count', `[data-title="${visName}"]`);
|
||||||
const overwriteColor = '#d36086';
|
const overwriteColor = '#d36086';
|
||||||
await PageObjects.visChart.selectNewLegendColorChoice(overwriteColor);
|
await visChart.selectNewLegendColorChoice(overwriteColor);
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
await enableNewChartLibraryDebug(true);
|
await enableNewChartLibraryDebug(true);
|
||||||
|
|
||||||
const colorChoiceRetained = await PageObjects.visChart.doesSelectedLegendColorExistForXY(
|
const colorChoiceRetained = await visChart.doesSelectedLegendColorExistForXY(
|
||||||
overwriteColor,
|
overwriteColor,
|
||||||
xyChartSelector
|
xyChartSelector
|
||||||
);
|
);
|
||||||
|
@ -119,60 +118,60 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Saved search with no changes will update when the saved object changes', async () => {
|
it('Saved search with no changes will update when the saved object changes', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
await PageObjects.header.clickDiscover();
|
await header.clickDiscover();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.discover.saveSearch('my search');
|
await discover.saveSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await dashboardAddPanel.addSavedSearch('my search');
|
await dashboardAddPanel.addSavedSearch('my search');
|
||||||
await PageObjects.dashboard.saveDashboard('No local edits');
|
await dashboard.saveDashboard('No local edits');
|
||||||
|
|
||||||
const inViewMode = await testSubjects.exists('dashboardEditMode');
|
const inViewMode = await testSubjects.exists('dashboardEditMode');
|
||||||
expect(inViewMode).to.be(true);
|
expect(inViewMode).to.be(true);
|
||||||
|
|
||||||
await PageObjects.header.clickDiscover();
|
await header.clickDiscover();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('agent');
|
await unifiedFieldList.clickFieldListItemAdd('agent');
|
||||||
await PageObjects.discover.saveSearch('my search');
|
await discover.saveSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const headers = await PageObjects.discover.getColumnHeaders();
|
const headers = await discover.getColumnHeaders();
|
||||||
expect(headers.length).to.be(3);
|
expect(headers.length).to.be(3);
|
||||||
expect(headers[1]).to.be('bytes');
|
expect(headers[1]).to.be('bytes');
|
||||||
expect(headers[2]).to.be('agent');
|
expect(headers[2]).to.be('agent');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Saved search with column changes will not update when the saved object changes', async () => {
|
it('Saved search with column changes will not update when the saved object changes', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.discover.removeHeaderColumn('bytes');
|
await discover.removeHeaderColumn('bytes');
|
||||||
await PageObjects.dashboard.saveDashboard('Has local edits');
|
await dashboard.saveDashboard('Has local edits');
|
||||||
|
|
||||||
await PageObjects.header.clickDiscover();
|
await header.clickDiscover();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('clientip');
|
await unifiedFieldList.clickFieldListItemAdd('clientip');
|
||||||
await PageObjects.discover.saveSearch('my search');
|
await discover.saveSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const headers = await PageObjects.discover.getColumnHeaders();
|
const headers = await discover.getColumnHeaders();
|
||||||
expect(headers.length).to.be(2);
|
expect(headers.length).to.be(2);
|
||||||
expect(headers[1]).to.be('agent');
|
expect(headers[1]).to.be('agent');
|
||||||
});
|
});
|
||||||
|
|
||||||
const getUrlFromShare = async () => {
|
const getUrlFromShare = async () => {
|
||||||
log.debug(`getUrlFromShare`);
|
log.debug(`getUrlFromShare`);
|
||||||
await PageObjects.share.clickShareTopNavButton();
|
await share.clickShareTopNavButton();
|
||||||
const sharedUrl = await PageObjects.share.getSharedUrl();
|
const sharedUrl = await share.getSharedUrl();
|
||||||
await PageObjects.share.closeShareModal();
|
await share.closeShareModal();
|
||||||
log.debug(`sharedUrl: ${sharedUrl}`);
|
log.debug(`sharedUrl: ${sharedUrl}`);
|
||||||
return sharedUrl;
|
return sharedUrl;
|
||||||
};
|
};
|
||||||
|
@ -183,16 +182,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const alert = await browser.getAlert();
|
const alert = await browser.getAlert();
|
||||||
await alert?.accept();
|
await alert?.accept();
|
||||||
await enableNewChartLibraryDebug(true);
|
await enableNewChartLibraryDebug(true);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip this test; directly modifying the URL app state isn't fully supported in the new
|
// Skip this test; directly modifying the URL app state isn't fully supported in the new
|
||||||
// React embeddable framework, but this user interaction is not a high priority
|
// React embeddable framework, but this user interaction is not a high priority
|
||||||
describe.skip('Directly modifying url updates dashboard state', () => {
|
describe.skip('Directly modifying url updates dashboard state', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
const changeQuery = async (useHardRefresh: boolean, newQuery: string) => {
|
const changeQuery = async (useHardRefresh: boolean, newQuery: string) => {
|
||||||
|
@ -211,7 +210,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
|
|
||||||
await browser.get(newUrl.toString(), !useHardRefresh);
|
await browser.get(newUrl.toString(), !useHardRefresh);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const queryBarContentsAfterRefresh = await queryBar.getQueryString();
|
const queryBarContentsAfterRefresh = await queryBar.getQueryString();
|
||||||
expect(queryBarContentsAfterRefresh).to.equal(newQuery);
|
expect(queryBarContentsAfterRefresh).to.equal(newQuery);
|
||||||
};
|
};
|
||||||
|
@ -220,13 +219,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await changeQuery(true, 'hi:hello');
|
await changeQuery(true, 'hi:hello');
|
||||||
await queryBar.clearQuery();
|
await queryBar.clearQuery();
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await PageObjects.dashboard.expectAppStateRemovedFromURL();
|
await dashboard.expectAppStateRemovedFromURL();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for panel size parameters', async function () {
|
it('for panel size parameters', async function () {
|
||||||
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
||||||
const currentUrl = await getUrlFromShare();
|
const currentUrl = await getUrlFromShare();
|
||||||
const currentPanelDimensions = await PageObjects.dashboard.getPanelDimensions();
|
const currentPanelDimensions = await dashboard.getPanelDimensions();
|
||||||
const newUrl = updateAppStateQueryParam(
|
const newUrl = updateAppStateQueryParam(
|
||||||
currentUrl,
|
currentUrl,
|
||||||
(appState: Partial<SharedDashboardState>) => {
|
(appState: Partial<SharedDashboardState>) => {
|
||||||
|
@ -250,12 +249,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await hardRefresh(newUrl);
|
await hardRefresh(newUrl);
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const newPanelDimensions = await PageObjects.dashboard.getPanelDimensions();
|
const newPanelDimensions = await dashboard.getPanelDimensions();
|
||||||
if (newPanelDimensions.length < 0) {
|
if (newPanelDimensions.length < 0) {
|
||||||
throw new Error('No panel dimensions...');
|
throw new Error('No panel dimensions...');
|
||||||
}
|
}
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
// Add a "margin" of error - because of page margins, it won't be a straight doubling of width.
|
// Add a "margin" of error - because of page margins, it won't be a straight doubling of width.
|
||||||
const marginOfError = 10;
|
const marginOfError = 10;
|
||||||
expect(newPanelDimensions[0].width).to.be.lessThan(
|
expect(newPanelDimensions[0].width).to.be.lessThan(
|
||||||
|
@ -268,7 +267,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when removing a panel', async function () {
|
it('when removing a panel', async function () {
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const currentUrl = (await getUrlFromShare()) ?? '';
|
const currentUrl = (await getUrlFromShare()) ?? '';
|
||||||
const newUrl = updateAppStateQueryParam(
|
const newUrl = updateAppStateQueryParam(
|
||||||
currentUrl,
|
currentUrl,
|
||||||
|
@ -281,7 +280,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await hardRefresh(newUrl);
|
await hardRefresh(newUrl);
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.be(0);
|
expect(newPanelCount).to.be(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -297,11 +296,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('updates a pie slice color on a hard refresh', async function () {
|
it('updates a pie slice color on a hard refresh', async function () {
|
||||||
await PageObjects.visChart.openLegendOptionColorsForPie(
|
await visChart.openLegendOptionColorsForPie(
|
||||||
'80,000',
|
'80,000',
|
||||||
`[data-title="${PIE_CHART_VIS_NAME}"]`
|
`[data-title="${PIE_CHART_VIS_NAME}"]`
|
||||||
);
|
);
|
||||||
await PageObjects.visChart.selectNewLegendColorChoice('#F9D9F9');
|
await visChart.selectNewLegendColorChoice('#F9D9F9');
|
||||||
const currentUrl = await getUrlFromShare();
|
const currentUrl = await getUrlFromShare();
|
||||||
const newUrl = updateAppStateQueryParam(
|
const newUrl = updateAppStateQueryParam(
|
||||||
currentUrl,
|
currentUrl,
|
||||||
|
@ -326,7 +325,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await hardRefresh(newUrl);
|
await hardRefresh(newUrl);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const allPieSlicesColor = await pieChart.getAllPieSliceColor('80,000');
|
const allPieSlicesColor = await pieChart.getAllPieSliceColor('80,000');
|
||||||
|
@ -340,9 +339,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('and updates the pie slice legend color', async function () {
|
it('and updates the pie slice legend color', async function () {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const colorExists = await PageObjects.visChart.doesSelectedLegendColorExistForPie(
|
const colorExists = await visChart.doesSelectedLegendColorExistForPie('#FFFFFF');
|
||||||
'#FFFFFF'
|
|
||||||
);
|
|
||||||
expect(colorExists).to.be(true);
|
expect(colorExists).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -370,7 +367,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
|
|
||||||
await hardRefresh(newUrl);
|
await hardRefresh(newUrl);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const pieSliceStyle = await pieChart.getPieSliceStyle('80,000');
|
const pieSliceStyle = await pieChart.getPieSliceStyle('80,000');
|
||||||
|
@ -382,9 +379,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('resets the legend color as well', async function () {
|
it('resets the legend color as well', async function () {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const colorExists = await PageObjects.visChart.doesSelectedLegendColorExistForPie(
|
const colorExists = await visChart.doesSelectedLegendColorExistForPie('#57c17b');
|
||||||
'#57c17b'
|
|
||||||
);
|
|
||||||
expect(colorExists).to.be(true);
|
expect(colorExists).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,10 +17,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const pieChart = getService('pieChart');
|
const pieChart = getService('pieChart');
|
||||||
const elasticChart = getService('elasticChart');
|
const elasticChart = getService('elasticChart');
|
||||||
const dashboardVisualizations = getService('dashboardVisualizations');
|
const dashboardVisualizations = getService('dashboardVisualizations');
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, header, timePicker, discover } = getPageObjects([
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'visualize',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'discover',
|
'discover',
|
||||||
]);
|
]);
|
||||||
|
@ -31,8 +30,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('dashboard time picker', function describeIndexTests() {
|
describe('dashboard time picker', function describeIndexTests() {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -44,28 +43,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Visualization updated when time picker changes', async () => {
|
it('Visualization updated when time picker changes', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.addVisualizations([PIE_CHART_VIS_NAME]);
|
await dashboard.addVisualizations([PIE_CHART_VIS_NAME]);
|
||||||
await pieChart.expectEmptyPieChart();
|
await pieChart.expectEmptyPieChart();
|
||||||
|
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
await pieChart.expectPieSliceCount(10);
|
await pieChart.expectPieSliceCount(10);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Saved search updated when time picker changes', async () => {
|
it('Saved search updated when time picker changes', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await dashboardVisualizations.createAndAddSavedSearch({
|
await dashboardVisualizations.createAndAddSavedSearch({
|
||||||
name: 'saved search',
|
name: 'saved search',
|
||||||
fields: ['bytes', 'agent'],
|
fields: ['bytes', 'agent'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const isLegacyDefault = await PageObjects.discover.useLegacyTable();
|
const isLegacyDefault = await discover.useLegacyTable();
|
||||||
if (isLegacyDefault) {
|
if (isLegacyDefault) {
|
||||||
await dashboardExpect.docTableFieldCount(150);
|
await dashboardExpect.docTableFieldCount(150);
|
||||||
|
|
||||||
// Set to time range with no data
|
// Set to time range with no data
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2000 @ 00:00:00.000',
|
'Jan 1, 2000 @ 00:00:00.000',
|
||||||
'Jan 1, 2000 @ 01:00:00.000'
|
'Jan 1, 2000 @ 01:00:00.000'
|
||||||
);
|
);
|
||||||
|
@ -75,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(docCount).to.above(10);
|
expect(docCount).to.above(10);
|
||||||
|
|
||||||
// Set to time range with no data
|
// Set to time range with no data
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2000 @ 00:00:00.000',
|
'Jan 1, 2000 @ 00:00:00.000',
|
||||||
'Jan 1, 2000 @ 01:00:00.000'
|
'Jan 1, 2000 @ 01:00:00.000'
|
||||||
);
|
);
|
||||||
|
@ -85,9 +84,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Timepicker start, end, interval values are set by url', async () => {
|
it('Timepicker start, end, interval values are set by url', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
log.debug('Went to landing page');
|
log.debug('Went to landing page');
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
log.debug('Clicked new dashboard');
|
log.debug('Clicked new dashboard');
|
||||||
await dashboardVisualizations.createAndAddSavedSearch({
|
await dashboardVisualizations.createAndAddSavedSearch({
|
||||||
name: 'saved search',
|
name: 'saved search',
|
||||||
|
@ -106,9 +105,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await browser.get(`${kibanaBaseUrl}#${urlQuery}`, true);
|
await browser.get(`${kibanaBaseUrl}#${urlQuery}`, true);
|
||||||
const alert = await browser.getAlert();
|
const alert = await browser.getAlert();
|
||||||
await alert?.accept();
|
await alert?.accept();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
const refresh = await PageObjects.timePicker.getRefreshConfig();
|
const refresh = await timePicker.getRefreshConfig();
|
||||||
expect(time.start).to.be('Nov 17, 2012 @ 00:00:00.000');
|
expect(time.start).to.be('Nov 17, 2012 @ 00:00:00.000');
|
||||||
expect(time.end).to.be('Nov 17, 2015 @ 18:01:36.621');
|
expect(time.end).to.be('Nov 17, 2015 @ 18:01:36.621');
|
||||||
expect(refresh.interval).to.be('2');
|
expect(refresh.interval).to.be('2');
|
||||||
|
@ -122,15 +121,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.addVisualizations([PIE_CHART_VIS_NAME]);
|
await dashboard.addVisualizations([PIE_CHART_VIS_NAME]);
|
||||||
// Same date range as `timePicker.setHistoricalDataRange()`
|
// Same date range as `timePicker.setHistoricalDataRange()`
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange('2015-09-19 06:31:44.000', '2015-09-23 18:31:44.000');
|
||||||
'2015-09-19 06:31:44.000',
|
await dashboard.waitForRenderComplete();
|
||||||
'2015-09-23 18:31:44.000'
|
|
||||||
);
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
|
||||||
await pieChart.expectPieSliceCount(10);
|
await pieChart.expectPieSliceCount(10);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,78 +14,59 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const testSubjects = getService('testSubjects');
|
const { dashboard, header, timePicker } = getPageObjects(['dashboard', 'header', 'timePicker']);
|
||||||
const PageObjects = getPageObjects([
|
|
||||||
'dashboard',
|
|
||||||
'header',
|
|
||||||
'visualize',
|
|
||||||
'discover',
|
|
||||||
'timePicker',
|
|
||||||
]);
|
|
||||||
|
|
||||||
describe('dashboard panel cloning', function viewEditModeTests() {
|
describe('dashboard panel cloning', function viewEditModeTests() {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clones a panel', async () => {
|
it('clones a panel', async () => {
|
||||||
const initialPanelTitles = await PageObjects.dashboard.getPanelTitles();
|
const initialPanelTitles = await dashboard.getPanelTitles();
|
||||||
await dashboardPanelActions.clonePanelByTitle(PIE_CHART_VIS_NAME);
|
await dashboardPanelActions.clonePanel(PIE_CHART_VIS_NAME);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const postPanelTitles = await PageObjects.dashboard.getPanelTitles();
|
const postPanelTitles = await dashboard.getPanelTitles();
|
||||||
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
|
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('appends a clone title tag', async () => {
|
it('appends a clone title tag', async () => {
|
||||||
const panelTitles = await PageObjects.dashboard.getPanelTitles();
|
const panelTitles = await dashboard.getPanelTitles();
|
||||||
expect(panelTitles[1]).to.equal(PIE_CHART_VIS_NAME + ' (copy)');
|
expect(panelTitles[1]).to.equal(`${PIE_CHART_VIS_NAME} (copy)`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('retains original panel dimensions', async () => {
|
it('retains original panel dimensions', async () => {
|
||||||
const panelDimensions = await PageObjects.dashboard.getPanelDimensions();
|
const panelDimensions = await dashboard.getPanelDimensions();
|
||||||
expect(panelDimensions[0]).to.eql(panelDimensions[1]);
|
expect(panelDimensions[0]).to.eql(panelDimensions[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clone of a by reference embeddable is by value', async () => {
|
it('clone of a by reference embeddable is by value', async () => {
|
||||||
const panelName = PIE_CHART_VIS_NAME.replace(/\s+/g, '');
|
await dashboardPanelActions.expectNotLinkedToLibrary(`${PIE_CHART_VIS_NAME} (copy)`);
|
||||||
const clonedPanel = await testSubjects.find(`embeddablePanelHeading-${panelName}(copy)`);
|
|
||||||
const descendants = await testSubjects.findAllDescendant(
|
|
||||||
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
|
|
||||||
clonedPanel
|
|
||||||
);
|
|
||||||
expect(descendants.length).to.equal(0);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('gives a correct title to the clone of a clone', async () => {
|
it('gives a correct title to the clone of a clone', async () => {
|
||||||
const initialPanelTitles = await PageObjects.dashboard.getPanelTitles();
|
const initialPanelTitles = await dashboard.getPanelTitles();
|
||||||
const clonedPanelName = initialPanelTitles[initialPanelTitles.length - 1];
|
const clonedPanelName = initialPanelTitles[initialPanelTitles.length - 1];
|
||||||
await dashboardPanelActions.clonePanelByTitle(clonedPanelName);
|
await dashboardPanelActions.clonePanel(clonedPanelName);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const postPanelTitles = await PageObjects.dashboard.getPanelTitles();
|
const postPanelTitles = await dashboard.getPanelTitles();
|
||||||
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
|
expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1);
|
||||||
expect(postPanelTitles[postPanelTitles.length - 1]).to.equal(
|
expect(postPanelTitles[postPanelTitles.length - 1]).to.equal(
|
||||||
PIE_CHART_VIS_NAME + ' (copy 1)'
|
`${PIE_CHART_VIS_NAME} (copy 1)`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clone of a by value embeddable is by value', async () => {
|
it('clone of a by value embeddable is by value', async () => {
|
||||||
const panelName = PIE_CHART_VIS_NAME.replace(/\s+/g, '');
|
await dashboardPanelActions.expectNotLinkedToLibrary(`${PIE_CHART_VIS_NAME} (copy)`);
|
||||||
const clonedPanel = await testSubjects.find(`embeddablePanelHeading-${panelName}(copy1)`);
|
|
||||||
const descendants = await testSubjects.findAllDescendant(
|
|
||||||
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
|
|
||||||
clonedPanel
|
|
||||||
);
|
|
||||||
expect(descendants.length).to.equal(0);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const dashboardVisualizations = getService('dashboardVisualizations');
|
const dashboardVisualizations = getService('dashboardVisualizations');
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, header, discover, timePicker } = getPageObjects([
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'visualize',
|
|
||||||
'discover',
|
'discover',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
]);
|
]);
|
||||||
|
@ -28,26 +27,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('dashboard panel context menu', function viewEditModeTests() {
|
describe('dashboard panel context menu', function viewEditModeTests() {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setHistoricalDataRange();
|
await timePicker.setHistoricalDataRange();
|
||||||
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are hidden in view mode', async function () {
|
it('are hidden in view mode', async function () {
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
await dashboard.saveDashboard(dashboardName);
|
||||||
|
|
||||||
await dashboardPanelActions.expectMissingEditPanelAction();
|
await dashboardPanelActions.expectMissingEditPanelAction();
|
||||||
await dashboardPanelActions.expectMissingRemovePanelAction();
|
await dashboardPanelActions.expectMissingRemovePanelAction();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are shown in edit mode', async function () {
|
it('are shown in edit mode', async function () {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
|
|
||||||
const isContextMenuIconVisible = await dashboardPanelActions.isContextMenuIconVisible();
|
const isContextMenuIconVisible = await dashboardPanelActions.isContextMenuIconVisible();
|
||||||
expect(isContextMenuIconVisible).to.equal(true);
|
expect(isContextMenuIconVisible).to.equal(true);
|
||||||
|
@ -65,7 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// The second parameter of true will include the timestamp in the url and
|
// The second parameter of true will include the timestamp in the url and
|
||||||
// trigger a hard refresh.
|
// trigger a hard refresh.
|
||||||
await browser.get(currentUrl.toString(), true);
|
await browser.get(currentUrl.toString(), true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await dashboardPanelActions.expectExistsEditPanelAction();
|
await dashboardPanelActions.expectExistsEditPanelAction();
|
||||||
await dashboardPanelActions.expectExistsClonePanelAction();
|
await dashboardPanelActions.expectExistsClonePanelAction();
|
||||||
|
@ -78,17 +77,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('visualization object edit menu', () => {
|
describe('visualization object edit menu', () => {
|
||||||
it('opens a visualization when edit link is clicked', async () => {
|
it('opens a visualization when edit link is clicked', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
expect(currentUrl).to.contain(VisualizeConstants.EDIT_PATH);
|
expect(currentUrl).to.contain(VisualizeConstants.EDIT_PATH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('deletes the visualization when delete link is clicked', async () => {
|
it('deletes the visualization when delete link is clicked', async () => {
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardPanelActions.removePanel();
|
await dashboardPanelActions.removePanel();
|
||||||
|
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.be(0);
|
expect(panelCount).to.be(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -97,39 +96,39 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const searchName = 'my search';
|
const searchName = 'my search';
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.header.clickDiscover(true);
|
await header.clickDiscover(true);
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await dashboardVisualizations.createSavedSearch({ name: searchName, fields: ['bytes'] });
|
await dashboardVisualizations.createSavedSearch({ name: searchName, fields: ['bytes'] });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
|
|
||||||
// The following tests require a fresh dashboard.
|
// The following tests require a fresh dashboard.
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
const inViewMode = await PageObjects.dashboard.getIsInViewMode();
|
const inViewMode = await dashboard.getIsInViewMode();
|
||||||
if (inViewMode) await PageObjects.dashboard.switchToEditMode();
|
if (inViewMode) await dashboard.switchToEditMode();
|
||||||
await dashboardAddPanel.addSavedSearch(searchName);
|
await dashboardAddPanel.addSavedSearch(searchName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be one panel on dashboard', async () => {
|
it('should be one panel on dashboard', async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.be(1);
|
expect(panelCount).to.be(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('opens a saved search when edit link is clicked', async () => {
|
it('opens a saved search when edit link is clicked', async () => {
|
||||||
await dashboardPanelActions.clickEdit();
|
await dashboardPanelActions.clickEdit();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const queryName = await PageObjects.discover.getCurrentQueryName();
|
const queryName = await discover.getCurrentQueryName();
|
||||||
expect(queryName).to.be(searchName);
|
expect(queryName).to.be(searchName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('deletes the saved search when delete link is clicked', async () => {
|
it('deletes the saved search when delete link is clicked', async () => {
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardPanelActions.removePanel();
|
await dashboardPanelActions.removePanel();
|
||||||
|
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.be(0);
|
expect(panelCount).to.be(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -139,7 +138,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
await browser.get(currentUrl.toString(), false);
|
await browser.get(currentUrl.toString(), false);
|
||||||
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName + '2');
|
await dashboard.saveDashboard(dashboardName + '2');
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -151,7 +150,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('in edit mode', () => {
|
describe('in edit mode', () => {
|
||||||
it('switch to edit mode', async function () {
|
it('switch to edit mode', async function () {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('some context menu actions should be present', async function () {
|
it('some context menu actions should be present', async function () {
|
||||||
|
|
|
@ -14,54 +14,52 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const listingTable = getService('listingTable');
|
const listingTable = getService('listingTable');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'common']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
describe('dashboard clone', function describeIndexTests() {
|
describe('dashboard clone', function describeIndexTests() {
|
||||||
const dashboardName = 'Dashboard Clone Test';
|
const dashboardName = 'Dashboard Clone Test';
|
||||||
const clonedDashboardName = dashboardName + ' (1)';
|
const clonedDashboardName = dashboardName + ' (1)';
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
return PageObjects.dashboard.initTests();
|
return dashboard.initTests();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Clone saves a copy', async function () {
|
it('Clone saves a copy', async function () {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.addVisualizations(
|
await dashboard.addVisualizations(dashboard.getTestVisualizationNames());
|
||||||
PageObjects.dashboard.getTestVisualizationNames()
|
await dashboard.saveDashboard(dashboardName);
|
||||||
);
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
|
||||||
|
|
||||||
await PageObjects.dashboard.duplicateDashboard();
|
await dashboard.duplicateDashboard();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', clonedDashboardName, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', clonedDashboardName, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('the copy should have all the same visualizations', async function () {
|
it('the copy should have all the same visualizations', async function () {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(clonedDashboardName);
|
await dashboard.loadSavedDashboard(clonedDashboardName);
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelTitles = await PageObjects.dashboard.getPanelTitles();
|
const panelTitles = await dashboard.getPanelTitles();
|
||||||
expect(panelTitles).to.eql(PageObjects.dashboard.getTestVisualizationNames());
|
expect(panelTitles).to.eql(dashboard.getTestVisualizationNames());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Clone should suggest a unique title', async function () {
|
it('Clone should suggest a unique title', async function () {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(clonedDashboardName);
|
await dashboard.loadSavedDashboard(clonedDashboardName);
|
||||||
await PageObjects.dashboard.duplicateDashboard();
|
await dashboard.duplicateDashboard();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (2)`, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (2)`, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Clone should always increment from the last duplicated dashboard with a unique title', async function () {
|
it('Clone should always increment from the last duplicated dashboard with a unique title', async function () {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(clonedDashboardName);
|
await dashboard.loadSavedDashboard(clonedDashboardName);
|
||||||
// force dashboard duplicate id to increment out of logical progression bounds
|
// force dashboard duplicate id to increment out of logical progression bounds
|
||||||
await PageObjects.dashboard.duplicateDashboard(`${dashboardName} (20)`);
|
await dashboard.duplicateDashboard(`${dashboardName} (20)`);
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (20)`, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (20)`, 1);
|
||||||
// load dashboard with duplication id 1
|
// load dashboard with duplication id 1
|
||||||
await PageObjects.dashboard.loadSavedDashboard(clonedDashboardName);
|
await dashboard.loadSavedDashboard(clonedDashboardName);
|
||||||
// run normal clone
|
// run normal clone
|
||||||
await PageObjects.dashboard.duplicateDashboard();
|
await dashboard.duplicateDashboard();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
// clone gets duplication id, that picks off from last duplicated dashboard
|
// clone gets duplication id, that picks off from last duplicated dashboard
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (21)`, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', `${dashboardName} (21)`, 1);
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker']);
|
const { common, dashboard, header } = getPageObjects(['common', 'dashboard', 'header']);
|
||||||
|
|
||||||
describe('dashboard empty state', () => {
|
describe('dashboard empty state', () => {
|
||||||
const kbnDirectory = 'test/functional/fixtures/kbn_archiver/dashboard/current/kibana';
|
const kbnDirectory = 'test/functional/fixtures/kbn_archiver/dashboard/current/kibana';
|
||||||
|
@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
log.debug('load kibana with no data');
|
log.debug('load kibana with no data');
|
||||||
await kibanaServer.importExport.unload(kbnDirectory);
|
await kibanaServer.importExport.unload(kbnDirectory);
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -35,11 +35,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Opens the integrations page when there is no data', async () => {
|
it('Opens the integrations page when there is no data', async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const addIntegrations = await testSubjects.find('kbnOverviewAddIntegrations');
|
const addIntegrations = await testSubjects.find('kbnOverviewAddIntegrations');
|
||||||
await addIntegrations.click();
|
await addIntegrations.click();
|
||||||
await PageObjects.common.waitUntilUrlIncludes('integrations/browse');
|
await common.waitUntilUrlIncludes('integrations/browse');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds a new data view when no data views', async () => {
|
it('adds a new data view when no data views', async () => {
|
||||||
|
@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
|
|
||||||
// create the new data view from the dashboards/create route in order to test that the dashboard is loaded properly as soon as the data view is created...
|
// create the new data view from the dashboards/create route in order to test that the dashboard is loaded properly as soon as the data view is created...
|
||||||
await PageObjects.common.navigateToApp('dashboards', { hash: '/create' });
|
await common.navigateToApp('dashboards', { hash: '/create' });
|
||||||
|
|
||||||
const dataViewToCreate = 'logstash';
|
const dataViewToCreate = 'logstash';
|
||||||
await dataViews.createFromPrompt({ name: dataViewToCreate });
|
await dataViews.createFromPrompt({ name: dataViewToCreate });
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'common']);
|
const { dashboard, header, common } = getPageObjects(['dashboard', 'header', 'common']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const listingTable = getService('listingTable');
|
const listingTable = getService('listingTable');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
|
@ -22,32 +22,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardName = 'Dashboard Listing Test';
|
const dashboardName = 'Dashboard Listing Test';
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('create prompt', () => {
|
describe('create prompt', () => {
|
||||||
it('appears when there are no dashboards', async function () {
|
it('appears when there are no dashboards', async function () {
|
||||||
const promptExists = await PageObjects.dashboard.getCreateDashboardPromptExists();
|
const promptExists = await dashboard.getCreateDashboardPromptExists();
|
||||||
expect(promptExists).to.be(true);
|
expect(promptExists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates a new dashboard', async function () {
|
it('creates a new dashboard', async function () {
|
||||||
await PageObjects.dashboard.clickCreateDashboardPrompt();
|
await dashboard.clickCreateDashboardPrompt();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
await dashboard.saveDashboard(dashboardName);
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is not shown when there is a dashboard', async function () {
|
it('is not shown when there is a dashboard', async function () {
|
||||||
const promptExists = await PageObjects.dashboard.getCreateDashboardPromptExists();
|
const promptExists = await dashboard.getCreateDashboardPromptExists();
|
||||||
expect(promptExists).to.be(false);
|
expect(promptExists).to.be(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is not shown when there are no dashboards shown during a search', async function () {
|
it('is not shown when there are no dashboards shown during a search', async function () {
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', 'gobeldeguck', 0);
|
await listingTable.searchAndExpectItemsCount('dashboard', 'gobeldeguck', 0);
|
||||||
|
|
||||||
const promptExists = await PageObjects.dashboard.getCreateDashboardPromptExists();
|
const promptExists = await dashboard.getCreateDashboardPromptExists();
|
||||||
expect(promptExists).to.be(false);
|
expect(promptExists).to.be(false);
|
||||||
await listingTable.clearSearchFilter();
|
await listingTable.clearSearchFilter();
|
||||||
});
|
});
|
||||||
|
@ -59,11 +59,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await listingTable.checkListingSelectAllCheckbox();
|
await listingTable.checkListingSelectAllCheckbox();
|
||||||
await listingTable.clickDeleteSelected();
|
await listingTable.clickDeleteSelected();
|
||||||
|
|
||||||
await PageObjects.common.expectConfirmModalOpenState(true);
|
await common.expectConfirmModalOpenState(true);
|
||||||
|
|
||||||
await PageObjects.common.pressEnterKey();
|
await common.pressEnterKey();
|
||||||
|
|
||||||
await PageObjects.common.expectConfirmModalOpenState(false);
|
await common.expectConfirmModalOpenState(false);
|
||||||
|
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
||||||
});
|
});
|
||||||
|
@ -72,7 +72,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await listingTable.checkListingSelectAllCheckbox();
|
await listingTable.checkListingSelectAllCheckbox();
|
||||||
await listingTable.clickDeleteSelected();
|
await listingTable.clickDeleteSelected();
|
||||||
|
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
|
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 0);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 0);
|
||||||
});
|
});
|
||||||
|
@ -81,9 +81,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('search', function () {
|
describe('search', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await listingTable.clearSearchFilter();
|
await listingTable.clearSearchFilter();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard('Two Words');
|
await dashboard.saveDashboard('Two Words');
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('matches on the first word', async function () {
|
it('matches on the first word', async function () {
|
||||||
|
@ -125,37 +125,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const useTimeStamp = true;
|
const useTimeStamp = true;
|
||||||
await browser.get(newUrl.toString(), useTimeStamp);
|
await browser.get(newUrl.toString(), useTimeStamp);
|
||||||
|
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage();
|
const onDashboardLandingPage = await dashboard.onDashboardLandingPage();
|
||||||
expect(onDashboardLandingPage).to.equal(false);
|
expect(onDashboardLandingPage).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('title match is case insensitive', async function () {
|
it('title match is case insensitive', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const newUrl = currentUrl + '&title=two%20words';
|
const newUrl = currentUrl + '&title=two%20words';
|
||||||
// Only works on a hard refresh.
|
// Only works on a hard refresh.
|
||||||
const useTimeStamp = true;
|
const useTimeStamp = true;
|
||||||
await browser.get(newUrl.toString(), useTimeStamp);
|
await browser.get(newUrl.toString(), useTimeStamp);
|
||||||
|
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage();
|
const onDashboardLandingPage = await dashboard.onDashboardLandingPage();
|
||||||
expect(onDashboardLandingPage).to.equal(false);
|
expect(onDashboardLandingPage).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('stays on listing page if title matches no dashboards', async function () {
|
it('stays on listing page if title matches no dashboards', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const newUrl = currentUrl + '&title=nodashboardsnamedme';
|
const newUrl = currentUrl + '&title=nodashboardsnamedme';
|
||||||
// Only works on a hard refresh.
|
// Only works on a hard refresh.
|
||||||
const useTimeStamp = true;
|
const useTimeStamp = true;
|
||||||
await browser.get(newUrl.toString(), useTimeStamp);
|
await browser.get(newUrl.toString(), useTimeStamp);
|
||||||
|
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage();
|
const onDashboardLandingPage = await dashboard.onDashboardLandingPage();
|
||||||
expect(onDashboardLandingPage).to.equal(true);
|
expect(onDashboardLandingPage).to.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -165,21 +165,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('stays on listing page if title matches two dashboards', async function () {
|
it('stays on listing page if title matches two dashboards', async function () {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard('two words', {
|
await dashboard.saveDashboard('two words', {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
needsConfirm: true,
|
needsConfirm: true,
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const newUrl = currentUrl + '&title=two%20words';
|
const newUrl = currentUrl + '&title=two%20words';
|
||||||
// Only works on a hard refresh.
|
// Only works on a hard refresh.
|
||||||
const useTimeStamp = true;
|
const useTimeStamp = true;
|
||||||
await browser.get(newUrl.toString(), useTimeStamp);
|
await browser.get(newUrl.toString(), useTimeStamp);
|
||||||
|
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage();
|
const onDashboardLandingPage = await dashboard.onDashboardLandingPage();
|
||||||
expect(onDashboardLandingPage).to.equal(true);
|
expect(onDashboardLandingPage).to.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -189,9 +189,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('matches a title with many special characters', async function () {
|
it('matches a title with many special characters', async function () {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard('i am !@#$%^&*()_+~`,.<>{}[]; so special');
|
await dashboard.saveDashboard('i am !@#$%^&*()_+~`,.<>{}[]; so special');
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
// Need to encode that one.
|
// Need to encode that one.
|
||||||
const newUrl =
|
const newUrl =
|
||||||
|
@ -201,24 +201,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const useTimeStamp = true;
|
const useTimeStamp = true;
|
||||||
await browser.get(newUrl.toString(), useTimeStamp);
|
await browser.get(newUrl.toString(), useTimeStamp);
|
||||||
|
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage();
|
const onDashboardLandingPage = await dashboard.onDashboardLandingPage();
|
||||||
expect(onDashboardLandingPage).to.equal(false);
|
expect(onDashboardLandingPage).to.equal(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('edit meta data', () => {
|
describe('edit meta data', () => {
|
||||||
it('saves changes to dashboard metadata', async () => {
|
it('saves changes to dashboard metadata', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickCreateDashboardPrompt();
|
await dashboard.clickCreateDashboardPrompt();
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await dashboardAddPanel.addEveryEmbeddableOnCurrentPage();
|
await dashboardAddPanel.addEveryEmbeddableOnCurrentPage();
|
||||||
await dashboardAddPanel.ensureAddPanelIsClosed();
|
await dashboardAddPanel.ensureAddPanelIsClosed();
|
||||||
await PageObjects.dashboard.saveDashboard(`${dashboardName}-editMetaData`);
|
await dashboard.saveDashboard(`${dashboardName}-editMetaData`);
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.searchForItemWithName(`${dashboardName}-editMetaData`);
|
await listingTable.searchForItemWithName(`${dashboardName}-editMetaData`);
|
||||||
await listingTable.inspectVisualization();
|
await listingTable.inspectVisualization();
|
||||||
await listingTable.editVisualizationDetails({
|
await listingTable.editVisualizationDetails({
|
||||||
|
@ -230,9 +230,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await listingTable.setSearchFilterValue('new description');
|
await listingTable.setSearchFilterValue('new description');
|
||||||
await listingTable.expectItemsCount('dashboard', 1);
|
await listingTable.expectItemsCount('dashboard', 1);
|
||||||
await listingTable.clickItemLink('dashboard', 'new title');
|
await listingTable.clickItemLink('dashboard', 'new title');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const newPanelCount = await PageObjects.dashboard.getPanelCount();
|
const newPanelCount = await dashboard.getPanelCount();
|
||||||
expect(newPanelCount).to.equal(originalPanelCount);
|
expect(newPanelCount).to.equal(originalPanelCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -241,14 +241,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const DASHBOARD_NAME = 'Insights Dashboard';
|
const DASHBOARD_NAME = 'Insights Dashboard';
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard(DASHBOARD_NAME, {
|
await dashboard.saveDashboard(DASHBOARD_NAME, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
waitDialogIsClosed: false,
|
waitDialogIsClosed: false,
|
||||||
exitFromEditMode: false,
|
exitFromEditMode: false,
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows the insights panel and counts the views', async () => {
|
it('shows the insights panel and counts the views', async () => {
|
||||||
|
@ -268,8 +268,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(views1).to.be(1);
|
expect(views1).to.be(1);
|
||||||
|
|
||||||
await listingTable.clickItemLink('dashboard', DASHBOARD_NAME);
|
await listingTable.clickItemLink('dashboard', DASHBOARD_NAME);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
const views2 = await getViewsCount();
|
const views2 = await getViewsCount();
|
||||||
expect(views2).to.be(2);
|
expect(views2).to.be(2);
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']);
|
const { dashboard, header, visualize } = getPageObjects(['dashboard', 'header', 'visualize']);
|
||||||
const listingTable = getService('listingTable');
|
const listingTable = getService('listingTable');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
|
@ -23,64 +23,64 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('create new', () => {
|
describe('create new', () => {
|
||||||
it('warns on duplicate name for new dashboard', async function () {
|
it('warns on duplicate name for new dashboard', async function () {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
await dashboard.saveDashboard(dashboardName);
|
||||||
|
|
||||||
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: false });
|
await dashboard.expectDuplicateTitleWarningDisplayed({ displayed: false });
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
await dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
||||||
waitDialogIsClosed: false,
|
waitDialogIsClosed: false,
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
await dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not save on reject confirmation', async function () {
|
it('does not save on reject confirmation', async function () {
|
||||||
await PageObjects.dashboard.cancelSave();
|
await dashboard.cancelSave();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Saves on confirm duplicate title warning', async function () {
|
it('Saves on confirm duplicate title warning', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
await dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
||||||
waitDialogIsClosed: false,
|
waitDialogIsClosed: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.ensureDuplicateTitleCallout();
|
await dashboard.ensureDuplicateTitleCallout();
|
||||||
await PageObjects.dashboard.clickSave();
|
await dashboard.clickSave();
|
||||||
|
|
||||||
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
||||||
// wait till it finishes reloading or it might reload the url after simulating the
|
// wait till it finishes reloading or it might reload the url after simulating the
|
||||||
// dashboard landing page click.
|
// dashboard landing page click.
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// after saving a new dashboard, the app state must be removed
|
// after saving a new dashboard, the app state must be removed
|
||||||
await await PageObjects.dashboard.expectAppStateRemovedFromURL();
|
await await dashboard.expectAppStateRemovedFromURL();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 2);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardName, 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Saves new Dashboard using the Enter key', async function () {
|
it('Saves new Dashboard using the Enter key', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.enterDashboardTitleAndPressEnter(dashboardNameEnterKey);
|
await dashboard.enterDashboardTitleAndPressEnter(dashboardNameEnterKey);
|
||||||
|
|
||||||
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
||||||
// wait till it finishes reloading or it might reload the url after simulating the
|
// wait till it finishes reloading or it might reload the url after simulating the
|
||||||
// dashboard landing page click.
|
// dashboard landing page click.
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
await listingTable.searchAndExpectItemsCount('dashboard', dashboardNameEnterKey, 1);
|
await listingTable.searchAndExpectItemsCount('dashboard', dashboardNameEnterKey, 1);
|
||||||
});
|
});
|
||||||
|
@ -88,63 +88,63 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('quick save', () => {
|
describe('quick save', () => {
|
||||||
it('Does not show quick save menu item on a new dashboard', async function () {
|
it('Does not show quick save menu item on a new dashboard', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.expectMissingQuickSaveOption();
|
await dashboard.expectMissingQuickSaveOption();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Does not show dashboard save modal when on quick save', async function () {
|
it('Does not show dashboard save modal when on quick save', async function () {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.saveDashboard('test quick save');
|
await dashboard.saveDashboard('test quick save');
|
||||||
|
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.expectExistsQuickSaveOption();
|
await dashboard.expectExistsQuickSaveOption();
|
||||||
await dashboardAddPanel.clickMarkdownQuickButton();
|
await dashboardAddPanel.clickMarkdownQuickButton();
|
||||||
await PageObjects.visualize.saveVisualizationAndReturn();
|
await visualize.saveVisualizationAndReturn();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
|
|
||||||
await testSubjects.existOrFail('saveDashboardSuccess');
|
await testSubjects.existOrFail('saveDashboardSuccess');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Stays in edit mode after performing a quick save', async function () {
|
it('Stays in edit mode after performing a quick save', async function () {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await testSubjects.existOrFail('dashboardQuickSaveMenuItem');
|
await testSubjects.existOrFail('dashboardQuickSaveMenuItem');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('duplication (edit mode)', () => {
|
describe('duplication (edit mode)', () => {
|
||||||
it('Warns you when you Save as New Dashboard, and the title is a duplicate', async function () {
|
it('Warns you when you Save as New Dashboard, and the title is a duplicate', async function () {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
await dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(dashboardName, {
|
||||||
waitDialogIsClosed: false,
|
waitDialogIsClosed: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
await dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
||||||
|
|
||||||
await PageObjects.dashboard.cancelSave();
|
await dashboard.cancelSave();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Does not warn when only the prefix matches', async function () {
|
it('Does not warn when only the prefix matches', async function () {
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName.split(' ')[0]);
|
await dashboard.saveDashboard(dashboardName.split(' ')[0]);
|
||||||
|
|
||||||
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: false });
|
await dashboard.expectDuplicateTitleWarningDisplayed({ displayed: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Warns when case is different', async function () {
|
it('Warns when case is different', async function () {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(
|
await dashboard.enterDashboardSaveModalApplyUpdatesAndClickSave(
|
||||||
dashboardName.toUpperCase(),
|
dashboardName.toUpperCase(),
|
||||||
{
|
{
|
||||||
waitDialogIsClosed: false,
|
waitDialogIsClosed: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
await dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
|
||||||
|
|
||||||
await PageObjects.dashboard.cancelSave();
|
await dashboard.cancelSave();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -152,17 +152,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardNameFlyout = 'Dashboard Save Test with Flyout';
|
const dashboardNameFlyout = 'Dashboard Save Test with Flyout';
|
||||||
|
|
||||||
it('Does not warn when you save an existing dashboard with the title it already has', async function () {
|
it('Does not warn when you save an existing dashboard with the title it already has', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.enterDashboardTitleAndPressEnter(dashboardNameFlyout);
|
await dashboard.enterDashboardTitleAndPressEnter(dashboardNameFlyout);
|
||||||
|
|
||||||
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
// This is important since saving a new dashboard will cause a refresh of the page. We have to
|
||||||
// wait till it finishes reloading or it might reload the url after simulating the
|
// wait till it finishes reloading or it might reload the url after simulating the
|
||||||
// dashboard landing page click.
|
// dashboard landing page click.
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.modifyExistingDashboardDetails(dashboardNameFlyout);
|
await dashboard.modifyExistingDashboardDetails(dashboardNameFlyout);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,64 +14,62 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
const dashboardName = 'Dashboard Test Time';
|
const dashboardName = 'Dashboard Test Time';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker']);
|
const { dashboard, header, timePicker } = getPageObjects(['dashboard', 'header', 'timePicker']);
|
||||||
const pieChart = getService('pieChart');
|
const pieChart = getService('pieChart');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
|
||||||
describe('dashboard time', () => {
|
describe('dashboard time', () => {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.dashboard.initTests();
|
await dashboard.initTests();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('dashboard without stored timed', () => {
|
describe('dashboard without stored timed', () => {
|
||||||
it('is saved', async () => {
|
it('is saved', async () => {
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.addVisualizations([
|
await dashboard.addVisualizations([dashboard.getTestVisualizationNames()[0]]);
|
||||||
PageObjects.dashboard.getTestVisualizationNames()[0],
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
]);
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
|
||||||
storeTimeWithDashboard: false,
|
storeTimeWithDashboard: false,
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Does not set the time picker on open', async () => {
|
it('Does not set the time picker on open', async () => {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
|
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal(PageObjects.timePicker.defaultStartTime);
|
expect(time.start).to.equal(timePicker.defaultStartTime);
|
||||||
expect(time.end).to.equal(PageObjects.timePicker.defaultEndTime);
|
expect(time.end).to.equal(timePicker.defaultEndTime);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('dashboard with stored timed', function () {
|
describe('dashboard with stored timed', function () {
|
||||||
it('is saved with time', async function () {
|
it('is saved with time', async function () {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sets time on open', async function () {
|
it('sets time on open', async function () {
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2019 @ 00:00:00.000',
|
'Jan 1, 2019 @ 00:00:00.000',
|
||||||
'Jan 2, 2019 @ 00:00:00.000'
|
'Jan 2, 2019 @ 00:00:00.000'
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal(PageObjects.timePicker.defaultStartTime);
|
expect(time.start).to.equal(timePicker.defaultStartTime);
|
||||||
expect(time.end).to.equal(PageObjects.timePicker.defaultEndTime);
|
expect(time.end).to.equal(timePicker.defaultEndTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
// If time is stored with a dashboard, it's supposed to override the current time settings when opened.
|
// If time is stored with a dashboard, it's supposed to override the current time settings when opened.
|
||||||
|
@ -80,13 +78,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should be overwritten by global state', async function () {
|
it('should be overwritten by global state', async function () {
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
||||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const id = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(time:(from:now-1h,to:now))`;
|
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(time:(from:now-1h,to:now))`;
|
||||||
await browser.get(urlWithGlobalTime, false);
|
await browser.get(urlWithGlobalTime, false);
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal('~ an hour ago');
|
expect(time.start).to.equal('~ an hour ago');
|
||||||
expect(time.end).to.equal('now');
|
expect(time.end).to.equal('now');
|
||||||
|
|
||||||
|
@ -100,39 +98,39 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should use saved time, if time is missing in global state, but _g is present in the url', async function () {
|
it('should use saved time, if time is missing in global state, but _g is present in the url', async function () {
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
||||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const id = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(filters:!())`;
|
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(filters:!())`;
|
||||||
await browser.get(urlWithGlobalTime, false);
|
await browser.get(urlWithGlobalTime, false);
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal(PageObjects.timePicker.defaultStartTime);
|
expect(time.start).to.equal(timePicker.defaultStartTime);
|
||||||
expect(time.end).to.equal(PageObjects.timePicker.defaultEndTime);
|
expect(time.end).to.equal(timePicker.defaultEndTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should use saved time after time change is undone', async function () {
|
it('should use saved time after time change is undone', async function () {
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
const kibanaBaseUrl = currentUrl.substring(0, currentUrl.indexOf('#'));
|
||||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const id = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
|
|
||||||
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(filters:!())`;
|
const urlWithGlobalTime = `${kibanaBaseUrl}#/view/${id}?_g=(filters:!())`;
|
||||||
await browser.get(urlWithGlobalTime, false);
|
await browser.get(urlWithGlobalTime, false);
|
||||||
|
|
||||||
// set the time to something else
|
// set the time to something else
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2019 @ 00:00:00.000',
|
'Jan 1, 2019 @ 00:00:00.000',
|
||||||
'Jan 2, 2019 @ 00:00:00.000'
|
'Jan 2, 2019 @ 00:00:00.000'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
|
|
||||||
// time should have restored to the saved time range.
|
// time should have restored to the saved time range.
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal(PageObjects.timePicker.defaultStartTime);
|
expect(time.start).to.equal(timePicker.defaultStartTime);
|
||||||
expect(time.end).to.equal(PageObjects.timePicker.defaultEndTime);
|
expect(time.end).to.equal(timePicker.defaultEndTime);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -142,16 +140,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// during navigation or page refreshes.
|
// during navigation or page refreshes.
|
||||||
describe('time changes', function () {
|
describe('time changes', function () {
|
||||||
it('preserved during navigation', async function () {
|
it('preserved during navigation', async function () {
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2019 @ 00:00:00.000',
|
'Jan 1, 2019 @ 00:00:00.000',
|
||||||
'Jan 2, 2019 @ 00:00:00.000'
|
'Jan 2, 2019 @ 00:00:00.000'
|
||||||
);
|
);
|
||||||
await PageObjects.header.clickVisualize();
|
await header.clickVisualize();
|
||||||
await PageObjects.header.clickDashboard();
|
await header.clickDashboard();
|
||||||
|
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.equal('Jan 1, 2019 @ 00:00:00.000');
|
expect(time.start).to.equal('Jan 1, 2019 @ 00:00:00.000');
|
||||||
expect(time.end).to.equal('Jan 2, 2019 @ 00:00:00.000');
|
expect(time.end).to.equal('Jan 2, 2019 @ 00:00:00.000');
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -36,11 +36,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('after navigation from listing page to dashboard back button works', async () => {
|
it('after navigation from listing page to dashboard back button works', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with everything');
|
await dashboard.loadSavedDashboard('dashboard with everything');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
expect(await PageObjects.dashboard.onDashboardLandingPage()).to.be(true);
|
expect(await dashboard.onDashboardLandingPage()).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'common']);
|
const { dashboard, header } = getPageObjects(['dashboard', 'header']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
|
@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load(
|
await kibanaServer.importExport.load(
|
||||||
'test/functional/fixtures/kbn_archiver/dashboard_error_cases.json'
|
'test/functional/fixtures/kbn_archiver/dashboard_error_cases.json'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -42,11 +42,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('correctly loads default index pattern on first load with an error embeddable', async () => {
|
it('correctly loads default index pattern on first load with an error embeddable', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('Dashboard with Missing Lens Panel');
|
await dashboard.loadSavedDashboard('Dashboard with Missing Lens Panel');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
await filterBar.addFilter({ field: 'bytes', operation: 'is', value: '12345678' });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await filterBar.getFilterCount()).to.be(1);
|
expect(await filterBar.getFilterCount()).to.be(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122
|
// see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122
|
||||||
describe('when the saved object is missing', () => {
|
describe('when the saved object is missing', () => {
|
||||||
it('shows the missing data view error message', async () => {
|
it('shows the missing data view error message', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with missing index pattern');
|
await dashboard.loadSavedDashboard('dashboard with missing index pattern');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const embeddableError = await testSubjects.find('embeddableError');
|
const embeddableError = await testSubjects.find('embeddableError');
|
||||||
const errorMessage = await embeddableError.getVisibleText();
|
const errorMessage = await embeddableError.getVisibleText();
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'discover']);
|
const { dashboard, discover } = getPageObjects(['dashboard', 'discover']);
|
||||||
|
|
||||||
describe('dashboard query bar', () => {
|
describe('dashboard query bar', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -30,9 +30,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with filter');
|
await dashboard.loadSavedDashboard('dashboard with filter');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
|
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await retry.tryForTime(5000, async () => {
|
await retry.tryForTime(5000, async () => {
|
||||||
const headers = await PageObjects.discover.getColumnHeaders();
|
const headers = await discover.getColumnHeaders();
|
||||||
expect(headers.length).to.be(0);
|
expect(headers.length).to.be(0);
|
||||||
await pieChart.expectEmptyPieChart();
|
await pieChart.expectEmptyPieChart();
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const globalNav = getService('globalNav');
|
const globalNav = getService('globalNav');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardSettings = getService('dashboardSettings');
|
const dashboardSettings = getService('dashboardSettings');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
describe('dashboard settings', () => {
|
describe('dashboard settings', () => {
|
||||||
let originalTitles: string[] = [];
|
let originalTitles: string[] = [];
|
||||||
|
@ -38,11 +38,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
originalTitles = await PageObjects.dashboard.getPanelTitles();
|
originalTitles = await dashboard.getPanelTitles();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -50,21 +50,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to hide all panel titles', async () => {
|
it('should be able to hide all panel titles', async () => {
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.toggleShowPanelTitles(false);
|
await dashboardSettings.toggleShowPanelTitles(false);
|
||||||
await dashboardSettings.clickApplyButton();
|
await dashboardSettings.clickApplyButton();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const titles = await PageObjects.dashboard.getPanelTitles();
|
const titles = await dashboard.getPanelTitles();
|
||||||
expect(titles[0]).to.eql(undefined);
|
expect(titles[0]).to.eql(undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to unhide all panel titles', async () => {
|
it('should be able to unhide all panel titles', async () => {
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.toggleShowPanelTitles(true);
|
await dashboardSettings.toggleShowPanelTitles(true);
|
||||||
await dashboardSettings.clickApplyButton();
|
await dashboardSettings.clickApplyButton();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const titles = await PageObjects.dashboard.getPanelTitles();
|
const titles = await dashboard.getPanelTitles();
|
||||||
expect(titles[0]).to.eql(originalTitles[0]);
|
expect(titles[0]).to.eql(originalTitles[0]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -73,7 +73,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await checkDashboardTitle('few panels');
|
await checkDashboardTitle('few panels');
|
||||||
|
|
||||||
const newTitle = 'My awesome dashboard!!1';
|
const newTitle = 'My awesome dashboard!!1';
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.setCustomPanelTitle(newTitle);
|
await dashboardSettings.setCustomPanelTitle(newTitle);
|
||||||
await dashboardSettings.clickApplyButton();
|
await dashboardSettings.clickApplyButton();
|
||||||
|
|
||||||
|
@ -81,25 +81,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should disable quick save when the settings are open', async () => {
|
it('should disable quick save when the settings are open', async () => {
|
||||||
await PageObjects.dashboard.expectQuickSaveButtonEnabled();
|
await dashboard.expectQuickSaveButtonEnabled();
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await PageObjects.dashboard.expectQuickSaveButtonDisabled();
|
await dashboard.expectQuickSaveButtonDisabled();
|
||||||
});
|
});
|
||||||
await dashboardSettings.clickCancelButton();
|
await dashboardSettings.clickCancelButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should enable quick save when the settings flyout is closed', async () => {
|
it('should enable quick save when the settings flyout is closed', async () => {
|
||||||
await PageObjects.dashboard.expectQuickSaveButtonEnabled();
|
await dashboard.expectQuickSaveButtonEnabled();
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.clickCloseFlyoutButton();
|
await dashboardSettings.clickCloseFlyoutButton();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await PageObjects.dashboard.expectQuickSaveButtonEnabled();
|
await dashboard.expectQuickSaveButtonEnabled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should warn when creating a duplicate title', async () => {
|
it('should warn when creating a duplicate title', async () => {
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.setCustomPanelTitle('couple panels');
|
await dashboardSettings.setCustomPanelTitle('couple panels');
|
||||||
await dashboardSettings.clickApplyButton(false);
|
await dashboardSettings.clickApplyButton(false);
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
|
@ -110,7 +110,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should allow duplicate title if warned once', async () => {
|
it('should allow duplicate title if warned once', async () => {
|
||||||
const newTitle = 'couple panels';
|
const newTitle = 'couple panels';
|
||||||
await PageObjects.dashboard.openSettingsFlyout();
|
await dashboard.openSettingsFlyout();
|
||||||
await dashboardSettings.setCustomPanelTitle(newTitle);
|
await dashboardSettings.setCustomPanelTitle(newTitle);
|
||||||
await dashboardSettings.clickApplyButton(false);
|
await dashboardSettings.clickApplyButton(false);
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const dashboardCustomizePanel = getService('dashboardCustomizePanel');
|
const dashboardCustomizePanel = getService('dashboardCustomizePanel');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
|
const { dashboard, timePicker } = getPageObjects(['dashboard', 'timePicker']);
|
||||||
|
|
||||||
describe('dashboard data-shared attributes', function describeIndexTests() {
|
describe('dashboard data-shared attributes', function describeIndexTests() {
|
||||||
let originalPanelTitles: string[];
|
let originalPanelTitles: string[];
|
||||||
|
@ -31,10 +31,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with everything');
|
await dashboard.loadSavedDashboard('dashboard with everything');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -44,29 +44,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should have time picker with data-shared-timefilter-duration', async () => {
|
it('should have time picker with data-shared-timefilter-duration', async () => {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.timePicker.getTimeDurationForSharing();
|
const sharedData = await timePicker.getTimeDurationForSharing();
|
||||||
expect(sharedData).to.not.be(null);
|
expect(sharedData).to.not.be(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have data-shared-items-count set to the number of embeddables on the dashboard', async () => {
|
it('should have data-shared-items-count set to the number of embeddables on the dashboard', async () => {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedItemsCount = await PageObjects.dashboard.getSharedItemsCount();
|
const sharedItemsCount = await dashboard.getSharedItemsCount();
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(sharedItemsCount).to.eql(panelCount);
|
expect(sharedItemsCount).to.eql(panelCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have panels with expected data-shared-item title', async () => {
|
it('should have panels with expected data-shared-item title', async () => {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
|
const sharedData = await dashboard.getPanelSharedItemData();
|
||||||
originalPanelTitles = await PageObjects.dashboard.getPanelTitles();
|
originalPanelTitles = await dashboard.getPanelTitles();
|
||||||
expect(sharedData.map((item) => item.title)).to.eql(originalPanelTitles);
|
expect(sharedData.map((item) => item.title)).to.eql(originalPanelTitles);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('data shared item container data has description and title set', async () => {
|
it('data shared item container data has description and title set', async () => {
|
||||||
const sharedContainerData = await PageObjects.dashboard.getSharedContainerData();
|
const sharedContainerData = await dashboard.getSharedContainerData();
|
||||||
expect(sharedContainerData.title).to.be('dashboard with everything');
|
expect(sharedContainerData.title).to.be('dashboard with everything');
|
||||||
expect(sharedContainerData.description).to.be(
|
expect(sharedContainerData.description).to.be(
|
||||||
'I have one of every visualization type since the last time I was created!'
|
'I have one of every visualization type since the last time I was created!'
|
||||||
|
@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('data-shared-item title should update a viz when using a custom panel title', async () => {
|
it('data-shared-item title should update a viz when using a custom panel title', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
const CUSTOM_VIS_TITLE = 'ima custom title for a vis!';
|
const CUSTOM_VIS_TITLE = 'ima custom title for a vis!';
|
||||||
await dashboardPanelActions.customizePanel();
|
await dashboardPanelActions.customizePanel();
|
||||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
||||||
|
@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
|
const sharedData = await dashboard.getPanelSharedItemData();
|
||||||
const foundSharedItemTitle = !!sharedData.find((item) => {
|
const foundSharedItemTitle = !!sharedData.find((item) => {
|
||||||
return item.title === CUSTOM_VIS_TITLE;
|
return item.title === CUSTOM_VIS_TITLE;
|
||||||
});
|
});
|
||||||
|
@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await toggleHideTitle();
|
await toggleHideTitle();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
|
const sharedData = await dashboard.getPanelSharedItemData();
|
||||||
const foundSharedItemTitle = !!sharedData.find((item) => {
|
const foundSharedItemTitle = !!sharedData.find((item) => {
|
||||||
return item.title === '';
|
return item.title === '';
|
||||||
});
|
});
|
||||||
|
@ -112,14 +112,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('data-shared-item title can be reset', async () => {
|
it('data-shared-item title can be reset', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await dashboardPanelActions.customizePanel();
|
await dashboardPanelActions.customizePanel();
|
||||||
await dashboardCustomizePanel.resetCustomPanelTitle();
|
await dashboardCustomizePanel.resetCustomPanelTitle();
|
||||||
await dashboardCustomizePanel.clickSaveButton();
|
await dashboardCustomizePanel.clickSaveButton();
|
||||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
|
const sharedData = await dashboard.getPanelSharedItemData();
|
||||||
const foundOriginalSharedItemTitle = !!sharedData.find((item) => {
|
const foundOriginalSharedItemTitle = !!sharedData.find((item) => {
|
||||||
return item.title === originalPanelTitles[0];
|
return item.title === originalPanelTitles[0];
|
||||||
});
|
});
|
||||||
|
@ -128,16 +128,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('data-shared-item title should update a saved search when using a custom panel title', async () => {
|
it('data-shared-item title should update a saved search when using a custom panel title', async () => {
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
const CUSTOM_SEARCH_TITLE = 'ima custom title for a search!';
|
const CUSTOM_SEARCH_TITLE = 'ima custom title for a search!';
|
||||||
await dashboardPanelActions.customizePanelByTitle('Rendering Test: saved search');
|
await dashboardPanelActions.customizePanel('Rendering Test: saved search');
|
||||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
||||||
await dashboardCustomizePanel.setCustomPanelTitle(CUSTOM_SEARCH_TITLE);
|
await dashboardCustomizePanel.setCustomPanelTitle(CUSTOM_SEARCH_TITLE);
|
||||||
await dashboardCustomizePanel.clickSaveButton();
|
await dashboardCustomizePanel.clickSaveButton();
|
||||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const sharedData = await PageObjects.dashboard.getPanelSharedItemData();
|
const sharedData = await dashboard.getPanelSharedItemData();
|
||||||
const foundSharedItemTitle = !!sharedData.find((item) => {
|
const foundSharedItemTitle = !!sharedData.find((item) => {
|
||||||
return item.title === CUSTOM_SEARCH_TITLE;
|
return item.title === CUSTOM_SEARCH_TITLE;
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default function ({
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'common']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const globalNav = getService('globalNav');
|
const globalNav = getService('globalNav');
|
||||||
const screenshot = getService('screenshots');
|
const screenshot = getService('screenshots');
|
||||||
|
@ -50,9 +50,9 @@ export default function ({
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('dashboard with everything');
|
await dashboard.loadSavedDashboard('dashboard with everything');
|
||||||
|
|
||||||
await browser.setWindowSize(1300, 900);
|
await browser.setWindowSize(1300, 900);
|
||||||
});
|
});
|
||||||
|
@ -82,7 +82,7 @@ export default function ({
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders as expected', async () => {
|
it('renders as expected', async () => {
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||||
'dashboard_embed_mode',
|
'dashboard_embed_mode',
|
||||||
updateBaselines
|
updateBaselines
|
||||||
|
@ -105,7 +105,7 @@ export default function ({
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders as expected', async () => {
|
it('renders as expected', async () => {
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||||
'dashboard_embed_mode_with_url_params',
|
'dashboard_embed_mode_with_url_params',
|
||||||
updateBaselines
|
updateBaselines
|
||||||
|
@ -114,7 +114,7 @@ export default function ({
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders as expected when scrolling', async () => {
|
it('renders as expected when scrolling', async () => {
|
||||||
const panels = await PageObjects.dashboard.getDashboardPanels();
|
const panels = await dashboard.getDashboardPanels();
|
||||||
const lastPanel = panels[panels.length - 1];
|
const lastPanel = panels[panels.length - 1];
|
||||||
const lastPanelHeight = -parseInt(await lastPanel.getComputedStyle('height'), 10);
|
const lastPanelHeight = -parseInt(await lastPanel.getComputedStyle('height'), 10);
|
||||||
log.debug(
|
log.debug(
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const dashboardVisualizations = getService('dashboardVisualizations');
|
const dashboardVisualizations = getService('dashboardVisualizations');
|
||||||
const dashboardExpect = getService('dashboardExpect');
|
const dashboardExpect = getService('dashboardExpect');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
describe('empty dashboard', () => {
|
describe('empty dashboard', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -28,14 +28,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await dashboardAddPanel.closeAddPanel();
|
await dashboardAddPanel.closeAddPanel();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,9 @@
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, header, timePicker, visualize, visEditor } = getPageObjects([
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'common',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'visualize',
|
'visualize',
|
||||||
'visEditor',
|
'visEditor',
|
||||||
|
@ -39,14 +38,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load(
|
await kibanaServer.importExport.load(
|
||||||
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana'
|
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
||||||
await PageObjects.dashboard.saveDashboard('legacyTest', {
|
await dashboard.saveDashboard('legacyTest', {
|
||||||
waitDialogIsClosed: true,
|
waitDialogIsClosed: true,
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
await log.debug(`Current url is ${currentUrl}`);
|
await log.debug(`Current url is ${currentUrl}`);
|
||||||
testDashboardId = /#\/view\/(.+)\?/.exec(currentUrl)![1];
|
testDashboardId = /#\/view\/(.+)\?/.exec(currentUrl)![1];
|
||||||
|
@ -58,7 +57,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await listingTable.deleteItem('legacyTest', testDashboardId);
|
await listingTable.deleteItem('legacyTest', testDashboardId);
|
||||||
await security.testUser.restoreDefaults();
|
await security.testUser.restoreDefaults();
|
||||||
});
|
});
|
||||||
|
@ -67,11 +66,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('redirects from old kibana app URL', async () => {
|
it('redirects from old kibana app URL', async () => {
|
||||||
const url = `${kibanaLegacyBaseUrl}#/dashboard/${testDashboardId}`;
|
const url = `${kibanaLegacyBaseUrl}#/dashboard/${testDashboardId}`;
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -79,27 +78,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const url = `${kibanaVisualizeBaseUrl}#/dashboard/${testDashboardId}`;
|
const url = `${kibanaVisualizeBaseUrl}#/dashboard/${testDashboardId}`;
|
||||||
await browser.get(url, true);
|
await browser.get(url, true);
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resolves markdown link', async () => {
|
it('resolves markdown link', async () => {
|
||||||
await PageObjects.visualize.navigateToNewVisualization();
|
await visualize.navigateToNewVisualization();
|
||||||
await PageObjects.visualize.clickMarkdownWidget();
|
await visualize.clickMarkdownWidget();
|
||||||
await PageObjects.visEditor.setMarkdownTxt(`[abc](#/dashboard/${testDashboardId})`);
|
await visEditor.setMarkdownTxt(`[abc](#/dashboard/${testDashboardId})`);
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
|
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess('legacy url markdown');
|
await visualize.saveVisualizationExpectSuccess('legacy url markdown');
|
||||||
|
|
||||||
await (await find.byLinkText('abc')).click();
|
await (await find.byLinkText('abc')).click();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -108,20 +107,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
// back to last app
|
// back to last app
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
await PageObjects.visEditor.expectMarkdownTextArea();
|
await visEditor.expectMarkdownTextArea();
|
||||||
await browser.goForward();
|
await browser.goForward();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resolves markdown link from dashboard', async () => {
|
it('resolves markdown link from dashboard', async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await dashboardAddPanel.addVisualization('legacy url markdown');
|
await dashboardAddPanel.addVisualization('legacy url markdown');
|
||||||
await (await find.byLinkText('abc')).click();
|
await (await find.byLinkText('abc')).click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await elasticChart.setNewChartUiDebugFlag(true);
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await pieChart.expectPieSliceCount(5);
|
await pieChart.expectPieSliceCount(5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker', 'discover']);
|
const { common, dashboard, header, discover } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'dashboard',
|
||||||
|
'header',
|
||||||
|
'discover',
|
||||||
|
]);
|
||||||
const from = 'Sep 22, 2015 @ 00:00:00.000';
|
const from = 'Sep 22, 2015 @ 00:00:00.000';
|
||||||
const to = 'Sep 23, 2015 @ 00:00:00.000';
|
const to = 'Sep 23, 2015 @ 00:00:00.000';
|
||||||
|
|
||||||
|
@ -32,23 +37,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.common.setTime({ from, to });
|
await common.setTime({ from, to });
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('highlighting on filtering works', async function () {
|
it('highlighting on filtering works', async function () {
|
||||||
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
||||||
await filterBar.addFilter({ field: 'agent', operation: 'is', value: 'Mozilla' });
|
await filterBar.addFilter({ field: 'agent', operation: 'is', value: 'Mozilla' });
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const dataTable = await find.byCssSelector(`[data-test-subj="embeddedSavedSearchDocTable"]`);
|
const dataTable = await find.byCssSelector(`[data-test-subj="embeddedSavedSearchDocTable"]`);
|
||||||
const $ = await dataTable.parseDomContent();
|
const $ = await dataTable.parseDomContent();
|
||||||
const marks = $('mark')
|
const marks = $('mark')
|
||||||
|
@ -59,8 +64,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('removing a filter removes highlights', async function () {
|
it('removing a filter removes highlights', async function () {
|
||||||
await filterBar.removeAllFilters();
|
await filterBar.removeAllFilters();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const dataTable = await find.byCssSelector(`[data-test-subj="embeddedSavedSearchDocTable"]`);
|
const dataTable = await find.byCssSelector(`[data-test-subj="embeddedSavedSearchDocTable"]`);
|
||||||
const $ = await dataTable.parseDomContent();
|
const $ = await dataTable.parseDomContent();
|
||||||
const marks = $('mark')
|
const marks = $('mark')
|
||||||
|
@ -71,22 +76,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('view action leads to a saved search', async function () {
|
it('view action leads to a saved search', async function () {
|
||||||
await filterBar.removeAllFilters();
|
await filterBar.removeAllFilters();
|
||||||
await PageObjects.dashboard.saveDashboard('Dashboard With Saved Search');
|
await dashboard.saveDashboard('Dashboard With Saved Search');
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
const inViewMode = await PageObjects.dashboard.getIsInViewMode();
|
const inViewMode = await dashboard.getIsInViewMode();
|
||||||
expect(inViewMode).to.equal(true);
|
expect(inViewMode).to.equal(true);
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
await dashboardPanelActions.clickContextMenuItem(
|
await dashboardPanelActions.clickContextMenuItem(
|
||||||
'embeddablePanelAction-ACTION_VIEW_SAVED_SEARCH'
|
'embeddablePanelAction-ACTION_VIEW_SAVED_SEARCH'
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.discover.waitForDiscoverAppOnScreen();
|
await discover.waitForDiscoverAppOnScreen();
|
||||||
expect(await PageObjects.discover.getSavedSearchTitle()).to.equal(
|
expect(await discover.getSavedSearchTitle()).to.equal('Rendering Test: saved search');
|
||||||
'Rendering Test: saved search'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,19 +43,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const dashboardCustomizePanel = getService('dashboardCustomizePanel');
|
const dashboardCustomizePanel = getService('dashboardCustomizePanel');
|
||||||
|
|
||||||
const PageObjects = getPageObjects(['dashboard', 'common', 'share', 'timePicker']);
|
const { dashboard, common, share } = getPageObjects(['dashboard', 'common', 'share']);
|
||||||
|
|
||||||
const getSharedUrl = async (mode: TestingModes): Promise<string> => {
|
const getSharedUrl = async (mode: TestingModes): Promise<string> => {
|
||||||
await retry.waitFor('share menu to open', async () => {
|
await retry.waitFor('share menu to open', async () => {
|
||||||
await PageObjects.share.clickShareTopNavButton();
|
await share.clickShareTopNavButton();
|
||||||
return await PageObjects.share.isShareMenuOpen();
|
return await share.isShareMenuOpen();
|
||||||
});
|
});
|
||||||
return await PageObjects.share.getSharedUrl();
|
return await share.getSharedUrl();
|
||||||
};
|
};
|
||||||
|
|
||||||
const unpinnedFilterIsOnlyWhenDashboardIsUnsaved = async (mode: TestingModes) => {
|
const unpinnedFilterIsOnlyWhenDashboardIsUnsaved = async (mode: TestingModes) => {
|
||||||
await filterBar.addFilter({ field: 'geo.src', operation: 'is', value: 'AE' });
|
await filterBar.addFilter({ field: 'geo.src', operation: 'is', value: 'AE' });
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const sharedUrl = await getSharedUrl(mode);
|
const sharedUrl = await getSharedUrl(mode);
|
||||||
const { globalState, appState } = getStateFromUrl(sharedUrl);
|
const { globalState, appState } = getStateFromUrl(sharedUrl);
|
||||||
|
@ -68,8 +68,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const unpinnedFilterIsRemoved = async (mode: TestingModes) => {
|
const unpinnedFilterIsRemoved = async (mode: TestingModes) => {
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const sharedUrl = await getSharedUrl(mode);
|
const sharedUrl = await getSharedUrl(mode);
|
||||||
expect(sharedUrl).to.not.contain('appState');
|
expect(sharedUrl).to.not.contain('appState');
|
||||||
|
@ -77,8 +77,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
const pinnedFilterIsWhenDashboardInGlobalState = async (mode: TestingModes) => {
|
const pinnedFilterIsWhenDashboardInGlobalState = async (mode: TestingModes) => {
|
||||||
await filterBar.toggleFilterPinned('geo.src');
|
await filterBar.toggleFilterPinned('geo.src');
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
const sharedUrl = await getSharedUrl(mode);
|
const sharedUrl = await getSharedUrl(mode);
|
||||||
const { globalState, appState } = getStateFromUrl(sharedUrl);
|
const { globalState, appState } = getStateFromUrl(sharedUrl);
|
||||||
|
@ -99,17 +99,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
const from = 'Sep 19, 2017 @ 06:31:44.000';
|
const from = 'Sep 19, 2017 @ 06:31:44.000';
|
||||||
const to = 'Sep 23, 2018 @ 18:31:44.000';
|
const to = 'Sep 23, 2018 @ 18:31:44.000';
|
||||||
await PageObjects.common.setTime({ from, to });
|
await common.setTime({ from, to });
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('snapshot share', () => {
|
describe('snapshot share', () => {
|
||||||
|
@ -123,7 +123,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardPanelActions.customizePanel();
|
await dashboardPanelActions.customizePanel();
|
||||||
await dashboardCustomizePanel.setCustomPanelTitle('Test New Title');
|
await dashboardCustomizePanel.setCustomPanelTitle('Test New Title');
|
||||||
await dashboardCustomizePanel.clickSaveButton();
|
await dashboardCustomizePanel.clickSaveButton();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await testSubjects.existOrFail('dashboardUnsavedChangesBadge');
|
await testSubjects.existOrFail('dashboardUnsavedChangesBadge');
|
||||||
|
|
||||||
const sharedUrl = await getSharedUrl('snapshot');
|
const sharedUrl = await getSharedUrl('snapshot');
|
||||||
|
@ -132,8 +132,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should once again not have "panels" state when save is clicked', async () => {
|
it('should once again not have "panels" state when save is clicked', async () => {
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await testSubjects.missingOrFail('dashboardUnsavedChangesBadge');
|
await testSubjects.missingOrFail('dashboardUnsavedChangesBadge');
|
||||||
expect(await getSharedUrl('snapshot')).to.not.contain('panels');
|
expect(await getSharedUrl('snapshot')).to.not.contain('panels');
|
||||||
});
|
});
|
||||||
|
@ -161,8 +161,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await filterBar.removeAllFilters();
|
await filterBar.removeAllFilters();
|
||||||
await PageObjects.dashboard.clickQuickSave();
|
await dashboard.clickQuickSave();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker', 'header']);
|
const { dashboard, timePicker, header } = getPageObjects(['dashboard', 'timePicker', 'header']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const monacoEditor = getService('monacoEditor');
|
const monacoEditor = getService('monacoEditor');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
|
@ -31,17 +31,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add an ES|QL datatable chart when the ES|QL panel action is clicked', async () => {
|
it('should add an ES|QL datatable chart when the ES|QL panel action is clicked', async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
|
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
|
||||||
await dashboardAddPanel.expectEditorMenuClosed();
|
await dashboardAddPanel.expectEditorMenuClosed();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(1);
|
expect(panelCount).to.eql(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should remove the panel if cancel button is clicked', async () => {
|
it('should remove the panel if cancel button is clicked', async () => {
|
||||||
await testSubjects.click('cancelFlyoutButton');
|
await testSubjects.click('cancelFlyoutButton');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(0);
|
expect(panelCount).to.eql(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -61,11 +61,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
|
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
|
||||||
await dashboardAddPanel.expectEditorMenuClosed();
|
await dashboardAddPanel.expectEditorMenuClosed();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue('from logstash-* | stats maxB = max(bytes)');
|
await monacoEditor.setCodeEditorValue('from logstash-* | stats maxB = max(bytes)');
|
||||||
await testSubjects.click('TextBasedLangEditor-run-query-button');
|
await testSubjects.click('TextBasedLangEditor-run-query-button');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.click('applyFlyoutButton');
|
await testSubjects.click('applyFlyoutButton');
|
||||||
expect(await testSubjects.exists('mtrVis')).to.be(true);
|
expect(await testSubjects.exists('mtrVis')).to.be(true);
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
describe('dashboard grid', function () {
|
describe('dashboard grid', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -26,10 +26,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
|
const { dashboard, timePicker } = getPageObjects(['dashboard', 'timePicker']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const savedQueryManagementComponent = getService('savedQueryManagementComponent');
|
const savedQueryManagementComponent = getService('savedQueryManagementComponent');
|
||||||
|
@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -38,8 +38,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// FLAKY: https://github.com/elastic/kibana/issues/189023
|
// FLAKY: https://github.com/elastic/kibana/issues/189023
|
||||||
describe.skip('saved query management component functionality', function () {
|
describe.skip('saved query management component functionality', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show the saved query management load button as disabled when there are no saved queries', async () => {
|
it('should show the saved query management load button as disabled when there are no saved queries', async () => {
|
||||||
|
@ -71,19 +71,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => {
|
it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await savedQueryManagementComponent.clearCurrentlyLoadedQuery();
|
await savedQueryManagementComponent.clearCurrentlyLoadedQuery();
|
||||||
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
||||||
const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();
|
const timePickerValues = await timePicker.getTimeConfigAsAbsoluteTimes();
|
||||||
expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime);
|
expect(timePickerValues.start).to.not.eql(timePicker.defaultStartTime);
|
||||||
expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime);
|
expect(timePickerValues.end).to.not.eql(timePicker.defaultEndTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('preserves the currently loaded query when the page is reloaded', async () => {
|
it('preserves the currently loaded query when the page is reloaded', async () => {
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();
|
const timePickerValues = await timePicker.getTimeConfigAsAbsoluteTimes();
|
||||||
expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime);
|
expect(timePickerValues.start).to.not.eql(timePicker.defaultStartTime);
|
||||||
expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime);
|
expect(timePickerValues.end).to.not.eql(timePicker.defaultEndTime);
|
||||||
expect(await savedQueryManagementComponent.getCurrentlyLoadedQueryID()).to.be('OkResponse');
|
expect(await savedQueryManagementComponent.getCurrentlyLoadedQueryID()).to.be('OkResponse');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,10 @@ export default function ({
|
||||||
getPageObjects,
|
getPageObjects,
|
||||||
updateBaselines,
|
updateBaselines,
|
||||||
}: FtrProviderContext & { updateBaselines: boolean }) {
|
}: FtrProviderContext & { updateBaselines: boolean }) {
|
||||||
const PageObjects = getPageObjects([
|
const { dashboard, dashboardControls, header, timePicker } = getPageObjects([
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'dashboardControls',
|
'dashboardControls',
|
||||||
'header',
|
'header',
|
||||||
'visualize',
|
|
||||||
'common',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
]);
|
]);
|
||||||
const screenshot = getService('screenshots');
|
const screenshot = getService('screenshots');
|
||||||
|
@ -47,7 +45,7 @@ export default function ({
|
||||||
await browser.setScreenshotSize(1000, 500);
|
await browser.setScreenshotSize(1000, 500);
|
||||||
// adding this navigate adds the timestamp hash to the url which invalidates previous
|
// adding this navigate adds the timestamp hash to the url which invalidates previous
|
||||||
// session. If we don't do this, the colors on the visualizations are different and the screenshots won't match.
|
// session. If we don't do this, the colors on the visualizations are different and the screenshots won't match.
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -56,50 +54,50 @@ export default function ({
|
||||||
});
|
});
|
||||||
|
|
||||||
it('compare TSVB snapshot', async () => {
|
it('compare TSVB snapshot', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setLogstashDataRange();
|
await timePicker.setLogstashDataRange();
|
||||||
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
|
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
|
||||||
await toasts.dismissIfExists();
|
await toasts.dismissIfExists();
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard('tsvb');
|
await dashboard.saveDashboard('tsvb');
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||||
'tsvb_dashboard',
|
'tsvb_dashboard',
|
||||||
updateBaselines
|
updateBaselines
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickExitFullScreenLogoButton();
|
await dashboard.clickExitFullScreenLogoButton();
|
||||||
expect(percentDifference).to.be.lessThan(0.022);
|
expect(percentDifference).to.be.lessThan(0.022);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('compare area chart snapshot', async () => {
|
it('compare area chart snapshot', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setLogstashDataRange();
|
await timePicker.setLogstashDataRange();
|
||||||
await dashboardAddPanel.addVisualization('Rendering Test: area with not filter');
|
await dashboardAddPanel.addVisualization('Rendering Test: area with not filter');
|
||||||
await toasts.dismissIfExists();
|
await toasts.dismissIfExists();
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard('area');
|
await dashboard.saveDashboard('area');
|
||||||
await PageObjects.dashboard.clickFullScreenMode();
|
await dashboard.clickFullScreenMode();
|
||||||
await dashboardPanelActions.clickExpandPanelToggle();
|
await dashboardPanelActions.clickExpandPanelToggle();
|
||||||
|
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||||
'area_chart',
|
'area_chart',
|
||||||
updateBaselines
|
updateBaselines
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickExitFullScreenLogoButton();
|
await dashboard.clickExitFullScreenLogoButton();
|
||||||
expect(percentDifference).to.be.lessThan(0.029);
|
expect(percentDifference).to.be.lessThan(0.029);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('compare controls snapshot', () => {
|
describe('compare controls snapshot', () => {
|
||||||
const waitForPageReady = async () => {
|
const waitForPageReady = async () => {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await retry.waitFor('page ready for screenshot', async () => {
|
await retry.waitFor('page ready for screenshot', async () => {
|
||||||
const queryBarVisible = await testSubjects.exists('globalQueryBar');
|
const queryBarVisible = await testSubjects.exists('globalQueryBar');
|
||||||
const controlGroupVisible = await testSubjects.exists('controls-group-wrapper');
|
const controlGroupVisible = await testSubjects.exists('controls-group-wrapper');
|
||||||
|
@ -108,21 +106,21 @@ export default function ({
|
||||||
};
|
};
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboardControls.createControl({
|
await dashboardControls.createControl({
|
||||||
controlType: OPTIONS_LIST_CONTROL,
|
controlType: OPTIONS_LIST_CONTROL,
|
||||||
dataViewTitle: 'logstash-*',
|
dataViewTitle: 'logstash-*',
|
||||||
fieldName: 'machine.os.raw',
|
fieldName: 'machine.os.raw',
|
||||||
title: 'Machine OS',
|
title: 'Machine OS',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboardControls.createControl({
|
await dashboardControls.createControl({
|
||||||
controlType: RANGE_SLIDER_CONTROL,
|
controlType: RANGE_SLIDER_CONTROL,
|
||||||
dataViewTitle: 'logstash-*',
|
dataViewTitle: 'logstash-*',
|
||||||
fieldName: 'bytes',
|
fieldName: 'bytes',
|
||||||
title: 'Bytes',
|
title: 'Bytes',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.saveDashboard('Dashboard Controls');
|
await dashboard.saveDashboard('Dashboard Controls');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('in light mode', async () => {
|
it('in light mode', async () => {
|
||||||
|
|
|
@ -7,18 +7,16 @@
|
||||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import expect from '@kbn/expect';
|
|
||||||
|
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const panelActions = getService('dashboardPanelActions');
|
const panelActions = getService('dashboardPanelActions');
|
||||||
const savedObjectsFinder = getService('savedObjectsFinder');
|
const savedObjectsFinder = getService('savedObjectsFinder');
|
||||||
|
const title = 'Rendering Test: heatmap';
|
||||||
|
|
||||||
describe('embeddable library', () => {
|
describe('embeddable library', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -29,48 +27,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('unlink visualize panel from embeddable library', async () => {
|
it('unlink visualize panel from embeddable library', async () => {
|
||||||
// add heatmap panel from library
|
// add heatmap panel from library
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await savedObjectsFinder.filterEmbeddableNames('Rendering Test: heatmap');
|
await savedObjectsFinder.filterEmbeddableNames(title);
|
||||||
await find.clickByButtonText('Rendering Test: heatmap');
|
await find.clickByButtonText(title);
|
||||||
await dashboardAddPanel.closeAddPanel();
|
await dashboardAddPanel.closeAddPanel();
|
||||||
|
|
||||||
const originalPanel = await testSubjects.find('embeddablePanelHeading-RenderingTest:heatmap');
|
await panelActions.unlinkFromLibrary(title);
|
||||||
await panelActions.unlinkFromLibrary(originalPanel);
|
await panelActions.expectNotLinkedToLibrary(title);
|
||||||
await testSubjects.existOrFail('unlinkPanelSuccess');
|
|
||||||
|
|
||||||
const updatedPanel = await testSubjects.find('embeddablePanelHeading-RenderingTest:heatmap');
|
|
||||||
const libraryActionExists = await testSubjects.descendantExists(
|
|
||||||
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
|
|
||||||
updatedPanel
|
|
||||||
);
|
|
||||||
expect(libraryActionExists).to.be(false);
|
|
||||||
|
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await savedObjectsFinder.filterEmbeddableNames('Rendering Test: heatmap');
|
await savedObjectsFinder.filterEmbeddableNames(title);
|
||||||
await find.existsByLinkText('Rendering Test: heatmap');
|
await find.existsByLinkText(title);
|
||||||
await dashboardAddPanel.closeAddPanel();
|
await dashboardAddPanel.closeAddPanel();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save visualize panel to embeddable library', async () => {
|
it('save visualize panel to embeddable library', async () => {
|
||||||
const originalPanel = await testSubjects.find('embeddablePanelHeading-RenderingTest:heatmap');
|
const newTitle = 'Rendering Test: heatmap - copy';
|
||||||
await panelActions.saveToLibrary('Rendering Test: heatmap - copy', originalPanel);
|
await panelActions.saveToLibrary(newTitle, title);
|
||||||
await testSubjects.existOrFail('addPanelToLibrarySuccess');
|
await panelActions.expectLinkedToLibrary(newTitle);
|
||||||
|
|
||||||
const updatedPanel = await testSubjects.find(
|
|
||||||
'embeddablePanelHeading-RenderingTest:heatmap-copy'
|
|
||||||
);
|
|
||||||
const libraryActionExists = await testSubjects.descendantExists(
|
|
||||||
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
|
|
||||||
updatedPanel
|
|
||||||
);
|
|
||||||
expect(libraryActionExists).to.be(true);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']);
|
const { dashboard, common, visualize, timePicker } = getPageObjects([
|
||||||
|
'dashboard',
|
||||||
|
'common',
|
||||||
|
'visualize',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
const dashboardName = 'dashboard with filter';
|
const dashboardName = 'dashboard with filter';
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
|
@ -30,8 +35,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.preserveCrossAppState();
|
await dashboard.preserveCrossAppState();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -40,47 +45,47 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('existing dashboard opens in last used view mode', async function () {
|
it('existing dashboard opens in last used view mode', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
expect(await PageObjects.dashboard.getIsInViewMode()).to.equal(true);
|
expect(await dashboard.getIsInViewMode()).to.equal(true);
|
||||||
|
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
expect(await PageObjects.dashboard.getIsInViewMode()).to.equal(false);
|
expect(await dashboard.getIsInViewMode()).to.equal(false);
|
||||||
|
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
await dashboard.loadSavedDashboard('few panels');
|
||||||
expect(await PageObjects.dashboard.getIsInViewMode()).to.equal(false);
|
expect(await dashboard.getIsInViewMode()).to.equal(false);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create new dashboard opens in edit mode', async function () {
|
it('create new dashboard opens in edit mode', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
const isInViewMode = await PageObjects.dashboard.getIsInViewMode();
|
const isInViewMode = await dashboard.getIsInViewMode();
|
||||||
expect(isInViewMode).to.be(false);
|
expect(isInViewMode).to.be(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('save as new', () => {
|
describe('save as new', () => {
|
||||||
it('keeps duplicated dashboard in edit mode', async () => {
|
it('keeps duplicated dashboard in edit mode', async () => {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
await PageObjects.dashboard.duplicateDashboard('edit');
|
await dashboard.duplicateDashboard('edit');
|
||||||
const isViewMode = await PageObjects.dashboard.getIsInViewMode();
|
const isViewMode = await dashboard.getIsInViewMode();
|
||||||
expect(isViewMode).to.equal(false);
|
expect(isViewMode).to.equal(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('save', function () {
|
describe('save', function () {
|
||||||
it('keeps dashboard in edit mode', async function () {
|
it('keeps dashboard in edit mode', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
});
|
});
|
||||||
const isViewMode = await PageObjects.dashboard.getIsInViewMode();
|
const isViewMode = await dashboard.getIsInViewMode();
|
||||||
expect(isViewMode).to.equal(false);
|
expect(isViewMode).to.equal(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -88,26 +93,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('shows lose changes warning', function () {
|
describe('shows lose changes warning', function () {
|
||||||
describe('and loses changes on confirmation', function () {
|
describe('and loses changes on confirmation', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when time changed is stored with dashboard', async function () {
|
it('when time changed is stored with dashboard', async function () {
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
|
|
||||||
const originalTime = await PageObjects.timePicker.getTimeConfig();
|
const originalTime = await timePicker.getTimeConfig();
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Sep 19, 2013 @ 06:31:44.000',
|
'Sep 19, 2013 @ 06:31:44.000',
|
||||||
'Sep 19, 2013 @ 06:31:44.000'
|
'Sep 19, 2013 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
|
|
||||||
const newTime = await PageObjects.timePicker.getTimeConfig();
|
const newTime = await timePicker.getTimeConfig();
|
||||||
|
|
||||||
expect(newTime.start).to.equal(originalTime.start);
|
expect(newTime.start).to.equal(originalTime.start);
|
||||||
expect(newTime.end).to.equal(originalTime.end);
|
expect(newTime.end).to.equal(originalTime.end);
|
||||||
|
@ -118,7 +123,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await queryBar.setQuery(`${originalQuery}and extra stuff`);
|
await queryBar.setQuery(`${originalQuery}and extra stuff`);
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
|
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal(originalQuery);
|
expect(query).to.equal(originalQuery);
|
||||||
|
@ -127,8 +132,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('when a filter is deleted', async function () {
|
it('when a filter is deleted', async function () {
|
||||||
// This may seem like a pointless line but there was a bug that only arose when the dashboard
|
// This may seem like a pointless line but there was a bug that only arose when the dashboard
|
||||||
// was loaded initially
|
// was loaded initially
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
|
|
||||||
let hasFilter = await filterBar.hasFilter('animal', 'dog');
|
let hasFilter = await filterBar.hasFilter('animal', 'dog');
|
||||||
expect(hasFilter).to.be(true);
|
expect(hasFilter).to.be(true);
|
||||||
|
@ -138,69 +143,69 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
hasFilter = await filterBar.hasFilter('animal', 'dog');
|
hasFilter = await filterBar.hasFilter('animal', 'dog');
|
||||||
expect(hasFilter).to.be(false);
|
expect(hasFilter).to.be(false);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
|
|
||||||
hasFilter = await filterBar.hasFilter('animal', 'dog');
|
hasFilter = await filterBar.hasFilter('animal', 'dog');
|
||||||
expect(hasFilter).to.be(true);
|
expect(hasFilter).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when a new vis is added', async function () {
|
it('when a new vis is added', async function () {
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||||
await PageObjects.visualize.clickAreaChart();
|
await visualize.clickAreaChart();
|
||||||
await PageObjects.visualize.clickNewSearch();
|
await visualize.clickNewSearch();
|
||||||
await PageObjects.visualize.saveVisualizationExpectSuccess('new viz panel', {
|
await visualize.saveVisualizationExpectSuccess('new viz panel', {
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
redirectToOrigin: true,
|
redirectToOrigin: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
// for this sleep see https://github.com/elastic/kibana/issues/22299
|
// for this sleep see https://github.com/elastic/kibana/issues/22299
|
||||||
await PageObjects.common.sleep(500);
|
await common.sleep(500);
|
||||||
|
|
||||||
// confirm lose changes
|
// confirm lose changes
|
||||||
await PageObjects.common.clickConfirmOnModal();
|
await common.clickConfirmOnModal();
|
||||||
|
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(originalPanelCount);
|
expect(panelCount).to.eql(originalPanelCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when an existing vis is added', async function () {
|
it('when an existing vis is added', async function () {
|
||||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
const originalPanelCount = await dashboard.getPanelCount();
|
||||||
|
|
||||||
await dashboardAddPanel.addVisualization('new viz panel');
|
await dashboardAddPanel.addVisualization('new viz panel');
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
await dashboard.clickCancelOutOfEditMode();
|
||||||
|
|
||||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
const panelCount = await dashboard.getPanelCount();
|
||||||
expect(panelCount).to.eql(originalPanelCount);
|
expect(panelCount).to.eql(originalPanelCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('and preserves edits on cancel', function () {
|
describe('and preserves edits on cancel', function () {
|
||||||
it('when time changed is stored with dashboard', async function () {
|
it('when time changed is stored with dashboard', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Sep 19, 2013 @ 06:31:44.000',
|
'Sep 19, 2013 @ 06:31:44.000',
|
||||||
'Sep 19, 2013 @ 06:31:44.000'
|
'Sep 19, 2013 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Sep 19, 2015 @ 06:31:44.000',
|
'Sep 19, 2015 @ 06:31:44.000',
|
||||||
'Sep 19, 2015 @ 06:31:44.000'
|
'Sep 19, 2015 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
|
|
||||||
await PageObjects.common.clickCancelOnModal();
|
await common.clickCancelOnModal();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
|
|
||||||
expect(time.start).to.equal('Sep 19, 2015 @ 06:31:44.000');
|
expect(time.start).to.equal('Sep 19, 2015 @ 06:31:44.000');
|
||||||
expect(time.end).to.equal('Sep 19, 2015 @ 06:31:44.000');
|
expect(time.end).to.equal('Sep 19, 2015 @ 06:31:44.000');
|
||||||
|
@ -210,26 +215,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('and preserves edits on cancel', function () {
|
describe('and preserves edits on cancel', function () {
|
||||||
it('when time changed is stored with dashboard', async function () {
|
it('when time changed is stored with dashboard', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
await PageObjects.timePicker.setDefaultDataRange();
|
await timePicker.setDefaultDataRange();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Sep 19, 2013 @ 06:31:44.000',
|
'Sep 19, 2013 @ 06:31:44.000',
|
||||||
'Sep 19, 2013 @ 06:31:44.000'
|
'Sep 19, 2013 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
const newTime = await PageObjects.timePicker.getTimeConfig();
|
const newTime = await timePicker.getTimeConfig();
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
|
|
||||||
await PageObjects.common.clickCancelOnModal();
|
await common.clickCancelOnModal();
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
storeTimeWithDashboard: true,
|
storeTimeWithDashboard: true,
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
|
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
|
|
||||||
expect(time.start).to.equal(newTime.start);
|
expect(time.start).to.equal(newTime.start);
|
||||||
expect(time.end).to.equal(newTime.end);
|
expect(time.end).to.equal(newTime.end);
|
||||||
|
@ -238,32 +243,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('Does not show lose changes warning', function () {
|
describe('Does not show lose changes warning', function () {
|
||||||
it('when time changed is not stored with dashboard', async function () {
|
it('when time changed is not stored with dashboard', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
storeTimeWithDashboard: false,
|
storeTimeWithDashboard: false,
|
||||||
saveAsNew: false,
|
saveAsNew: false,
|
||||||
});
|
});
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Oct 19, 2014 @ 06:31:44.000',
|
'Oct 19, 2014 @ 06:31:44.000',
|
||||||
'Dec 19, 2014 @ 06:31:44.000'
|
'Dec 19, 2014 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
|
|
||||||
await PageObjects.common.expectConfirmModalOpenState(false);
|
await common.expectConfirmModalOpenState(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// See https://github.com/elastic/kibana/issues/10110 - this is intentional.
|
// See https://github.com/elastic/kibana/issues/10110 - this is intentional.
|
||||||
it('when the query is edited but not applied', async function () {
|
it('when the query is edited but not applied', async function () {
|
||||||
await PageObjects.dashboard.gotoDashboardEditMode(dashboardName);
|
await dashboard.gotoDashboardEditMode(dashboardName);
|
||||||
|
|
||||||
const originalQuery = await queryBar.getQueryString();
|
const originalQuery = await queryBar.getQueryString();
|
||||||
await queryBar.setQuery(`${originalQuery}extra stuff`);
|
await queryBar.setQuery(`${originalQuery}extra stuff`);
|
||||||
|
|
||||||
await PageObjects.dashboard.clickCancelOutOfEditMode(false);
|
await dashboard.clickCancelOutOfEditMode(false);
|
||||||
|
|
||||||
await PageObjects.common.expectConfirmModalOpenState(false);
|
await common.expectConfirmModalOpenState(false);
|
||||||
|
|
||||||
await PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
await dashboard.loadSavedDashboard(dashboardName);
|
||||||
const query = await queryBar.getQueryString();
|
const query = await queryBar.getQueryString();
|
||||||
expect(query).to.equal(originalQuery);
|
expect(query).to.equal(originalQuery);
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,7 +11,7 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'discover', 'header']);
|
const { common, dashboard, header } = getPageObjects(['common', 'dashboard', 'header']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
|
@ -30,9 +30,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an image embeddable', async () => {
|
it('should create an image embeddable', async () => {
|
||||||
|
@ -40,13 +40,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardAddPanel.clickEditorMenuButton();
|
await dashboardAddPanel.clickEditorMenuButton();
|
||||||
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Image');
|
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Image');
|
||||||
await testSubjects.exists(`createImageEmbeddableFlyout`);
|
await testSubjects.exists(`createImageEmbeddableFlyout`);
|
||||||
await PageObjects.common.setFileInputPath(require.resolve('./elastic_logo.png'));
|
await common.setFileInputPath(require.resolve('./elastic_logo.png'));
|
||||||
await testSubjects.clickWhenNotDisabled(`imageEmbeddableEditorSave`);
|
await testSubjects.clickWhenNotDisabled(`imageEmbeddableEditorSave`);
|
||||||
|
|
||||||
// check that it is added on the dashboard
|
// check that it is added on the dashboard
|
||||||
expect(await PageObjects.dashboard.getSharedItemsCount()).to.be('1');
|
expect(await dashboard.getSharedItemsCount()).to.be('1');
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const panel = (await PageObjects.dashboard.getDashboardPanels())[0];
|
const panel = (await dashboard.getDashboardPanels())[0];
|
||||||
const img = await panel.findByCssSelector('img.euiImage');
|
const img = await panel.findByCssSelector('img.euiImage');
|
||||||
const imgSrc = await img.getAttribute('src');
|
const imgSrc = await img.getAttribute('src');
|
||||||
expect(imgSrc).to.contain(`files/defaultImage`);
|
expect(imgSrc).to.contain(`files/defaultImage`);
|
||||||
|
@ -66,21 +66,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardDrilldownsManage.saveChanges();
|
await dashboardDrilldownsManage.saveChanges();
|
||||||
await dashboardDrilldownsManage.closeFlyout();
|
await dashboardDrilldownsManage.closeFlyout();
|
||||||
|
|
||||||
expect(await PageObjects.dashboard.getPanelDrilldownCount()).to.be(1);
|
expect(await dashboardDrilldownPanelActions.getPanelDrilldownCount()).to.be(1);
|
||||||
|
|
||||||
const panel = (await PageObjects.dashboard.getDashboardPanels())[0];
|
const panel = (await dashboard.getDashboardPanels())[0];
|
||||||
const img = await panel.findByCssSelector('img.euiImage');
|
const img = await panel.findByCssSelector('img.euiImage');
|
||||||
|
|
||||||
const oldDashboardId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const oldDashboardId = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
|
|
||||||
await img.click();
|
await img.click();
|
||||||
|
|
||||||
await retry.waitFor('navigate to different dashboard', async () => {
|
await retry.waitFor('navigate to different dashboard', async () => {
|
||||||
const newDashboardId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
const newDashboardId = await dashboard.getDashboardIdFromCurrentUrl();
|
||||||
return typeof newDashboardId === 'string' && oldDashboardId !== newDashboardId;
|
return typeof newDashboardId === 'string' && oldDashboardId !== newDashboardId;
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const PageObjects = getPageObjects(['common', 'visualize', 'visEditor', 'header', 'timePicker']);
|
const { common, visualize, visEditor } = getPageObjects(['common', 'visualize', 'visEditor']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const comboBox = getService('comboBox');
|
const comboBox = getService('comboBox');
|
||||||
|
@ -22,9 +22,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
this.tags('includeFirefox');
|
this.tags('includeFirefox');
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.visualize.initTests();
|
await visualize.initTests();
|
||||||
await PageObjects.common.navigateToApp('visualize');
|
await common.navigateToApp('visualize');
|
||||||
await PageObjects.visualize.loadSavedVisualization('chained input control', {
|
await visualize.loadSavedVisualization('chained input control', {
|
||||||
navigateToVisualize: false,
|
navigateToVisualize: false,
|
||||||
});
|
});
|
||||||
await testSubjects.waitForEnabled('addFilter', 10000);
|
await testSubjects.waitForEnabled('addFilter', 10000);
|
||||||
|
@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should create a seperate filter pill for parent control and child control', async () => {
|
it('should create a seperate filter pill for parent control and child control', async () => {
|
||||||
await comboBox.set('listControlSelect1', '14.61.182.136');
|
await comboBox.set('listControlSelect1', '14.61.182.136');
|
||||||
|
|
||||||
await PageObjects.visEditor.inputControlSubmit();
|
await visEditor.inputControlSubmit();
|
||||||
|
|
||||||
const hasParentControlFilter = await filterBar.hasFilter('geo.src', 'BR');
|
const hasParentControlFilter = await filterBar.hasFilter('geo.src', 'BR');
|
||||||
expect(hasParentControlFilter).to.equal(true);
|
expect(hasParentControlFilter).to.equal(true);
|
||||||
|
@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should clear child control dropdown when parent control value is removed', async () => {
|
it('should clear child control dropdown when parent control value is removed', async () => {
|
||||||
await comboBox.clear('listControlSelect0');
|
await comboBox.clear('listControlSelect0');
|
||||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
await common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||||
|
|
||||||
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
const childControlInput = await find.byCssSelector('[data-test-subj="inputControl1"] input');
|
||||||
const isDisabled = await childControlInput.getAttribute('disabled');
|
const isDisabled = await childControlInput.getAttribute('disabled');
|
||||||
|
@ -72,7 +72,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should clear child control dropdown when parent control filter pill removed', async () => {
|
it('should clear child control dropdown when parent control filter pill removed', async () => {
|
||||||
await filterBar.removeFilter('geo.src');
|
await filterBar.removeFilter('geo.src');
|
||||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
await common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||||
|
|
||||||
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||||
expect(hasValue).to.equal(false);
|
expect(hasValue).to.equal(false);
|
||||||
|
|
|
@ -12,18 +12,23 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'visualize', 'visEditor', 'header', 'timePicker']);
|
const { common, visualize, visEditor, header } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'visualize',
|
||||||
|
'visEditor',
|
||||||
|
'header',
|
||||||
|
]);
|
||||||
const comboBox = getService('comboBox');
|
const comboBox = getService('comboBox');
|
||||||
|
|
||||||
describe('dynamic options', () => {
|
describe('dynamic options', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.visualize.initTests();
|
await visualize.initTests();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('without chained controls', () => {
|
describe('without chained controls', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('visualize');
|
await common.navigateToApp('visualize');
|
||||||
await PageObjects.visualize.loadSavedVisualization('dynamic options input control', {
|
await visualize.loadSavedVisualization('dynamic options input control', {
|
||||||
navigateToVisualize: false,
|
navigateToVisualize: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -33,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(initialOptions.trim().split('\n').join()).to.equal('BD,BR,CN,ID,IN,JP,NG,PK,RU');
|
expect(initialOptions.trim().split('\n').join()).to.equal('BD,BR,CN,ID,IN,JP,NG,PK,RU');
|
||||||
|
|
||||||
await comboBox.filterOptionsList('listControlSelect0', 'R');
|
await comboBox.filterOptionsList('listControlSelect0', 'R');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const updatedOptions = await comboBox.getOptionsList('listControlSelect0');
|
const updatedOptions = await comboBox.getOptionsList('listControlSelect0');
|
||||||
expect(updatedOptions.trim().split('\n').join()).to.equal('AR,BR,FR,GR,IR,KR,RO,RU,RW');
|
expect(updatedOptions.trim().split('\n').join()).to.equal('AR,BR,FR,GR,IR,KR,RO,RU,RW');
|
||||||
|
@ -41,7 +46,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should not fetch new options when non-string is filtered', async () => {
|
it('should not fetch new options when non-string is filtered', async () => {
|
||||||
await comboBox.set('fieldSelect-0', 'clientip');
|
await comboBox.set('fieldSelect-0', 'clientip');
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
|
|
||||||
const initialOptions = await comboBox.getOptionsList('listControlSelect0');
|
const initialOptions = await comboBox.getOptionsList('listControlSelect0');
|
||||||
expect(initialOptions.trim().split('\n').join()).to.equal(
|
expect(initialOptions.trim().split('\n').join()).to.equal(
|
||||||
|
@ -49,7 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
|
|
||||||
await comboBox.filterOptionsList('listControlSelect0', '17');
|
await comboBox.filterOptionsList('listControlSelect0', '17');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const updatedOptions = await comboBox.getOptionsList('listControlSelect0');
|
const updatedOptions = await comboBox.getOptionsList('listControlSelect0');
|
||||||
expect(updatedOptions.trim().split('\n').join()).to.equal(
|
expect(updatedOptions.trim().split('\n').join()).to.equal(
|
||||||
|
@ -60,11 +65,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('with chained controls', () => {
|
describe('with chained controls', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.common.navigateToApp('visualize');
|
await common.navigateToApp('visualize');
|
||||||
await PageObjects.visualize.loadSavedVisualization(
|
await visualize.loadSavedVisualization('chained input control with dynamic options', {
|
||||||
'chained input control with dynamic options',
|
navigateToVisualize: false,
|
||||||
{ navigateToVisualize: false }
|
});
|
||||||
);
|
|
||||||
await comboBox.set('listControlSelect0', 'win 7');
|
await comboBox.set('listControlSelect0', 'win 7');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -73,7 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(initialOptions.trim().split('\n').join()).to.equal('BD,BR,CN,ID,IN,JP,MX,NG,PK');
|
expect(initialOptions.trim().split('\n').join()).to.equal('BD,BR,CN,ID,IN,JP,MX,NG,PK');
|
||||||
|
|
||||||
await comboBox.filterOptionsList('listControlSelect1', 'R');
|
await comboBox.filterOptionsList('listControlSelect1', 'R');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const updatedOptions = await comboBox.getOptionsList('listControlSelect1');
|
const updatedOptions = await comboBox.getOptionsList('listControlSelect1');
|
||||||
expect(updatedOptions.trim().split('\n').join()).to.equal('AR,BR,FR,GR,IR,KR,RO,RS,RU');
|
expect(updatedOptions.trim().split('\n').join()).to.equal('AR,BR,FR,GR,IR,KR,RO,RS,RU');
|
||||||
|
|
|
@ -13,7 +13,12 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const PageObjects = getPageObjects(['common', 'visualize', 'visEditor', 'header', 'timePicker']);
|
const { common, visualize, visEditor, timePicker } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'visualize',
|
||||||
|
'visEditor',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const inspector = getService('inspector');
|
const inspector = getService('inspector');
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
|
@ -22,9 +27,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('input control options', () => {
|
describe('input control options', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.visualize.initTests();
|
await visualize.initTests();
|
||||||
await PageObjects.common.navigateToApp('visualize');
|
await common.navigateToApp('visualize');
|
||||||
await PageObjects.visualize.loadSavedVisualization('input control options', {
|
await visualize.loadSavedVisualization('input control options', {
|
||||||
navigateToVisualize: false,
|
navigateToVisualize: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -68,7 +73,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add filter pill when submit button is clicked', async () => {
|
it('should add filter pill when submit button is clicked', async () => {
|
||||||
await PageObjects.visEditor.inputControlSubmit();
|
await visEditor.inputControlSubmit();
|
||||||
|
|
||||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||||
expect(hasFilter).to.equal(true);
|
expect(hasFilter).to.equal(true);
|
||||||
|
@ -77,8 +82,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should replace existing filter pill(s) when new item is selected', async () => {
|
it('should replace existing filter pill(s) when new item is selected', async () => {
|
||||||
await comboBox.clear('listControlSelect0');
|
await comboBox.clear('listControlSelect0');
|
||||||
await comboBox.set('listControlSelect0', 'osx');
|
await comboBox.set('listControlSelect0', 'osx');
|
||||||
await PageObjects.visEditor.inputControlSubmit();
|
await visEditor.inputControlSubmit();
|
||||||
await PageObjects.common.sleep(1000);
|
await common.sleep(1000);
|
||||||
|
|
||||||
const hasOldFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
const hasOldFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||||
const hasNewFilter = await filterBar.hasFilter(FIELD_NAME, 'osx');
|
const hasNewFilter = await filterBar.hasFilter(FIELD_NAME, 'osx');
|
||||||
|
@ -88,7 +93,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should clear dropdown when filter pill removed', async () => {
|
it('should clear dropdown when filter pill removed', async () => {
|
||||||
await filterBar.removeFilter(FIELD_NAME);
|
await filterBar.removeFilter(FIELD_NAME);
|
||||||
await PageObjects.common.sleep(500); // give time for filter to be removed and event handlers to fire
|
await common.sleep(500); // give time for filter to be removed and event handlers to fire
|
||||||
|
|
||||||
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||||
expect(hasValue).to.equal(false);
|
expect(hasValue).to.equal(false);
|
||||||
|
@ -96,11 +101,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should clear form when Clear button is clicked but not remove filter pill', async () => {
|
it('should clear form when Clear button is clicked but not remove filter pill', async () => {
|
||||||
await comboBox.set('listControlSelect0', 'ios');
|
await comboBox.set('listControlSelect0', 'ios');
|
||||||
await PageObjects.visEditor.inputControlSubmit();
|
await visEditor.inputControlSubmit();
|
||||||
const hasFilterBeforeClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
const hasFilterBeforeClearBtnClicked = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||||
expect(hasFilterBeforeClearBtnClicked).to.equal(true);
|
expect(hasFilterBeforeClearBtnClicked).to.equal(true);
|
||||||
|
|
||||||
await PageObjects.visEditor.inputControlClear();
|
await visEditor.inputControlClear();
|
||||||
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
const hasValue = await comboBox.doesComboBoxHaveSelectedOptions('listControlSelect0');
|
||||||
expect(hasValue).to.equal(false);
|
expect(hasValue).to.equal(false);
|
||||||
|
|
||||||
|
@ -109,7 +114,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove filter pill when cleared form is submitted', async () => {
|
it('should remove filter pill when cleared form is submitted', async () => {
|
||||||
await PageObjects.visEditor.inputControlSubmit();
|
await visEditor.inputControlSubmit();
|
||||||
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
const hasFilter = await filterBar.hasFilter(FIELD_NAME, 'ios');
|
||||||
expect(hasFilter).to.equal(false);
|
expect(hasFilter).to.equal(false);
|
||||||
});
|
});
|
||||||
|
@ -117,17 +122,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('updateFiltersOnChange is true', () => {
|
describe('updateFiltersOnChange is true', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.visEditor.clickVisEditorTab('options');
|
await visEditor.clickVisEditorTab('options');
|
||||||
await PageObjects.visEditor.checkSwitch('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
await visEditor.checkSwitch('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.visEditor.clickVisEditorTab('options');
|
await visEditor.clickVisEditorTab('options');
|
||||||
await PageObjects.visEditor.uncheckSwitch(
|
await visEditor.uncheckSwitch('inputControlEditorUpdateFiltersOnChangeCheckbox');
|
||||||
'inputControlEditorUpdateFiltersOnChangeCheckbox'
|
await visEditor.clickGo();
|
||||||
);
|
|
||||||
await PageObjects.visEditor.clickGo();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not display staging control buttons', async () => {
|
it('should not display staging control buttons', async () => {
|
||||||
|
@ -152,9 +155,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('useTimeFilter', () => {
|
describe('useTimeFilter', () => {
|
||||||
it('should use global time filter when getting terms', async () => {
|
it('should use global time filter when getting terms', async () => {
|
||||||
await PageObjects.visEditor.clickVisEditorTab('options');
|
await visEditor.clickVisEditorTab('options');
|
||||||
await testSubjects.setCheckbox('inputControlEditorUseTimeFilterCheckbox', 'check');
|
await testSubjects.setCheckbox('inputControlEditorUseTimeFilterCheckbox', 'check');
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
|
|
||||||
// Expect control to be disabled because no terms could be gathered with time filter applied
|
// Expect control to be disabled because no terms could be gathered with time filter applied
|
||||||
const input = await find.byCssSelector('[data-test-subj="inputControl0"] input');
|
const input = await find.byCssSelector('[data-test-subj="inputControl0"] input');
|
||||||
|
@ -163,7 +166,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should re-create control when global time filter is updated', async () => {
|
it('should re-create control when global time filter is updated', async () => {
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Jan 1, 2015 @ 00:00:00.000',
|
'Jan 1, 2015 @ 00:00:00.000',
|
||||||
'Jan 1, 2016 @ 00:00:00.000'
|
'Jan 1, 2016 @ 00:00:00.000'
|
||||||
);
|
);
|
||||||
|
@ -175,7 +178,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
|
|
||||||
const { dashboard } = getPageObjects(['dashboardControls', 'dashboard']);
|
const { dashboard } = getPageObjects(['dashboard']);
|
||||||
|
|
||||||
async function setup() {
|
async function setup() {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await common.waitForSaveModalToClose();
|
await common.waitForSaveModalToClose();
|
||||||
await testSubjects.exists('addObjectToDashboardSuccess');
|
await testSubjects.exists('addObjectToDashboardSuccess');
|
||||||
await testSubjects.existOrFail('links--component');
|
await testSubjects.existOrFail('links--component');
|
||||||
await testSubjects.existOrFail('embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION');
|
await dashboardPanelActions.expectLinkedToLibrary(LINKS_PANEL_NAME, false);
|
||||||
|
|
||||||
expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4);
|
expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4);
|
||||||
await dashboard.clickDiscardChanges();
|
await dashboard.clickDiscardChanges();
|
||||||
|
@ -106,9 +106,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboardLinks.clickPanelEditorSaveButton();
|
await dashboardLinks.clickPanelEditorSaveButton();
|
||||||
await testSubjects.exists('addObjectToDashboardSuccess');
|
await testSubjects.exists('addObjectToDashboardSuccess');
|
||||||
await testSubjects.existOrFail('links--component');
|
await testSubjects.existOrFail('links--component');
|
||||||
await testSubjects.missingOrFail(
|
await dashboardPanelActions.expectNotLinkedToLibrary();
|
||||||
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION'
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4);
|
expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4);
|
||||||
});
|
});
|
||||||
|
@ -120,13 +118,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
await dashboardPanelActions.saveToLibrary('Some more links');
|
await dashboardPanelActions.saveToLibrary('Some more links');
|
||||||
await testSubjects.existOrFail('addPanelToLibrarySuccess');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can unlink a panel from the library', async () => {
|
it('can unlink a panel from the library', async () => {
|
||||||
const panel = await testSubjects.find('embeddablePanelHeading-Somemorelinks');
|
await dashboardPanelActions.unlinkFromLibrary('Some more links');
|
||||||
await dashboardPanelActions.unlinkFromLibrary(panel);
|
|
||||||
await testSubjects.existOrFail('unlinkPanelSuccess');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
|
|
@ -12,7 +12,12 @@ import expect from '@kbn/expect';
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'header']);
|
const { visualize, visEditor, visChart, header } = getPageObjects([
|
||||||
|
'visualize',
|
||||||
|
'visEditor',
|
||||||
|
'visChart',
|
||||||
|
'header',
|
||||||
|
]);
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const inspector = getService('inspector');
|
const inspector = getService('inspector');
|
||||||
const markdown = `
|
const markdown = `
|
||||||
|
@ -23,11 +28,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('markdown app in visualize app', () => {
|
describe('markdown app in visualize app', () => {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await PageObjects.visualize.initTests();
|
await visualize.initTests();
|
||||||
await PageObjects.visualize.navigateToNewVisualization();
|
await visualize.navigateToNewVisualization();
|
||||||
await PageObjects.visualize.clickMarkdownWidget();
|
await visualize.clickMarkdownWidget();
|
||||||
await PageObjects.visEditor.setMarkdownTxt(markdown);
|
await visEditor.setMarkdownTxt(markdown);
|
||||||
await PageObjects.visEditor.clickGo();
|
await visEditor.clickGo();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('markdown vis', () => {
|
describe('markdown vis', () => {
|
||||||
|
@ -36,12 +41,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render markdown as html', async function () {
|
it('should render markdown as html', async function () {
|
||||||
const h1Txt = await PageObjects.visChart.getMarkdownBodyDescendentText('h1');
|
const h1Txt = await visChart.getMarkdownBodyDescendentText('h1');
|
||||||
expect(h1Txt).to.equal('Heading 1');
|
expect(h1Txt).to.equal('Heading 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render html in markdown as html', async function () {
|
it('should not render html in markdown as html', async function () {
|
||||||
const actual = await PageObjects.visChart.getMarkdownText();
|
const actual = await visChart.getMarkdownText();
|
||||||
|
|
||||||
expect(actual).to.equal(
|
expect(actual).to.equal(
|
||||||
'Heading 1\n<h3>Inline HTML that should not be rendered as html</h3>'
|
'Heading 1\n<h3>Inline HTML that should not be rendered as html</h3>'
|
||||||
|
@ -50,17 +55,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should auto apply changes if auto mode is turned on', async function () {
|
it('should auto apply changes if auto mode is turned on', async function () {
|
||||||
const markdown2 = '## Heading 2';
|
const markdown2 = '## Heading 2';
|
||||||
await PageObjects.visEditor.toggleAutoMode();
|
await visEditor.toggleAutoMode();
|
||||||
await PageObjects.visEditor.setMarkdownTxt(markdown2);
|
await visEditor.setMarkdownTxt(markdown2);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const h1Txt = await PageObjects.visChart.getMarkdownBodyDescendentText('h2');
|
const h1Txt = await visChart.getMarkdownBodyDescendentText('h2');
|
||||||
expect(h1Txt).to.equal('Heading 2');
|
expect(h1Txt).to.equal('Heading 2');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should resize the editor', async function () {
|
it('should resize the editor', async function () {
|
||||||
const editorSidebar = await find.byCssSelector('.visEditor__collapsibleSidebar');
|
const editorSidebar = await find.byCssSelector('.visEditor__collapsibleSidebar');
|
||||||
const initialSize = await editorSidebar.getSize();
|
const initialSize = await editorSidebar.getSize();
|
||||||
await PageObjects.visEditor.sizeUpEditor();
|
await visEditor.sizeUpEditor();
|
||||||
const afterSize = await editorSidebar.getSize();
|
const afterSize = await editorSidebar.getSize();
|
||||||
expect(afterSize.width).to.be.greaterThan(initialSize.width);
|
expect(afterSize.width).to.be.greaterThan(initialSize.width);
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,13 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const config = getService('config');
|
const config = getService('config');
|
||||||
const PageObjects = getPageObjects([
|
const { common, timePicker } = getPageObjects(['common', 'timePicker']);
|
||||||
'common',
|
|
||||||
'discover',
|
|
||||||
'header',
|
|
||||||
'timePicker',
|
|
||||||
'unifiedSearch',
|
|
||||||
]);
|
|
||||||
const defaultIndexPatternString = config.get('esTestCluster.ccs')
|
const defaultIndexPatternString = config.get('esTestCluster.ccs')
|
||||||
? 'ftr-remote:logstash-*'
|
? 'ftr-remote:logstash-*'
|
||||||
: 'logstash-*';
|
: 'logstash-*';
|
||||||
|
@ -47,8 +41,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['saved-search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['saved-search', 'index-pattern'] });
|
||||||
await kibanaServer.importExport.load(kbnDirectory);
|
await kibanaServer.importExport.load(kbnDirectory);
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const log = getService('log');
|
const log = getService('log');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
|
@ -54,24 +54,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'query'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'query'] });
|
||||||
// set up a query with filters and a time filter
|
// set up a query with filters and a time filter
|
||||||
log.debug('set up a query with filters to save');
|
log.debug('set up a query with filters to save');
|
||||||
await PageObjects.common.setTime({ from, to });
|
await common.setTime({ from, to });
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchToAndValidate(logstashIndexPatternString);
|
await dataViews.switchToAndValidate(logstashIndexPatternString);
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('4,731');
|
expect(hitCount).to.be('4,731');
|
||||||
});
|
});
|
||||||
|
|
||||||
await filterBar.addFilter({ field: 'extension.raw', operation: 'is one of', value: ['jpg'] });
|
await filterBar.addFilter({ field: 'extension.raw', operation: 'is one of', value: ['jpg'] });
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('3,029');
|
expect(hitCount).to.be('3,029');
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryBar.setQuery('response:200');
|
await queryBar.setQuery('response:200');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('2,792');
|
expect(hitCount).to.be('2,792');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -88,7 +88,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
log.debug('discover');
|
log.debug('discover');
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -98,7 +98,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'query'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'query'] });
|
||||||
await esNode.unload('test/functional/fixtures/es_archiver/date_nested');
|
await esNode.unload('test/functional/fixtures/es_archiver/date_nested');
|
||||||
await esNode.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
await esNode.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('saved query selection', () => {
|
describe('saved query selection', () => {
|
||||||
|
@ -117,7 +117,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
||||||
expect(await queryBar.getQueryString()).to.eql('response:200');
|
expect(await queryBar.getQueryString()).to.eql('response:200');
|
||||||
|
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
|
|
||||||
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(false);
|
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(false);
|
||||||
expect(await queryBar.getQueryString()).to.eql('');
|
expect(await queryBar.getQueryString()).to.eql('');
|
||||||
|
@ -129,7 +129,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dataViews.switchToAndValidate(logstashIndexPatternString);
|
await dataViews.switchToAndValidate(logstashIndexPatternString);
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('4,731');
|
expect(hitCount).to.be('4,731');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -164,10 +164,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => {
|
it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await savedQueryManagementComponent.clearCurrentlyLoadedQuery();
|
await savedQueryManagementComponent.clearCurrentlyLoadedQuery();
|
||||||
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
||||||
const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();
|
const timePickerValues = await timePicker.getTimeConfigAsAbsoluteTimes();
|
||||||
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
||||||
expect(timePickerValues.start).to.eql(from);
|
expect(timePickerValues.start).to.eql(from);
|
||||||
expect(timePickerValues.end).to.eql(to);
|
expect(timePickerValues.end).to.eql(to);
|
||||||
|
@ -175,12 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('preserves the currently loaded query when the page is reloaded', async () => {
|
it('preserves the currently loaded query when the page is reloaded', async () => {
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();
|
const timePickerValues = await timePicker.getTimeConfigAsAbsoluteTimes();
|
||||||
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true);
|
||||||
expect(timePickerValues.start).to.eql(from);
|
expect(timePickerValues.start).to.eql(from);
|
||||||
expect(timePickerValues.end).to.eql(to);
|
expect(timePickerValues.end).to.eql(to);
|
||||||
await retry.waitForWithTimeout('the right hit count', 65000, async () => {
|
await retry.waitForWithTimeout('the right hit count', 65000, async () => {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
log.debug(`Found hit count is ${hitCount}. Looking for 2,792.`);
|
log.debug(`Found hit count is ${hitCount}. Looking for 2,792.`);
|
||||||
return hitCount === '2,792';
|
return hitCount === '2,792';
|
||||||
});
|
});
|
||||||
|
@ -253,7 +253,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('allows clearing if non default language was remembered in localstorage', async () => {
|
it('allows clearing if non default language was remembered in localstorage', async () => {
|
||||||
await savedQueryManagementComponent.openSavedQueryManagementComponent();
|
await savedQueryManagementComponent.openSavedQueryManagementComponent();
|
||||||
await queryBar.switchQueryLanguage('lucene');
|
await queryBar.switchQueryLanguage('lucene');
|
||||||
await PageObjects.common.navigateToApp('discover'); // makes sure discovered is reloaded without any state in url
|
await common.navigateToApp('discover'); // makes sure discovered is reloaded without any state in url
|
||||||
await savedQueryManagementComponent.openSavedQueryManagementComponent();
|
await savedQueryManagementComponent.openSavedQueryManagementComponent();
|
||||||
await queryBar.expectQueryLanguageOrFail('lucene'); // make sure lucene is remembered after refresh (comes from localstorage)
|
await queryBar.expectQueryLanguageOrFail('lucene'); // make sure lucene is remembered after refresh (comes from localstorage)
|
||||||
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
await savedQueryManagementComponent.loadSavedQuery('OkResponse');
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
|
|
||||||
const isCcsTest = config.get('esTestCluster.ccs');
|
const isCcsTest = config.get('esTestCluster.ccs');
|
||||||
const archiveDirectory = isCcsTest
|
const archiveDirectory = isCcsTest
|
||||||
|
@ -41,11 +41,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exception on single shard shows warning and results', async () => {
|
it('exception on single shard shows warning and results', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchToAndValidate(defaultIndex);
|
await dataViews.switchToAndValidate(defaultIndex);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('14,004');
|
expect(hitCount).to.be('14,004');
|
||||||
});
|
});
|
||||||
await filterBar.addDslFilter(`
|
await filterBar.addDslFilter(`
|
||||||
|
@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// Ensure documents are still returned for the successful shards
|
// Ensure documents are still returned for the successful shards
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('9,247');
|
expect(hitCount).to.be('9,247');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -74,11 +74,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exception on all shards shows error', async () => {
|
it('exception on all shards shows error', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchToAndValidate(defaultIndex);
|
await dataViews.switchToAndValidate(defaultIndex);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('14,004');
|
expect(hitCount).to.be('14,004');
|
||||||
});
|
});
|
||||||
await filterBar.addDslFilter(`
|
await filterBar.addDslFilter(`
|
||||||
|
|
|
@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const toasts = getService('toasts');
|
const toasts = getService('toasts');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
|
const { common, discover } = getPageObjects(['common', 'discover']);
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
|
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
|
@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('bfetch enabled', () => {
|
describe('bfetch enabled', () => {
|
||||||
it('timeout on single shard shows warning and results with bfetch enabled', async () => {
|
it('timeout on single shard shows warning and results with bfetch enabled', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.createFromSearchBar({
|
await dataViews.createFromSearchBar({
|
||||||
name: 'ftr-remote:logstash-*,logstash-*',
|
name: 'ftr-remote:logstash-*,logstash-*',
|
||||||
hasTimeField: false,
|
hasTimeField: false,
|
||||||
|
@ -86,7 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// Ensure documents are still returned for the successful shards
|
// Ensure documents are still returned for the successful shards
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('14,004');
|
expect(hitCount).to.be('14,004');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('timeout on single shard shows warning and results', async () => {
|
it('timeout on single shard shows warning and results', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.createFromSearchBar({
|
await dataViews.createFromSearchBar({
|
||||||
name: 'ftr-remote:logstash-*,logstash-*',
|
name: 'ftr-remote:logstash-*,logstash-*',
|
||||||
hasTimeField: false,
|
hasTimeField: false,
|
||||||
|
@ -147,7 +147,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// Ensure documents are still returned for the successful shards
|
// Ensure documents are still returned for the successful shards
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be('14,004');
|
expect(hitCount).to.be('14,004');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const docTable = getService('docTable');
|
const docTable = getService('docTable');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'context']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
|
@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update({
|
await kibanaServer.uiSettings.update({
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
|
@ -37,9 +37,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitForDocTableLoadingComplete();
|
await discover.waitForDocTableLoadingComplete();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the doc view of the selected document', async function () {
|
it('should open the doc view of the selected document', async function () {
|
||||||
|
@ -62,7 +62,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an exists filter from the doc view of the selected document', async function () {
|
it('should create an exists filter from the doc view of the selected document', async function () {
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await docTable.toggleRowExpanded();
|
await docTable.toggleRowExpanded();
|
||||||
const detailsRow = await docTable.getDetailsRow();
|
const detailsRow = await docTable.getDetailsRow();
|
||||||
|
|
|
@ -15,10 +15,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, settings, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'settings',
|
'settings',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
|
@ -35,8 +34,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -45,55 +44,55 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should correctly display documents', async function () {
|
it('should correctly display documents', async function () {
|
||||||
log.debug('check if Document title exists in the grid');
|
log.debug('check if Document title exists in the grid');
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
|
expect(await discover.getDocHeader()).to.have.string('Document');
|
||||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
const rowData = await discover.getDocTableIndex(1);
|
||||||
log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)');
|
log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)');
|
||||||
expect(rowData.startsWith('Sep 22, 2015 @ 23:50:13.253')).to.be.ok();
|
expect(rowData.startsWith('Sep 22, 2015 @ 23:50:13.253')).to.be.ok();
|
||||||
const expectedHitCount = '14,004';
|
const expectedHitCount = '14,004';
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
|
expect(await discover.getHitCount()).to.be(expectedHitCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adding a column removes a default column', async function () {
|
it('adding a column removes a default column', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('_score');
|
await unifiedFieldList.clickFieldListItemAdd('_score');
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('_score');
|
expect(await discover.getDocHeader()).to.have.string('_score');
|
||||||
expect(await PageObjects.discover.getDocHeader()).not.to.have.string('Document');
|
expect(await discover.getDocHeader()).not.to.have.string('Document');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('removing a column adds a default column', async function () {
|
it('removing a column adds a default column', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('_score');
|
await unifiedFieldList.clickFieldListItemRemove('_score');
|
||||||
expect(await PageObjects.discover.getDocHeader()).not.to.have.string('_score');
|
expect(await discover.getDocHeader()).not.to.have.string('_score');
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
|
expect(await discover.getDocHeader()).to.have.string('Document');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays _source viewer in doc viewer', async function () {
|
it('displays _source viewer in doc viewer', async function () {
|
||||||
await PageObjects.discover.clickDocTableRowToggle(0);
|
await discover.clickDocTableRowToggle(0);
|
||||||
await PageObjects.discover.isShowingDocViewer();
|
await discover.isShowingDocViewer();
|
||||||
await PageObjects.discover.clickDocViewerTab('doc_view_source');
|
await discover.clickDocViewerTab('doc_view_source');
|
||||||
await PageObjects.discover.expectSourceViewerToExist();
|
await discover.expectSourceViewerToExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('switches to _source column when fields API is no longer used', async function () {
|
it('switches to _source column when fields API is no longer used', async function () {
|
||||||
await PageObjects.settings.navigateTo();
|
await settings.navigateTo();
|
||||||
await PageObjects.settings.clickKibanaSettings();
|
await settings.clickKibanaSettings();
|
||||||
await PageObjects.settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
|
await settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
|
||||||
|
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
|
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('_source');
|
expect(await discover.getDocHeader()).to.have.string('_source');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('switches to Document column when fields API is used', async function () {
|
it('switches to Document column when fields API is used', async function () {
|
||||||
await PageObjects.settings.navigateTo();
|
await settings.navigateTo();
|
||||||
await PageObjects.settings.clickKibanaSettings();
|
await settings.clickKibanaSettings();
|
||||||
await PageObjects.settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
|
await settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
|
||||||
|
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
|
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
|
expect(await discover.getDocHeader()).to.have.string('Document');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const docTable = getService('docTable');
|
const docTable = getService('docTable');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, header, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
'header',
|
||||||
|
@ -44,9 +44,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// and load a set of makelogs data
|
// and load a set of makelogs data
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
log.debug('discover doc table');
|
log.debug('discover doc table');
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -57,29 +57,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should show records by default', async function () {
|
it('should show records by default', async function () {
|
||||||
// with the default range the number of hits is ~14000
|
// with the default range the number of hits is ~14000
|
||||||
const rows = await PageObjects.discover.getDocTableRows();
|
const rows = await discover.getDocTableRows();
|
||||||
expect(rows.length).to.be.greaterThan(0);
|
expect(rows.length).to.be.greaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should refresh the table content when changing time window', async function () {
|
it('should refresh the table content when changing time window', async function () {
|
||||||
const initialRows = await PageObjects.discover.getDocTableRows();
|
const initialRows = await discover.getDocTableRows();
|
||||||
|
|
||||||
const fromTime = 'Sep 20, 2015 @ 23:00:00.000';
|
const fromTime = 'Sep 20, 2015 @ 23:00:00.000';
|
||||||
const toTime = 'Sep 20, 2015 @ 23:14:00.000';
|
const toTime = 'Sep 20, 2015 @ 23:14:00.000';
|
||||||
|
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
const finalRows = await PageObjects.discover.getDocTableRows();
|
const finalRows = await discover.getDocTableRows();
|
||||||
expect(finalRows.length).to.be.below(initialRows.length);
|
expect(finalRows.length).to.be.below(initialRows.length);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('classic table in window 900x700', function () {
|
describe('classic table in window 900x700', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await browser.setWindowSize(900, 700);
|
await browser.setWindowSize(900, 700);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load more rows when scrolling down the document table', async function () {
|
it('should load more rows when scrolling down the document table', async function () {
|
||||||
|
@ -97,8 +97,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('classic table in window 600x700', function () {
|
describe('classic table in window 600x700', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await browser.setWindowSize(600, 700);
|
await browser.setWindowSize(600, 700);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load more rows when scrolling down the document table', async function () {
|
it('should load more rows when scrolling down the document table', async function () {
|
||||||
|
@ -115,8 +115,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('legacy', function () {
|
describe('legacy', function () {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await kibanaServer.uiSettings.replace({});
|
await kibanaServer.uiSettings.replace({});
|
||||||
|
@ -124,21 +124,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it(`should load up to ${rowsHardLimit} rows when scrolling at the end of the table`, async function () {
|
it(`should load up to ${rowsHardLimit} rows when scrolling at the end of the table`, async function () {
|
||||||
const initialRows = await testSubjects.findAll('docTableRow');
|
const initialRows = await testSubjects.findAll('docTableRow');
|
||||||
// click the Skip to the end of the table
|
// click the Skip to the end of the table
|
||||||
await PageObjects.discover.skipToEndOfDocTable();
|
await discover.skipToEndOfDocTable();
|
||||||
// now count the rows
|
// now count the rows
|
||||||
const finalRows = await testSubjects.findAll('docTableRow');
|
const finalRows = await testSubjects.findAll('docTableRow');
|
||||||
expect(finalRows.length).to.be.above(initialRows.length);
|
expect(finalRows.length).to.be.above(initialRows.length);
|
||||||
expect(finalRows.length).to.be(rowsHardLimit);
|
expect(finalRows.length).to.be(rowsHardLimit);
|
||||||
await PageObjects.discover.backToTop();
|
await discover.backToTop();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should go the end and back to top of the classic table when using the accessible buttons', async function () {
|
it('should go the end and back to top of the classic table when using the accessible buttons', async function () {
|
||||||
// click the Skip to the end of the table
|
// click the Skip to the end of the table
|
||||||
await PageObjects.discover.skipToEndOfDocTable();
|
await discover.skipToEndOfDocTable();
|
||||||
// now check the footer text content
|
// now check the footer text content
|
||||||
const footer = await PageObjects.discover.getDocTableFooter();
|
const footer = await discover.getDocTableFooter();
|
||||||
expect(await footer.getVisibleText()).to.have.string(rowsHardLimit);
|
expect(await footer.getVisibleText()).to.have.string(rowsHardLimit);
|
||||||
await PageObjects.discover.backToTop();
|
await discover.backToTop();
|
||||||
// check that the skip to end of the table button now has focus
|
// check that the skip to end of the table button now has focus
|
||||||
const skipButton = await testSubjects.find('discoverSkipTableButton');
|
const skipButton = await testSubjects.find('discoverSkipTableButton');
|
||||||
const activeElement = await find.activeElement();
|
const activeElement = await find.activeElement();
|
||||||
|
@ -171,7 +171,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should show the detail panel actions', async function () {
|
it('should show the detail panel actions', async function () {
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
||||||
// const detailsEl = await PageObjects.discover.getDocTableRowDetails(rowToInspect);
|
// const detailsEl = await discover.getDocTableRowDetails(rowToInspect);
|
||||||
const [surroundingActionEl, singleActionEl] = await docTable.getRowActions({
|
const [surroundingActionEl, singleActionEl] = await docTable.getRowActions({
|
||||||
isAnchorRow: false,
|
isAnchorRow: false,
|
||||||
rowIndex: rowToInspect - 1,
|
rowIndex: rowToInspect - 1,
|
||||||
|
@ -184,7 +184,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should not close the detail panel actions when data is re-requested', async function () {
|
it('should not close the detail panel actions when data is re-requested', async function () {
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
const nrOfFetches = await PageObjects.discover.getNrOfFetches();
|
const nrOfFetches = await discover.getNrOfFetches();
|
||||||
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
||||||
const detailsEl = await docTable.getDetailsRows();
|
const detailsEl = await docTable.getDetailsRows();
|
||||||
const defaultMessageEl = await detailsEl[0].findByTestSubject(
|
const defaultMessageEl = await detailsEl[0].findByTestSubject(
|
||||||
|
@ -192,7 +192,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
expect(defaultMessageEl).to.be.ok();
|
expect(defaultMessageEl).to.be.ok();
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
const nrOfFetchesResubmit = await PageObjects.discover.getNrOfFetches();
|
const nrOfFetchesResubmit = await discover.getNrOfFetches();
|
||||||
expect(nrOfFetchesResubmit).to.be.above(nrOfFetches);
|
expect(nrOfFetchesResubmit).to.be.above(nrOfFetches);
|
||||||
const defaultMessageElResubmit = await detailsEl[0].findByTestSubject(
|
const defaultMessageElResubmit = await detailsEl[0].findByTestSubject(
|
||||||
'docViewerRowDetailsTitle'
|
'docViewerRowDetailsTitle'
|
||||||
|
@ -203,7 +203,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show allow toggling columns from the expanded document', async function () {
|
it('should show allow toggling columns from the expanded document', async function () {
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
|
||||||
|
|
||||||
|
@ -237,23 +237,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove(column);
|
await unifiedFieldList.clickFieldListItemRemove(column);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add more columns to the table', async function () {
|
it('should add more columns to the table', async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clearFieldSearchInput();
|
await unifiedFieldList.clearFieldSearchInput();
|
||||||
await PageObjects.unifiedFieldList.findFieldByName(column);
|
await unifiedFieldList.findFieldByName(column);
|
||||||
await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields(
|
await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]);
|
||||||
expectedFieldLength[column]
|
|
||||||
);
|
|
||||||
await retry.waitFor('field to appear', async function () {
|
await retry.waitFor('field to appear', async function () {
|
||||||
return await testSubjects.exists(`field-${column}`);
|
return await testSubjects.exists(`field-${column}`);
|
||||||
});
|
});
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(column);
|
await unifiedFieldList.clickFieldListItemAdd(column);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
// test the header now
|
// test the header now
|
||||||
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
|
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
|
||||||
const docHeaderText = await docHeader.getVisibleText();
|
const docHeaderText = await docHeader.getVisibleText();
|
||||||
|
@ -263,17 +261,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should remove columns from the table', async function () {
|
it('should remove columns from the table', async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clearFieldSearchInput();
|
await unifiedFieldList.clearFieldSearchInput();
|
||||||
await PageObjects.unifiedFieldList.findFieldByName(column);
|
await unifiedFieldList.findFieldByName(column);
|
||||||
await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields(
|
await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]);
|
||||||
expectedFieldLength[column]
|
await unifiedFieldList.clickFieldListItemAdd(column);
|
||||||
);
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(column);
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
|
||||||
}
|
}
|
||||||
// remove the second column
|
// remove the second column
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove(extraColumns[1]);
|
await unifiedFieldList.clickFieldListItemRemove(extraColumns[1]);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
// test that the second column is no longer there
|
// test that the second column is no longer there
|
||||||
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
|
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
|
||||||
expect(await docHeader.getVisibleText()).to.not.have.string(extraColumns[1]);
|
expect(await docHeader.getVisibleText()).to.not.have.string(extraColumns[1]);
|
||||||
|
@ -281,9 +277,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should make the document table scrollable', async function () {
|
it('should make the document table scrollable', async function () {
|
||||||
await PageObjects.unifiedFieldList.clearFieldSearchInput();
|
await unifiedFieldList.clearFieldSearchInput();
|
||||||
const dscTableWrapper = await find.byCssSelector('.kbnDocTableWrapper');
|
const dscTableWrapper = await find.byCssSelector('.kbnDocTableWrapper');
|
||||||
const fieldNames = await PageObjects.unifiedFieldList.getAllFieldNames();
|
const fieldNames = await unifiedFieldList.getAllFieldNames();
|
||||||
const clientHeight = await dscTableWrapper.getAttribute('clientHeight');
|
const clientHeight = await dscTableWrapper.getAttribute('clientHeight');
|
||||||
let fieldCounter = 0;
|
let fieldCounter = 0;
|
||||||
const checkScrollable = async () => {
|
const checkScrollable = async () => {
|
||||||
|
@ -293,7 +289,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
return Number(scrollWidth) > Number(clientWidth);
|
return Number(scrollWidth) > Number(clientWidth);
|
||||||
};
|
};
|
||||||
const addColumn = async () => {
|
const addColumn = async () => {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(fieldNames[fieldCounter++]);
|
await unifiedFieldList.clickFieldListItemAdd(fieldNames[fieldCounter++]);
|
||||||
};
|
};
|
||||||
|
|
||||||
await addColumn();
|
await addColumn();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'unifiedFieldList']);
|
const { common, unifiedFieldList } = getPageObjects(['common', 'unifiedFieldList']);
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const log = getService('log');
|
const log = getService('log');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
|
@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
defaultIndex: 'newline-test',
|
defaultIndex: 'newline-test',
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should break text on newlines', async function () {
|
it('should break text on newlines', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemToggle('message');
|
await unifiedFieldList.clickFieldListItemToggle('message');
|
||||||
const dscTableRows = await find.allByCssSelector('.kbnDocTable__row');
|
const dscTableRows = await find.allByCssSelector('.kbnDocTable__row');
|
||||||
|
|
||||||
await retry.waitFor('height of multi-line content > single-line content', async () => {
|
await retry.waitFor('height of multi-line content > single-line content', async () => {
|
||||||
|
@ -48,7 +48,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const heightWithNewline = await dscTableRows[1].getAttribute('clientHeight');
|
const heightWithNewline = await dscTableRows[1].getAttribute('clientHeight');
|
||||||
log.debug(`Without newlines: ${heightWithoutNewline}, With newlines: ${heightWithNewline}`);
|
log.debug(`Without newlines: ${heightWithoutNewline}, With newlines: ${heightWithNewline}`);
|
||||||
|
|
||||||
await PageObjects.common.sleep(10000);
|
await common.sleep(10000);
|
||||||
return Number(heightWithNewline) > Number(heightWithoutNewline);
|
return Number(heightWithNewline) > Number(heightWithoutNewline);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,13 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const dashboardPanelActions = getService('dashboardPanelActions');
|
const dashboardPanelActions = getService('dashboardPanelActions');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, dashboard, header, timePicker } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'unifiedFieldList',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const defaultSettings = {
|
const defaultSettings = {
|
||||||
|
@ -37,8 +36,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -50,16 +49,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should render esql view correctly', async function () {
|
it('should render esql view correctly', async function () {
|
||||||
const savedSearchESQL = 'testESQLWithLegacySetting';
|
const savedSearchESQL = 'testESQLWithLegacySetting';
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await testSubjects.existOrFail('docTableHeader');
|
await testSubjects.existOrFail('docTableHeader');
|
||||||
await testSubjects.missingOrFail('euiDataGridBody');
|
await testSubjects.missingOrFail('euiDataGridBody');
|
||||||
|
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await testSubjects.missingOrFail('docTableHeader');
|
await testSubjects.missingOrFail('docTableHeader');
|
||||||
await testSubjects.existOrFail('euiDataGridBody');
|
await testSubjects.existOrFail('euiDataGridBody');
|
||||||
|
@ -68,14 +67,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await testSubjects.existOrFail('docViewerFlyout');
|
await testSubjects.existOrFail('docViewerFlyout');
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(savedSearchESQL);
|
await discover.saveSearch(savedSearchESQL);
|
||||||
|
|
||||||
await PageObjects.common.navigateToApp('dashboard');
|
await common.navigateToApp('dashboard');
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await dashboardAddPanel.addSavedSearch(savedSearchESQL);
|
await dashboardAddPanel.addSavedSearch(savedSearchESQL);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.missingOrFail('docTableHeader');
|
await testSubjects.missingOrFail('docTableHeader');
|
||||||
await testSubjects.existOrFail('euiDataGridBody');
|
await testSubjects.existOrFail('euiDataGridBody');
|
||||||
|
@ -88,7 +87,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dashboardAddPanel.addSavedSearch('A Saved Search');
|
await dashboardAddPanel.addSavedSearch('A Saved Search');
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await testSubjects.existOrFail('docTableHeader');
|
await testSubjects.existOrFail('docTableHeader');
|
||||||
await testSubjects.missingOrFail('euiDataGridBody');
|
await testSubjects.missingOrFail('euiDataGridBody');
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
|
const { common, timePicker } = getPageObjects(['common', 'timePicker']);
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'discover:searchFieldsFromSource': true,
|
'discover:searchFieldsFromSource': true,
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
});
|
});
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// we don't technically need this sleep here because the tryForTime will retry and the
|
// we don't technically need this sleep here because the tryForTime will retry and the
|
||||||
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
|
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
|
||||||
// case and it can be avoided with just a few seconds sleep.
|
// case and it can be avoided with just a few seconds sleep.
|
||||||
await PageObjects.common.sleep(2000);
|
await common.sleep(2000);
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
|
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
|
||||||
const rowData = await row.getVisibleText();
|
const rowData = await row.getVisibleText();
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
|
const { common, timePicker } = getPageObjects(['common', 'timePicker']);
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
@ -29,8 +29,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'discover:searchFieldsFromSource': false,
|
'discover:searchFieldsFromSource': false,
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
});
|
});
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// we don't technically need this sleep here because the tryForTime will retry and the
|
// we don't technically need this sleep here because the tryForTime will retry and the
|
||||||
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
|
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
|
||||||
// case and it can be avoided with just a few seconds sleep.
|
// case and it can be avoided with just a few seconds sleep.
|
||||||
await PageObjects.common.sleep(2000);
|
await common.sleep(2000);
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
|
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
|
||||||
const rowData = await row.getVisibleText();
|
const rowData = await row.getVisibleText();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const PageObjects = getPageObjects(['common', 'home', 'settings', 'discover', 'timePicker']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
@ -25,8 +25,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
'doc_table:legacy': true,
|
'doc_table:legacy': true,
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display try document explorer button', async function () {
|
it('should display try document explorer button', async function () {
|
||||||
await PageObjects.discover.selectIndexPattern('logstash-*');
|
await discover.selectIndexPattern('logstash-*');
|
||||||
const tourButtonExists = await testSubjects.exists('tryDocumentExplorerButton');
|
const tourButtonExists = await testSubjects.exists('tryDocumentExplorerButton');
|
||||||
expect(tourButtonExists).to.be(true);
|
expect(tourButtonExists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,11 @@ import expect from '@kbn/expect';
|
||||||
import type { FtrProviderContext } from '../ftr_provider_context';
|
import type { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover', 'unifiedFieldList']);
|
const { common, discover, unifiedFieldList } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'discover',
|
||||||
|
'unifiedFieldList',
|
||||||
|
]);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
|
@ -25,12 +29,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
await unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(6);
|
expect(timestamps).to.have.length(6);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
||||||
|
@ -44,12 +48,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
await unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(3);
|
expect(timestamps).to.have.length(3);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:00:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:00:00.000Z');
|
||||||
|
@ -67,10 +71,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
||||||
|
@ -83,10 +87,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
||||||
|
@ -99,13 +103,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
describe('cell renderers', () => {
|
describe('cell renderers', () => {
|
||||||
it('should render custom @timestamp but not custom log.level', async () => {
|
it('should render custom @timestamp but not custom log.level', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-*');
|
await dataViews.switchTo('my-example-*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
await unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(6);
|
expect(timestamps).to.have.length(6);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
||||||
|
@ -115,13 +119,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render custom @timestamp and custom log.level', async () => {
|
it('should render custom @timestamp and custom log.level', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-logs');
|
await dataViews.switchTo('my-example-logs');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
await unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(3);
|
expect(timestamps).to.have.length(3);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:00:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:00:00.000Z');
|
||||||
|
@ -135,11 +139,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('doc viewer extension', () => {
|
describe('doc viewer extension', () => {
|
||||||
it('should not render custom doc viewer view', async () => {
|
it('should not render custom doc viewer view', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-*');
|
await dataViews.switchTo('my-example-*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
||||||
|
@ -148,11 +152,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render custom doc viewer view', async () => {
|
it('should render custom doc viewer view', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-logs');
|
await dataViews.switchTo('my-example-logs');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
await testSubjects.existOrFail('docViewerTab-doc_view_source');
|
||||||
|
|
|
@ -12,7 +12,7 @@ import expect from '@kbn/expect';
|
||||||
import type { FtrProviderContext } from '../ftr_provider_context';
|
import type { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
const { common, discover } = getPageObjects(['common', 'discover']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
|
|
||||||
|
@ -24,10 +24,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
query: { esql: 'from my-example-* | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(6);
|
expect(timestamps).to.have.length(6);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
||||||
|
@ -39,11 +39,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
describe('cell renderers', () => {
|
describe('cell renderers', () => {
|
||||||
it('should render custom @timestamp', async () => {
|
it('should render custom @timestamp', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-*');
|
await dataViews.switchTo('my-example-*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
const timestamps = await testSubjects.findAll('exampleRootProfileTimestamp');
|
||||||
expect(timestamps).to.have.length(6);
|
expect(timestamps).to.have.length(6);
|
||||||
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
expect(await timestamps[0].getVisibleText()).to.be('2024-06-10T16:30:00.000Z');
|
||||||
|
|
|
@ -13,7 +13,12 @@ import type { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services';
|
||||||
import type { FtrProviderContext } from '../../ftr_provider_context';
|
import type { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'unifiedFieldList', 'header']);
|
const { common, discover, unifiedFieldList, header } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'discover',
|
||||||
|
'unifiedFieldList',
|
||||||
|
'header',
|
||||||
|
]);
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
|
@ -39,14 +44,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-logs,logstash* | sort @timestamp desc | where `log.level` is not null',
|
esql: 'from my-example-logs,logstash* | sort @timestamp desc | where `log.level` is not null',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
const firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
const logLevelBadge = await firstCell.findByTestSubject('*logLevelBadgeCell-');
|
const logLevelBadge = await firstCell.findByTestSubject('*logLevelBadgeCell-');
|
||||||
|
@ -63,14 +68,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example* | sort @timestamp desc | where `log.level` is not null',
|
esql: 'from my-example* | sort @timestamp desc | where `log.level` is not null',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -82,19 +87,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
it('should render log.level badge cell', async () => {
|
it('should render log.level badge cell', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-logs,logstash*');
|
await dataViews.switchToAndValidate('my-example-logs,logstash*');
|
||||||
await queryBar.setQuery('log.level:*');
|
await queryBar.setQuery('log.level:*');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
let firstCell: WebElementWrapper;
|
let firstCell: WebElementWrapper;
|
||||||
let logLevelBadge: WebElementWrapper;
|
let logLevelBadge: WebElementWrapper;
|
||||||
|
@ -112,9 +117,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 1);
|
firstCell = await dataGrid.getCellElementExcludingControlColumns(0, 1);
|
||||||
|
@ -127,19 +132,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not render log.level badge cell if it's not a logs data source", async () => {
|
it("should not render log.level badge cell if it's not a logs data source", async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-*');
|
await dataViews.switchToAndValidate('my-example-*');
|
||||||
await queryBar.setQuery('log.level:*');
|
await queryBar.setQuery('log.level:*');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('log.level');
|
await unifiedFieldList.clickFieldListItemAdd('log.level');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
let firstCell: WebElementWrapper;
|
let firstCell: WebElementWrapper;
|
||||||
|
|
||||||
|
@ -153,9 +158,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
firstCell = await dataGrid.getCellElementExcludingControlColumns(1, 1);
|
firstCell = await dataGrid.getCellElementExcludingControlColumns(1, 1);
|
||||||
|
|
|
@ -12,7 +12,12 @@ import kbnRison from '@kbn/rison';
|
||||||
import type { FtrProviderContext } from '../../ftr_provider_context';
|
import type { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'unifiedFieldList', 'header']);
|
const { common, discover, unifiedFieldList, header } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'discover',
|
||||||
|
'unifiedFieldList',
|
||||||
|
'header',
|
||||||
|
]);
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
|
@ -27,10 +32,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function expectColumns(columns: string[]) {
|
async function expectColumns(columns: string[]) {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const actualColumns = await PageObjects.discover.getColumnHeaders();
|
const actualColumns = await discover.getColumnHeaders();
|
||||||
expect(actualColumns).to.eql(columns);
|
expect(actualColumns).to.eql(columns);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -43,7 +48,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-logs',
|
esql: 'from my-example-logs',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await expectColumns(['@timestamp', 'log.level', 'message']);
|
await expectColumns(['@timestamp', 'log.level', 'message']);
|
||||||
|
@ -61,7 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-*',
|
esql: 'from my-example-*',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await expectColumns(['@timestamp', 'Document']);
|
await expectColumns(['@timestamp', 'Document']);
|
||||||
|
@ -87,13 +92,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-logs',
|
esql: 'from my-example-logs',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('log.level');
|
await unifiedFieldList.clickFieldListItemRemove('log.level');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('message');
|
await unifiedFieldList.clickFieldListItemRemove('message');
|
||||||
await expectColumns(['@timestamp', 'Document']);
|
await expectColumns(['@timestamp', 'Document']);
|
||||||
await dataGrid.clickGridSettings();
|
await dataGrid.clickGridSettings();
|
||||||
await dataGrid.changeRowHeightValue('Single');
|
await dataGrid.changeRowHeightValue('Single');
|
||||||
|
@ -118,7 +123,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-logs',
|
esql: 'from my-example-logs',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']);
|
await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']);
|
||||||
|
@ -127,11 +132,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
it('should render default columns and row height', async () => {
|
it('should render default columns and row height', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-logs');
|
await dataViews.switchToAndValidate('my-example-logs');
|
||||||
await expectColumns(['@timestamp', 'log.level', 'message']);
|
await expectColumns(['@timestamp', 'log.level', 'message']);
|
||||||
await dataGrid.clickGridSettings();
|
await dataGrid.clickGridSettings();
|
||||||
|
@ -142,11 +147,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render default columns and row height when switching data views', async () => {
|
it('should render default columns and row height when switching data views', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-*');
|
await dataViews.switchToAndValidate('my-example-*');
|
||||||
await expectColumns(['@timestamp', 'Document']);
|
await expectColumns(['@timestamp', 'Document']);
|
||||||
await dataGrid.clickGridSettings();
|
await dataGrid.clickGridSettings();
|
||||||
|
@ -164,15 +169,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset default columns and row height when clicking "New"', async () => {
|
it('should reset default columns and row height when clicking "New"', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-logs');
|
await dataViews.switchToAndValidate('my-example-logs');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('log.level');
|
await unifiedFieldList.clickFieldListItemRemove('log.level');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('message');
|
await unifiedFieldList.clickFieldListItemRemove('message');
|
||||||
await expectColumns(['@timestamp', 'Document']);
|
await expectColumns(['@timestamp', 'Document']);
|
||||||
await dataGrid.clickGridSettings();
|
await dataGrid.clickGridSettings();
|
||||||
await dataGrid.changeRowHeightValue('Single');
|
await dataGrid.changeRowHeightValue('Single');
|
||||||
|
@ -191,11 +196,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.update({
|
await kibanaServer.uiSettings.update({
|
||||||
defaultColumns: ['bad_column', 'data_stream.type', 'message'],
|
defaultColumns: ['bad_column', 'data_stream.type', 'message'],
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataViews.switchToAndValidate('my-example-logs');
|
await dataViews.switchToAndValidate('my-example-logs');
|
||||||
await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']);
|
await expectColumns(['@timestamp', 'log.level', 'message', 'data_stream.type']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,7 +11,7 @@ import kbnRison from '@kbn/rison';
|
||||||
import type { FtrProviderContext } from '../../ftr_provider_context';
|
import type { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header']);
|
const { common, discover, header } = getPageObjects(['common', 'discover', 'header']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
|
@ -24,10 +24,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
@ -40,10 +40,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-metrics | sort @timestamp desc' },
|
query: { esql: 'from my-example-metrics | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
@ -52,11 +52,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
it('should render logs overview tab for logs data source', async () => {
|
it('should render logs overview tab for logs data source', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-logs');
|
await dataViews.switchTo('my-example-logs');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
@ -66,9 +66,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// check Surrounding docs page
|
// check Surrounding docs page
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickRowToggle({ isAnchorRow: true });
|
await dataGrid.clickRowToggle({ isAnchorRow: true });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
|
@ -79,9 +79,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// check Single doc page
|
// check Single doc page
|
||||||
const [singleDocActionEl] = await dataGrid.getRowActions();
|
const [singleDocActionEl] = await dataGrid.getRowActions();
|
||||||
await singleDocActionEl.click();
|
await singleDocActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
@ -90,11 +90,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render logs overview tab for non-logs data source', async () => {
|
it('should not render logs overview tab for non-logs data source', async () => {
|
||||||
await PageObjects.common.navigateToActualUrl('discover', undefined, {
|
await common.navigateToActualUrl('discover', undefined, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await dataViews.switchTo('my-example-metrics');
|
await dataViews.switchTo('my-example-metrics');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
@ -102,9 +102,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// check Surrounding docs page
|
// check Surrounding docs page
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickRowToggle({ isAnchorRow: true });
|
await dataGrid.clickRowToggle({ isAnchorRow: true });
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
|
@ -113,9 +113,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// check Single doc page
|
// check Single doc page
|
||||||
const [singleDocActionEl] = await dataGrid.getRowActions();
|
const [singleDocActionEl] = await dataGrid.getRowActions();
|
||||||
await singleDocActionEl.click();
|
await singleDocActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
await testSubjects.existOrFail('docViewerTab-doc_view_table');
|
||||||
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview');
|
||||||
|
|
|
@ -11,7 +11,7 @@ import kbnRison from '@kbn/rison';
|
||||||
import type { FtrProviderContext } from '../../ftr_provider_context';
|
import type { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header']);
|
const { common, discover, header } = getPageObjects(['common', 'discover', 'header']);
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataViews = getService('dataViews');
|
const dataViews = getService('dataViews');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
|
@ -24,10 +24,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
query: { esql: 'from my-example-logs | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover', {
|
await common.navigateToApp('discover', {
|
||||||
hash: `/?_a=${state}`,
|
hash: `/?_a=${state}`,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
});
|
});
|
||||||
|
@ -37,10 +37,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example-metrics | sort @timestamp desc' },
|
query: { esql: 'from my-example-metrics | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover', {
|
await common.navigateToApp('discover', {
|
||||||
hash: `/?_a=${state}`,
|
hash: `/?_a=${state}`,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
});
|
});
|
||||||
|
@ -48,9 +48,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('data view mode', () => {
|
describe('data view mode', () => {
|
||||||
it('should render logs controls for logs data source', async () => {
|
it('should render logs controls for logs data source', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchTo('my-example-logs');
|
await dataViews.switchTo('my-example-logs');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
|
|
||||||
|
@ -58,18 +58,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.existOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.existOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render logs controls for non-logs data source', async () => {
|
it('should not render logs controls for non-logs data source', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchTo('my-example-metrics');
|
await dataViews.switchTo('my-example-metrics');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dataGrid.clickRowToggle();
|
await dataGrid.clickRowToggle();
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
await testSubjects.missingOrFail('exampleLogsControl_visBarVerticalStacked');
|
||||||
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
await testSubjects.missingOrFail('unifiedDataTable_additionalRowControl_menuControl');
|
||||||
|
|
|
@ -12,11 +12,10 @@ import expect from '@kbn/expect';
|
||||||
import type { FtrProviderContext } from '../../ftr_provider_context';
|
import type { FtrProviderContext } from '../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const PageObjects = getPageObjects([
|
const { common, timePicker, discover, header } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'discover',
|
'discover',
|
||||||
'unifiedFieldList',
|
|
||||||
'header',
|
'header',
|
||||||
]);
|
]);
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
|
@ -39,19 +38,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from logstash* | sort @timestamp desc' },
|
query: { esql: 'from logstash* | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// logstash does not have log.level field, so the color indicator should not be rendered
|
// logstash does not have log.level field, so the color indicator should not be rendered
|
||||||
await testSubjects.existOrFail('euiDataGridBody');
|
await testSubjects.existOrFail('euiDataGridBody');
|
||||||
await testSubjects.missingOrFail('dataGridHeaderCell-colorIndicator');
|
await testSubjects.missingOrFail('dataGridHeaderCell-colorIndicator');
|
||||||
|
|
||||||
// switch the time frame back
|
// switch the time frame back
|
||||||
await browser.goBack();
|
await browser.goBack();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render log.level row indicators if not a logs data source', async () => {
|
it('should not render log.level row indicators if not a logs data source', async () => {
|
||||||
|
@ -59,10 +58,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from my-example* | sort @timestamp desc' },
|
query: { esql: 'from my-example* | sort @timestamp desc' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// my-example* has a log.level field, but it's not matching the logs profile, so the color indicator should not be rendered
|
// my-example* has a log.level field, but it's not matching the logs profile, so the color indicator should not be rendered
|
||||||
await testSubjects.existOrFail('euiDataGridBody');
|
await testSubjects.existOrFail('euiDataGridBody');
|
||||||
await testSubjects.missingOrFail('dataGridHeaderCell-colorIndicator');
|
await testSubjects.missingOrFail('dataGridHeaderCell-colorIndicator');
|
||||||
|
@ -75,10 +74,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
esql: 'from my-example-logs,logstash* | sort @timestamp desc | where `log.level` is not null',
|
esql: 'from my-example-logs,logstash* | sort @timestamp desc | where `log.level` is not null',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// in this case it's matching the logs data source profile and has a log.level field, so the color indicator should be rendered
|
// in this case it's matching the logs data source profile and has a log.level field, so the color indicator should be rendered
|
||||||
await testSubjects.existOrFail('dataGridHeaderCell-colorIndicator');
|
await testSubjects.existOrFail('dataGridHeaderCell-colorIndicator');
|
||||||
const firstCell = await dataGrid.getCellElement(0, 0);
|
const firstCell = await dataGrid.getCellElement(0, 0);
|
||||||
|
@ -101,13 +100,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render log.level row indicators on Surrounding documents page', async () => {
|
it('should render log.level row indicators on Surrounding documents page', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await dataViews.switchTo('my-example-logs,logstash*');
|
await dataViews.switchTo('my-example-logs,logstash*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
const [, surroundingActionEl] = await dataGrid.getRowActions();
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
let anchorCell = await dataGrid.getCellElement(0, 0);
|
let anchorCell = await dataGrid.getCellElement(0, 0);
|
||||||
let anchorColorIndicator = await anchorCell.findByTestSubject(
|
let anchorColorIndicator = await anchorCell.findByTestSubject(
|
||||||
|
@ -128,7 +127,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
anchorCell = await dataGrid.getCellElement(0, 0);
|
anchorCell = await dataGrid.getCellElement(0, 0);
|
||||||
anchorColorIndicator = await anchorCell.findByTestSubject(
|
anchorColorIndicator = await anchorCell.findByTestSubject(
|
||||||
|
|
|
@ -12,7 +12,8 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['timePicker']);
|
const { timePicker } = getPageObjects(['timePicker']);
|
||||||
|
|
||||||
const from = '2024-06-10T14:00:00.000Z';
|
const from = '2024-06-10T14:00:00.000Z';
|
||||||
const to = '2024-06-10T16:30:00.000Z';
|
const to = '2024-06-10T16:30:00.000Z';
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ export default function ({ getService, getPageObjects, loadTestFile }: FtrProvid
|
||||||
await kibanaServer.importExport.unload(
|
await kibanaServer.importExport.unload(
|
||||||
'test/functional/fixtures/kbn_archiver/discover/context_awareness'
|
'test/functional/fixtures/kbn_archiver/discover/context_awareness'
|
||||||
);
|
);
|
||||||
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
loadTestFile(require.resolve('./_root_profile'));
|
loadTestFile(require.resolve('./_root_profile'));
|
||||||
|
|
|
@ -19,7 +19,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker', 'discover']);
|
const { common, dashboard, header, discover } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'dashboard',
|
||||||
|
'header',
|
||||||
|
'discover',
|
||||||
|
]);
|
||||||
|
|
||||||
describe('discover saved search embeddable', () => {
|
describe('discover saved search embeddable', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -32,7 +37,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.uiSettings.replace({
|
await kibanaServer.uiSettings.replace({
|
||||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||||
});
|
});
|
||||||
await PageObjects.common.setTime({
|
await common.setTime({
|
||||||
from: 'Sep 22, 2015 @ 00:00:00.000',
|
from: 'Sep 22, 2015 @ 00:00:00.000',
|
||||||
to: 'Sep 23, 2015 @ 00:00:00.000',
|
to: 'Sep 23, 2015 @ 00:00:00.000',
|
||||||
});
|
});
|
||||||
|
@ -40,28 +45,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await filterBar.ensureFieldEditorModalIsClosed();
|
await filterBar.ensureFieldEditorModalIsClosed();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
const addSearchEmbeddableToDashboard = async () => {
|
const addSearchEmbeddableToDashboard = async () => {
|
||||||
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const rows = await dataGrid.getDocTableRows();
|
const rows = await dataGrid.getDocTableRows();
|
||||||
expect(rows.length).to.be.above(0);
|
expect(rows.length).to.be.above(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshDashboardPage = async () => {
|
const refreshDashboardPage = async () => {
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
};
|
};
|
||||||
|
|
||||||
it('can save a search embeddable with a defined rows per page number', async function () {
|
it('can save a search embeddable with a defined rows per page number', async function () {
|
||||||
|
@ -69,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await addSearchEmbeddableToDashboard();
|
await addSearchEmbeddableToDashboard();
|
||||||
await dataGrid.checkCurrentRowsPerPageToBe(100);
|
await dataGrid.checkCurrentRowsPerPageToBe(100);
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, {
|
await dashboard.saveDashboard(dashboardName, {
|
||||||
saveAsNew: true,
|
saveAsNew: true,
|
||||||
waitDialogIsClosed: true,
|
waitDialogIsClosed: true,
|
||||||
exitFromEditMode: false,
|
exitFromEditMode: false,
|
||||||
|
@ -81,7 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dataGrid.changeRowsPerPageTo(10);
|
await dataGrid.changeRowsPerPageTo(10);
|
||||||
|
|
||||||
await PageObjects.dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
await dashboard.saveDashboard(dashboardName, { saveAsNew: false });
|
||||||
await refreshDashboardPage();
|
await refreshDashboardPage();
|
||||||
|
|
||||||
await dataGrid.checkCurrentRowsPerPageToBe(10);
|
await dataGrid.checkCurrentRowsPerPageToBe(10);
|
||||||
|
@ -89,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should control columns correctly', async () => {
|
it('should control columns correctly', async () => {
|
||||||
await addSearchEmbeddableToDashboard();
|
await addSearchEmbeddableToDashboard();
|
||||||
await PageObjects.dashboard.switchToEditMode();
|
await dashboard.switchToEditMode();
|
||||||
|
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
expect(await cell.getVisibleText()).to.be('Sep 22, 2015 @ 23:50:13.253');
|
expect(await cell.getVisibleText()).to.be('Sep 22, 2015 @ 23:50:13.253');
|
||||||
|
@ -118,11 +123,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await addSearchEmbeddableToDashboard();
|
await addSearchEmbeddableToDashboard();
|
||||||
await queryBar.setQuery('bytes > 5000');
|
await queryBar.setQuery('bytes > 5000');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await PageObjects.discover.getSavedSearchDocumentCount()).to.be('2,572 documents');
|
expect(await discover.getSavedSearchDocumentCount()).to.be('2,572 documents');
|
||||||
await queryBar.setQuery('this < is not : a valid > query');
|
await queryBar.setQuery('this < is not : a valid > query');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const embeddableError = await testSubjects.find('embeddableError');
|
const embeddableError = await testSubjects.find('embeddableError');
|
||||||
const errorMessage = await embeddableError.findByTestSubject('errorMessageMarkdown');
|
const errorMessage = await embeddableError.findByTestSubject('errorMessageMarkdown');
|
||||||
const errorText = await errorMessage.getVisibleText();
|
const errorText = await errorMessage.getVisibleText();
|
||||||
|
|
|
@ -24,10 +24,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const monacoEditor = getService('monacoEditor');
|
const monacoEditor = getService('monacoEditor');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, header, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'dashboard',
|
|
||||||
'header',
|
'header',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
|
@ -44,17 +43,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render initial columns for non-transformational commands correctly', async () => {
|
it('should render initial columns for non-transformational commands correctly', async () => {
|
||||||
|
@ -62,32 +61,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
await discover.saveSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render custom columns for non-transformational commands correctly', async () => {
|
it('should render custom columns for non-transformational commands correctly', async () => {
|
||||||
const columns = ['bytes', 'extension'];
|
const columns = ['bytes', 'extension'];
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
await discover.saveSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -97,31 +96,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue('from logstash-* | limit 500');
|
await monacoEditor.setCodeEditorValue('from logstash-* | limit 500');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue('from logs* | limit 500');
|
await monacoEditor.setCodeEditorValue('from logs* | limit 500');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['bytes']);
|
||||||
|
|
||||||
// different index pattern => reset columns
|
// different index pattern => reset columns
|
||||||
await monacoEditor.setCodeEditorValue('from logstash-* | limit 500');
|
await monacoEditor.setCodeEditorValue('from logstash-* | limit 500');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['extension']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['extension']);
|
||||||
|
|
||||||
// same index pattern => don't reset columns
|
// same index pattern => don't reset columns
|
||||||
|
@ -129,8 +128,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
`${await monacoEditor.getCodeEditorValue()} | where bytes > 0`
|
`${await monacoEditor.getCodeEditorValue()} | where bytes > 0`
|
||||||
);
|
);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['extension']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['extension']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -140,18 +139,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
`${await monacoEditor.getCodeEditorValue()} | keep ip, @timestamp`
|
`${await monacoEditor.getCodeEditorValue()} | keep ip, @timestamp`
|
||||||
);
|
);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(SAVED_SEARCH_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
await discover.saveSearch(SAVED_SEARCH_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -161,38 +160,38 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
`${await monacoEditor.getCodeEditorValue()} | keep ip, @timestamp, bytes`
|
`${await monacoEditor.getCodeEditorValue()} | keep ip, @timestamp, bytes`
|
||||||
);
|
);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('@timestamp');
|
await unifiedFieldList.clickFieldListItemRemove('@timestamp');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(SAVED_SEARCH_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
await discover.saveSearch(SAVED_SEARCH_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
expect(await dataGrid.getHeaderFields()).to.eql(columns);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset columns if available fields or index pattern are different in transformational query', async () => {
|
it('should reset columns if available fields or index pattern are different in transformational query', async () => {
|
||||||
await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp');
|
await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp']);
|
||||||
|
|
||||||
// reset columns if available fields are different
|
// reset columns if available fields are different
|
||||||
await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp, bytes');
|
await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp, bytes');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
||||||
|
|
||||||
// don't reset columns if available fields and index pattern are the same
|
// don't reset columns if available fields and index pattern are the same
|
||||||
|
@ -200,46 +199,46 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'from logstash-* | keep ip, @timestamp, bytes | limit 1'
|
'from logstash-* | keep ip, @timestamp, bytes | limit 1'
|
||||||
);
|
);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('@timestamp');
|
await unifiedFieldList.clickFieldListItemRemove('@timestamp');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', 'bytes']);
|
||||||
|
|
||||||
// reset columns if index pattern is different
|
// reset columns if index pattern is different
|
||||||
await monacoEditor.setCodeEditorValue('from logs* | keep ip, @timestamp, bytes | limit 1');
|
await monacoEditor.setCodeEditorValue('from logs* | keep ip, @timestamp, bytes | limit 1');
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp', 'bytes']);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should restore columns correctly when switching between saved searches', async () => {
|
it('should restore columns correctly when switching between saved searches', async () => {
|
||||||
await PageObjects.discover.loadSavedSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
await discover.loadSavedSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['@timestamp', 'Document']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['@timestamp', 'Document']);
|
||||||
|
|
||||||
await PageObjects.discover.loadSavedSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
await discover.loadSavedSearch(SAVED_SEARCH_NON_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['bytes', 'extension']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['bytes', 'extension']);
|
||||||
|
|
||||||
await PageObjects.discover.loadSavedSearch(SAVED_SEARCH_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
await discover.loadSavedSearch(SAVED_SEARCH_TRANSFORMATIONAL_INITIAL_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp']);
|
||||||
|
|
||||||
await PageObjects.discover.loadSavedSearch(SAVED_SEARCH_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
await discover.loadSavedSearch(SAVED_SEARCH_TRANSFORMATIONAL_CUSTOM_COLUMNS);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['ip', 'bytes']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['ip', 'bytes']);
|
||||||
|
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await dataGrid.getHeaderFields()).to.eql(['@timestamp', 'Document']);
|
expect(await dataGrid.getHeaderFields()).to.eql(['@timestamp', 'Document']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const esql = getService('esql');
|
const esql = getService('esql');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, dashboard, header, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
|
@ -52,17 +52,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'test/functional/fixtures/kbn_archiver/kibana_sample_data_flights_index_pattern'
|
'test/functional/fixtures/kbn_archiver/kibana_sample_data_flights_index_pattern'
|
||||||
);
|
);
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ES|QL in Discover', () => {
|
describe('ES|QL in Discover', () => {
|
||||||
it('should render esql view correctly', async function () {
|
it('should render esql view correctly', async function () {
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
expect(await testSubjects.exists('showQueryBarMenu')).to.be(true);
|
expect(await testSubjects.exists('showQueryBarMenu')).to.be(true);
|
||||||
expect(await testSubjects.exists('superDatePickerToggleQuickMenuButton')).to.be(true);
|
expect(await testSubjects.exists('superDatePickerToggleQuickMenuButton')).to.be(true);
|
||||||
|
@ -79,8 +79,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await testSubjects.click('field-@message-showDetails');
|
await testSubjects.click('field-@message-showDetails');
|
||||||
expect(await testSubjects.exists('discoverFieldListPanelEdit-@message')).to.be(true);
|
expect(await testSubjects.exists('discoverFieldListPanelEdit-@message')).to.be(true);
|
||||||
|
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
expect(await testSubjects.exists('fieldListFiltersFieldSearch')).to.be(true);
|
expect(await testSubjects.exists('fieldListFiltersFieldSearch')).to.be(true);
|
||||||
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
||||||
|
@ -103,15 +103,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render the histogram for indices with no @timestamp field', async function () {
|
it('should not render the histogram for indices with no @timestamp field', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const testQuery = `from kibana_sample_data_flights | limit 10`;
|
const testQuery = `from kibana_sample_data_flights | limit 10`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
||||||
// I am not rendering the histogram for indices with no @timestamp field
|
// I am not rendering the histogram for indices with no @timestamp field
|
||||||
|
@ -119,33 +119,33 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render the histogram for indices with no @timestamp field when the ?t_start, ?t_end params are in the query', async function () {
|
it('should render the histogram for indices with no @timestamp field when the ?t_start, ?t_end params are in the query', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const testQuery = `from kibana_sample_data_flights | limit 10 | where timestamp >= ?t_start and timestamp <= ?t_end`;
|
const testQuery = `from kibana_sample_data_flights | limit 10 | where timestamp >= ?t_start and timestamp <= ?t_end`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
const fromTime = 'Apr 10, 2018 @ 00:00:00.000';
|
const fromTime = 'Apr 10, 2018 @ 00:00:00.000';
|
||||||
const toTime = 'Nov 15, 2018 @ 00:00:00.000';
|
const toTime = 'Nov 15, 2018 @ 00:00:00.000';
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
|
|
||||||
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true);
|
||||||
expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true);
|
expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should perform test query correctly', async function () {
|
it('should perform test query correctly', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// here Lens suggests a XY so it is rendered
|
// here Lens suggests a XY so it is rendered
|
||||||
expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true);
|
expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true);
|
||||||
expect(await testSubjects.exists('xyVisChart')).to.be(true);
|
expect(await testSubjects.exists('xyVisChart')).to.be(true);
|
||||||
|
@ -154,48 +154,48 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render when switching to a time range with no data, then back to a time range with data', async () => {
|
it('should render when switching to a time range with no data, then back to a time range with data', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
let cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
let cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
expect(await cell.getVisibleText()).to.be('1');
|
expect(await cell.getVisibleText()).to.be('1');
|
||||||
await PageObjects.timePicker.setAbsoluteRange(
|
await timePicker.setAbsoluteRange(
|
||||||
'Sep 19, 2015 @ 06:31:44.000',
|
'Sep 19, 2015 @ 06:31:44.000',
|
||||||
'Sep 19, 2015 @ 06:31:44.000'
|
'Sep 19, 2015 @ 06:31:44.000'
|
||||||
);
|
);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await testSubjects.exists('discoverNoResults')).to.be(true);
|
expect(await testSubjects.exists('discoverNoResults')).to.be(true);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
expect(await cell.getVisibleText()).to.be('1');
|
expect(await cell.getVisibleText()).to.be('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should query an index pattern that doesnt translate to a dataview correctly', async function () {
|
it('should query an index pattern that doesnt translate to a dataview correctly', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
expect(await cell.getVisibleText()).to.be('1');
|
expect(await cell.getVisibleText()).to.be('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render correctly if there are empty fields', async function () {
|
it('should render correctly if there are empty fields', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | limit 10 | keep machine.ram_range, bytes`;
|
const testQuery = `from logstash-* | limit 10 | keep machine.ram_range, bytes`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 1);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 1);
|
||||||
expect(await cell.getVisibleText()).to.be(' - ');
|
expect(await cell.getVisibleText()).to.be(' - ');
|
||||||
expect(await dataGrid.getHeaders()).to.eql([
|
expect(await dataGrid.getHeaders()).to.eql([
|
||||||
|
@ -207,14 +207,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work without a FROM statement', async function () {
|
it('should work without a FROM statement', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `ROW a = 1, b = "two", c = null`;
|
const testQuery = `ROW a = 1, b = "two", c = null`;
|
||||||
|
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.discover.dragFieldToTable('a');
|
await discover.dragFieldToTable('a');
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
expect(await cell.getVisibleText()).to.be('1');
|
expect(await cell.getVisibleText()).to.be('1');
|
||||||
});
|
});
|
||||||
|
@ -222,7 +222,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('errors', () => {
|
describe('errors', () => {
|
||||||
it('should show error messages for syntax errors in query', async function () {
|
it('should show error messages for syntax errors in query', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const brokenQueries = [
|
const brokenQueries = [
|
||||||
'from logstash-* | limit 10*',
|
'from logstash-* | limit 10*',
|
||||||
'from logstash-* | limit A',
|
'from logstash-* | limit A',
|
||||||
|
@ -232,10 +232,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
for (const testQuery of brokenQueries) {
|
for (const testQuery of brokenQueries) {
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// error in fetching documents because of the invalid query
|
// error in fetching documents because of the invalid query
|
||||||
await PageObjects.discover.showsErrorCallout();
|
await discover.showsErrorCallout();
|
||||||
const message = await testSubjects.getVisibleText('discoverErrorCalloutMessage');
|
const message = await testSubjects.getVisibleText('discoverErrorCalloutMessage');
|
||||||
expect(message).to.contain(
|
expect(message).to.contain(
|
||||||
"[esql] > Couldn't parse Elasticsearch ES|QL query. Check your query and try again."
|
"[esql] > Couldn't parse Elasticsearch ES|QL query. Check your query and try again."
|
||||||
|
@ -250,14 +250,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('switch modal', () => {
|
describe('switch modal', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show switch modal when switching to a data view', async () => {
|
it('should show switch modal when switching to a data view', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.click('switch-to-dataviews');
|
await testSubjects.click('switch-to-dataviews');
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
||||||
|
@ -265,12 +265,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not show switch modal when switching to a data view while a saved search is open', async () => {
|
it('should not show switch modal when switching to a data view while a saved search is open', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.click('switch-to-dataviews');
|
await testSubjects.click('switch-to-dataviews');
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
||||||
|
@ -281,21 +281,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await testSubjects.missingOrFail('discover-esql-to-dataview-modal');
|
await testSubjects.missingOrFail('discover-esql-to-dataview-modal');
|
||||||
});
|
});
|
||||||
await PageObjects.discover.saveSearch('esql_test');
|
await discover.saveSearch('esql_test');
|
||||||
await testSubjects.click('switch-to-dataviews');
|
await testSubjects.click('switch-to-dataviews');
|
||||||
await testSubjects.missingOrFail('discover-esql-to-dataview-modal');
|
await testSubjects.missingOrFail('discover-esql-to-dataview-modal');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show switch modal when switching to a data view while a saved search with unsaved changes is open', async () => {
|
it('should show switch modal when switching to a data view while a saved search with unsaved changes is open', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.saveSearch('esql_test2');
|
await discover.saveSearch('esql_test2');
|
||||||
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.click('switch-to-dataviews');
|
await testSubjects.click('switch-to-dataviews');
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
await testSubjects.existOrFail('discover-esql-to-dataview-modal');
|
||||||
|
@ -305,23 +305,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('inspector', () => {
|
describe('inspector', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows Discover and Lens requests in Inspector', async () => {
|
it('shows Discover and Lens requests in Inspector', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
let retries = 0;
|
let retries = 0;
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
if (retries > 0) {
|
if (retries > 0) {
|
||||||
await inspector.close();
|
await inspector.close();
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
}
|
}
|
||||||
await inspector.open();
|
await inspector.open();
|
||||||
retries = retries + 1;
|
retries = retries + 1;
|
||||||
|
@ -337,10 +337,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
dataSource: { type: 'esql' },
|
dataSource: { type: 'esql' },
|
||||||
query: { esql: 'from kibana_sample_data_flights' },
|
query: { esql: 'from kibana_sample_data_flights' },
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
|
await common.navigateToActualUrl('discover', `?_a=${state}`, {
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | limit 10`;
|
const testQuery = `from logstash-* | limit 10`;
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
window.ELASTIC_ESQL_DELAY_SECONDS = 5;
|
window.ELASTIC_ESQL_DELAY_SECONDS = 5;
|
||||||
});
|
});
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.execute(() => {
|
await browser.execute(() => {
|
||||||
window.ELASTIC_ESQL_DELAY_SECONDS = undefined;
|
window.ELASTIC_ESQL_DELAY_SECONDS = undefined;
|
||||||
});
|
});
|
||||||
|
@ -366,15 +366,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('query history', () => {
|
describe('query history', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should see my current query in the history', async () => {
|
it('should see my current query in the history', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
||||||
const historyItems = await esql.getHistoryItems();
|
const historyItems = await esql.getHistoryItems();
|
||||||
|
@ -387,16 +387,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('updating the query should add this to the history', async () => {
|
it('updating the query should add this to the history', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
||||||
const historyItems = await esql.getHistoryItems();
|
const historyItems = await esql.getHistoryItems();
|
||||||
|
@ -409,10 +409,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should select a query from the history and submit it', async () => {
|
it('should select a query from the history and submit it', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
||||||
// click a history item
|
// click a history item
|
||||||
|
@ -428,16 +428,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a failed query to the history', async () => {
|
it('should add a failed query to the history', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const testQuery = 'from logstash-* | limit 100 | woof and meow';
|
const testQuery = 'from logstash-* | limit 100 | woof and meow';
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
await testSubjects.click('TextBasedLangEditor-toggle-query-history-button');
|
||||||
const historyItem = await esql.getHistoryItem(0);
|
const historyItem = await esql.getHistoryItem(0);
|
||||||
|
@ -449,21 +449,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('should sort correctly', async () => {
|
it('should sort correctly', async () => {
|
||||||
const savedSearchName = 'testSorting';
|
const savedSearchName = 'testSorting';
|
||||||
|
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
const testQuery = 'from logstash-* | sort @timestamp | limit 100';
|
const testQuery = 'from logstash-* | sort @timestamp | limit 100';
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains an initial value', async () => {
|
await retry.waitFor('first cell contains an initial value', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -477,7 +477,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dataGrid.clickDocSortDesc('bytes', 'Sort High-Low');
|
await dataGrid.clickDocSortDesc('bytes', 'Sort High-Low');
|
||||||
|
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains the highest value', async () => {
|
await retry.waitFor('first cell contains the highest value', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -489,10 +489,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'Sort fields\n1'
|
'Sort fields\n1'
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(savedSearchName);
|
await discover.saveSearch(savedSearchName);
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains the same highest value', async () => {
|
await retry.waitFor('first cell contains the same highest value', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -502,8 +502,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains the same highest value after reload', async () => {
|
await retry.waitFor('first cell contains the same highest value after reload', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -511,15 +511,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
return text === '17,966';
|
return text === '17,966';
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await PageObjects.discover.loadSavedSearch(savedSearchName);
|
await discover.loadSavedSearch(savedSearchName);
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor(
|
await retry.waitFor(
|
||||||
'first cell contains the same highest value after reopening',
|
'first cell contains the same highest value after reopening',
|
||||||
|
@ -532,7 +532,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await dataGrid.clickDocSortDesc('bytes', 'Sort Low-High');
|
await dataGrid.clickDocSortDesc('bytes', 'Sort Low-High');
|
||||||
|
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains the lowest value', async () => {
|
await retry.waitFor('first cell contains the lowest value', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -544,10 +544,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'Sort fields\n1'
|
'Sort fields\n1'
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickDocSortDesc('extension', 'Sort A-Z');
|
await dataGrid.clickDocSortDesc('extension', 'Sort A-Z');
|
||||||
|
|
||||||
|
@ -563,8 +563,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains the same lowest value after reload', async () => {
|
await retry.waitFor('first cell contains the same lowest value after reload', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -581,14 +581,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
await PageObjects.discover.saveSearch(savedSearchName);
|
await discover.saveSearch(savedSearchName);
|
||||||
|
|
||||||
await PageObjects.common.navigateToApp('dashboard');
|
await common.navigateToApp('dashboard');
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await dashboardAddPanel.addSavedSearch(savedSearchName);
|
await dashboardAddPanel.addSavedSearch(savedSearchName);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor(
|
await retry.waitFor(
|
||||||
'first cell contains the same lowest value as dashboard panel',
|
'first cell contains the same lowest value as dashboard panel',
|
||||||
|
@ -616,24 +616,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('filtering by clicking on the table', () => {
|
describe('filtering by clicking on the table', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should append a where clause by clicking the table', async () => {
|
it('should append a where clause by clicking the table', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | sort @timestamp desc | limit 10000 | stats countB = count(bytes) by geo.dest | sort countB`;
|
const testQuery = `from logstash-* | sort @timestamp desc | limit 10000 | stats countB = count(bytes) by geo.dest | sort countB`;
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
|
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
await dataGrid.clickCellFilterForButtonExcludingControlColumns(0, 1);
|
await dataGrid.clickCellFilterForButtonExcludingControlColumns(0, 1);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const editorValue = await monacoEditor.getCodeEditorValue();
|
const editorValue = await monacoEditor.getCodeEditorValue();
|
||||||
expect(editorValue).to.eql(
|
expect(editorValue).to.eql(
|
||||||
|
@ -642,9 +642,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// negate
|
// negate
|
||||||
await dataGrid.clickCellFilterOutButtonExcludingControlColumns(0, 1);
|
await dataGrid.clickCellFilterOutButtonExcludingControlColumns(0, 1);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const newValue = await monacoEditor.getCodeEditorValue();
|
const newValue = await monacoEditor.getCodeEditorValue();
|
||||||
expect(newValue).to.eql(
|
expect(newValue).to.eql(
|
||||||
|
@ -653,19 +653,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should append an end in existing where clause by clicking the table', async () => {
|
it('should append an end in existing where clause by clicking the table', async () => {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
const testQuery = `from logstash-* | sort @timestamp desc | limit 10000 | stats countB = count(bytes) by geo.dest | sort countB | where countB > 0`;
|
const testQuery = `from logstash-* | sort @timestamp desc | limit 10000 | stats countB = count(bytes) by geo.dest | sort countB | where countB > 0`;
|
||||||
await monacoEditor.setCodeEditorValue(testQuery);
|
await monacoEditor.setCodeEditorValue(testQuery);
|
||||||
|
|
||||||
await testSubjects.click('querySubmitButton');
|
await testSubjects.click('querySubmitButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
await dataGrid.clickCellFilterForButtonExcludingControlColumns(0, 1);
|
await dataGrid.clickCellFilterForButtonExcludingControlColumns(0, 1);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
|
await unifiedFieldList.waitUntilSidebarHasLoaded();
|
||||||
|
|
||||||
const editorValue = await monacoEditor.getCodeEditorValue();
|
const editorValue = await monacoEditor.getCodeEditorValue();
|
||||||
expect(editorValue).to.eql(
|
expect(editorValue).to.eql(
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
const { common, timePicker, discover } = getPageObjects(['common', 'timePicker', 'discover']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const fromTime = 'Sep 22, 2019 @ 20:31:44.000';
|
const fromTime = 'Sep 22, 2019 @ 20:31:44.000';
|
||||||
|
@ -26,8 +26,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/date_nanos');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/date_nanos');
|
||||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' });
|
await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' });
|
||||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']);
|
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function unloadMakelogs() {
|
after(async function unloadMakelogs() {
|
||||||
|
@ -37,10 +37,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show a timestamp with nanoseconds in the first result row', async function () {
|
it('should show a timestamp with nanoseconds in the first result row', async function () {
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.be(fromTime);
|
expect(time.start).to.be(fromTime);
|
||||||
expect(time.end).to.be(toTime);
|
expect(time.end).to.be(toTime);
|
||||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
const rowData = await discover.getDocTableIndex(1);
|
||||||
expect(rowData.startsWith('Sep 22, 2019 @ 23:50:13.253123345')).to.be.ok();
|
expect(rowData.startsWith('Sep 22, 2019 @ 23:50:13.253123345')).to.be.ok();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);
|
const { common, discover } = getPageObjects(['common', 'discover']);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
|
@ -33,26 +33,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
await browser.setWindowSize(1200, 900);
|
await browser.setWindowSize(1200, 900);
|
||||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_mixed']);
|
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_mixed']);
|
||||||
await PageObjects.common.setTime({ from, to });
|
await common.setTime({ from, to });
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await security.testUser.restoreDefaults();
|
await security.testUser.restoreDefaults();
|
||||||
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_mixed');
|
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_mixed');
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows a list of records of indices with date & date_nanos fields in the right order', async function () {
|
it('shows a list of records of indices with date & date_nanos fields in the right order', async function () {
|
||||||
const isLegacy = await PageObjects.discover.useLegacyTable();
|
const isLegacy = await discover.useLegacyTable();
|
||||||
const rowData1 = await PageObjects.discover.getDocTableIndex(1);
|
const rowData1 = await discover.getDocTableIndex(1);
|
||||||
expect(rowData1).to.contain('Jan 1, 2019 @ 12:10:30.124000000');
|
expect(rowData1).to.contain('Jan 1, 2019 @ 12:10:30.124000000');
|
||||||
const rowData2 = await PageObjects.discover.getDocTableIndex(isLegacy ? 3 : 2);
|
const rowData2 = await discover.getDocTableIndex(isLegacy ? 3 : 2);
|
||||||
expect(rowData2).to.contain('Jan 1, 2019 @ 12:10:30.123498765');
|
expect(rowData2).to.contain('Jan 1, 2019 @ 12:10:30.123498765');
|
||||||
const rowData3 = await PageObjects.discover.getDocTableIndex(isLegacy ? 5 : 3);
|
const rowData3 = await discover.getDocTableIndex(isLegacy ? 5 : 3);
|
||||||
expect(rowData3).to.contain('Jan 1, 2019 @ 12:10:30.123456789');
|
expect(rowData3).to.contain('Jan 1, 2019 @ 12:10:30.123456789');
|
||||||
const rowData4 = await PageObjects.discover.getDocTableIndex(isLegacy ? 7 : 4);
|
const rowData4 = await discover.getDocTableIndex(isLegacy ? 7 : 4);
|
||||||
expect(rowData4).to.contain('Jan 1, 2019 @ 12:10:30.123000000');
|
expect(rowData4).to.contain('Jan 1, 2019 @ 12:10:30.123000000');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const inspector = getService('inspector');
|
const inspector = getService('inspector');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, header, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
'header',
|
||||||
|
@ -39,8 +39,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// and load a set of makelogs data
|
// and load a set of makelogs data
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
|
@ -49,63 +49,63 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const queryName1 = 'Query # 1';
|
const queryName1 = 'Query # 1';
|
||||||
|
|
||||||
it('should show correct time range string by timepicker', async function () {
|
it('should show correct time range string by timepicker', async function () {
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.be(PageObjects.timePicker.defaultStartTime);
|
expect(time.start).to.be(timePicker.defaultStartTime);
|
||||||
expect(time.end).to.be(PageObjects.timePicker.defaultEndTime);
|
expect(time.end).to.be(timePicker.defaultEndTime);
|
||||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
const rowData = await discover.getDocTableIndex(1);
|
||||||
log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)');
|
log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)');
|
||||||
expect(rowData).to.contain('Sep 22, 2015 @ 23:50:13.253');
|
expect(rowData).to.contain('Sep 22, 2015 @ 23:50:13.253');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save query should show toast message and display query name', async function () {
|
it('save query should show toast message and display query name', async function () {
|
||||||
await PageObjects.discover.saveSearch(queryName1);
|
await discover.saveSearch(queryName1);
|
||||||
const actualQueryNameString = await PageObjects.discover.getCurrentQueryName();
|
const actualQueryNameString = await discover.getCurrentQueryName();
|
||||||
expect(actualQueryNameString).to.be(queryName1);
|
expect(actualQueryNameString).to.be(queryName1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('load query should show query name', async function () {
|
it('load query should show query name', async function () {
|
||||||
await PageObjects.discover.loadSavedSearch(queryName1);
|
await discover.loadSavedSearch(queryName1);
|
||||||
|
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName1);
|
expect(await discover.getCurrentQueryName()).to.be(queryName1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renaming a saved query should modify name in breadcrumb', async function () {
|
it('renaming a saved query should modify name in breadcrumb', async function () {
|
||||||
const queryName2 = 'Modified Query # 1';
|
const queryName2 = 'Modified Query # 1';
|
||||||
await PageObjects.discover.loadSavedSearch(queryName1);
|
await discover.loadSavedSearch(queryName1);
|
||||||
await PageObjects.discover.saveSearch(queryName2);
|
await discover.saveSearch(queryName2);
|
||||||
|
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName2);
|
expect(await discover.getCurrentQueryName()).to.be(queryName2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show the correct hit count', async function () {
|
it('should show the correct hit count', async function () {
|
||||||
const expectedHitCount = '14,004';
|
const expectedHitCount = '14,004';
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
|
expect(await discover.getHitCount()).to.be(expectedHitCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show correct time range string in chart', async function () {
|
it('should show correct time range string in chart', async function () {
|
||||||
const actualTimeString = await PageObjects.discover.getChartTimespan();
|
const actualTimeString = await discover.getChartTimespan();
|
||||||
const expectedTimeString = `${PageObjects.timePicker.defaultStartTime} - ${PageObjects.timePicker.defaultEndTime} (interval: Auto - 3 hours)`;
|
const expectedTimeString = `${timePicker.defaultStartTime} - ${timePicker.defaultEndTime} (interval: Auto - 3 hours)`;
|
||||||
expect(actualTimeString).to.be(expectedTimeString);
|
expect(actualTimeString).to.be(expectedTimeString);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should modify the time range when a bar is clicked', async function () {
|
it('should modify the time range when a bar is clicked', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.clickHistogramBar();
|
await discover.clickHistogramBar();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.be('Sep 21, 2015 @ 12:00:00.000');
|
expect(time.start).to.be('Sep 21, 2015 @ 12:00:00.000');
|
||||||
expect(time.end).to.be('Sep 21, 2015 @ 15:00:00.000');
|
expect(time.end).to.be('Sep 21, 2015 @ 15:00:00.000');
|
||||||
await retry.waitForWithTimeout(
|
await retry.waitForWithTimeout(
|
||||||
'table to contain the right search result',
|
'table to contain the right search result',
|
||||||
3000,
|
3000,
|
||||||
async () => {
|
async () => {
|
||||||
const rowData = await PageObjects.discover.getDocTableField(1);
|
const rowData = await discover.getDocTableField(1);
|
||||||
log.debug(`The first timestamp value in doc table: ${rowData}`);
|
log.debug(`The first timestamp value in doc table: ${rowData}`);
|
||||||
return rowData.includes('Sep 21, 2015 @ 14:59:08.840');
|
return rowData.includes('Sep 21, 2015 @ 14:59:08.840');
|
||||||
}
|
}
|
||||||
|
@ -113,37 +113,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show correct initial chart interval of Auto', async function () {
|
it('should show correct initial chart interval of Auto', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await testSubjects.click('discoverQueryHits'); // to cancel out tooltips
|
await testSubjects.click('discoverQueryHits'); // to cancel out tooltips
|
||||||
const actualInterval = await PageObjects.discover.getChartInterval();
|
const actualInterval = await discover.getChartInterval();
|
||||||
|
|
||||||
const expectedInterval = 'auto';
|
const expectedInterval = 'auto';
|
||||||
expect(actualInterval).to.be(expectedInterval);
|
expect(actualInterval).to.be(expectedInterval);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not show "no results"', async () => {
|
it('should not show "no results"', async () => {
|
||||||
const isVisible = await PageObjects.discover.hasNoResults();
|
const isVisible = await discover.hasNoResults();
|
||||||
expect(isVisible).to.be(false);
|
expect(isVisible).to.be(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reload the saved search with persisted query to show the initial hit count', async function () {
|
it('should reload the saved search with persisted query to show the initial hit count', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// apply query some changes
|
// apply query some changes
|
||||||
await queryBar.setQuery('test');
|
await queryBar.setQuery('test');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be('22');
|
expect(await discover.getHitCount()).to.be('22');
|
||||||
});
|
});
|
||||||
|
|
||||||
// reset to persisted state
|
// reset to persisted state
|
||||||
await queryBar.clearQuery();
|
await queryBar.clearQuery();
|
||||||
await PageObjects.discover.revertUnsavedChanges();
|
await discover.revertUnsavedChanges();
|
||||||
const expectedHitCount = '14,004';
|
const expectedHitCount = '14,004';
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await queryBar.getQueryString()).to.be('');
|
expect(await queryBar.getQueryString()).to.be('');
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
|
expect(await discover.getHitCount()).to.be(expectedHitCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -154,27 +154,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
log.debug('setAbsoluteRangeForAnotherQuery');
|
log.debug('setAbsoluteRangeForAnotherQuery');
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show "no results"', async () => {
|
it('should show "no results"', async () => {
|
||||||
await retry.waitFor('no results screen is displayed', async function () {
|
await retry.waitFor('no results screen is displayed', async function () {
|
||||||
const isVisible = await PageObjects.discover.hasNoResults();
|
const isVisible = await discover.hasNoResults();
|
||||||
return isVisible === true;
|
return isVisible === true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should suggest a new time range is picked', async () => {
|
it('should suggest a new time range is picked', async () => {
|
||||||
const isVisible = await PageObjects.discover.hasNoResultsTimepicker();
|
const isVisible = await discover.hasNoResultsTimepicker();
|
||||||
expect(isVisible).to.be(true);
|
expect(isVisible).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show matches when time range is expanded', async () => {
|
it('should show matches when time range is expanded', async () => {
|
||||||
await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();
|
await discover.expandTimeRangeAsSuggestedInNoResultsMessage();
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.hasNoResults()).to.be(false);
|
expect(await discover.hasNoResults()).to.be(false);
|
||||||
expect(await PageObjects.discover.getHitCountInt()).to.be.above(0);
|
expect(await discover.getHitCountInt()).to.be.above(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -182,15 +182,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('nested query', () => {
|
describe('nested query', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
log.debug('setAbsoluteRangeForAnotherQuery');
|
log.debug('setAbsoluteRangeForAnotherQuery');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support querying on nested fields', async function () {
|
it('should support querying on nested fields', async function () {
|
||||||
await queryBar.setQuery('nestedField:{ child: nestedValue }');
|
await queryBar.setQuery('nestedField:{ child: nestedValue }');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be('1');
|
expect(await discover.getHitCount()).to.be('1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -203,9 +203,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await PageObjects.discover.loadSavedSearch(expected.title);
|
await discover.loadSavedSearch(expected.title);
|
||||||
const { title, description } =
|
const { title, description } = await common.getSharedItemTitleAndDescription();
|
||||||
await PageObjects.common.getSharedItemTitleAndDescription();
|
|
||||||
expect(title).to.eql(expected.title);
|
expect(title).to.eql(expected.title);
|
||||||
expect(description).to.eql(expected.description);
|
expect(description).to.eql(expected.description);
|
||||||
});
|
});
|
||||||
|
@ -215,32 +214,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('time zone switch', () => {
|
describe('time zone switch', () => {
|
||||||
it('should show bars in the correct time zone after switching', async function () {
|
it('should show bars in the correct time zone after switching', async function () {
|
||||||
await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'America/Phoenix' });
|
await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'America/Phoenix' });
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await queryBar.clearQuery();
|
await queryBar.clearQuery();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
'check that the newest doc timestamp is now -7 hours from the UTC time in the first test'
|
'check that the newest doc timestamp is now -7 hours from the UTC time in the first test'
|
||||||
);
|
);
|
||||||
const rowData = await PageObjects.discover.getDocTableIndex(1);
|
const rowData = await discover.getDocTableIndex(1);
|
||||||
expect(rowData.startsWith('Sep 22, 2015 @ 16:50:13.253')).to.be.ok();
|
expect(rowData.startsWith('Sep 22, 2015 @ 16:50:13.253')).to.be.ok();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('invalid time range in URL', function () {
|
describe('invalid time range in URL', function () {
|
||||||
it('should get the default timerange', async function () {
|
it('should get the default timerange', async function () {
|
||||||
await PageObjects.common.navigateToUrl('discover', '#/?_g=(time:(from:now-15m,to:null))', {
|
await common.navigateToUrl('discover', '#/?_g=(time:(from:now-15m,to:null))', {
|
||||||
useActualUrl: true,
|
useActualUrl: true,
|
||||||
});
|
});
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
const time = await PageObjects.timePicker.getTimeConfig();
|
const time = await timePicker.getTimeConfig();
|
||||||
expect(time.start).to.be('~ 15 minutes ago');
|
expect(time.start).to.be('~ 15 minutes ago');
|
||||||
expect(time.end).to.be('now');
|
expect(time.end).to.be('now');
|
||||||
});
|
});
|
||||||
|
@ -248,23 +247,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('managing fields', function () {
|
describe('managing fields', function () {
|
||||||
it('should add a field, sort by it, remove it and also sorting by it', async function () {
|
it('should add a field, sort by it, remove it and also sorting by it', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('_score');
|
await unifiedFieldList.clickFieldListItemAdd('_score');
|
||||||
await PageObjects.discover.clickFieldSort('_score', 'Sort Low-High');
|
await discover.clickFieldSort('_score', 'Sort Low-High');
|
||||||
const currentUrlWithScore = await browser.getCurrentUrl();
|
const currentUrlWithScore = await browser.getCurrentUrl();
|
||||||
expect(currentUrlWithScore).to.contain('_score');
|
expect(currentUrlWithScore).to.contain('_score');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('_score');
|
await unifiedFieldList.clickFieldListItemRemove('_score');
|
||||||
const currentUrlWithoutScore = await browser.getCurrentUrl();
|
const currentUrlWithoutScore = await browser.getCurrentUrl();
|
||||||
expect(currentUrlWithoutScore).not.to.contain('_score');
|
expect(currentUrlWithoutScore).not.to.contain('_score');
|
||||||
});
|
});
|
||||||
it('should add a field with customLabel, sort by it, display it correctly', async function () {
|
it('should add a field with customLabel, sort by it, display it correctly', async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('referer');
|
await unifiedFieldList.clickFieldListItemAdd('referer');
|
||||||
await PageObjects.discover.clickFieldSort('referer', 'Sort A-Z');
|
await discover.clickFieldSort('referer', 'Sort A-Z');
|
||||||
expect(await PageObjects.discover.getDocHeader()).to.have.string('Referer custom');
|
expect(await discover.getDocHeader()).to.have.string('Referer custom');
|
||||||
expect(await PageObjects.unifiedFieldList.getAllFieldNames()).to.contain('Referer custom');
|
expect(await unifiedFieldList.getAllFieldNames()).to.contain('Referer custom');
|
||||||
const url = await browser.getCurrentUrl();
|
const url = await browser.getCurrentUrl();
|
||||||
expect(url).to.contain('referer');
|
expect(url).to.contain('referer');
|
||||||
});
|
});
|
||||||
|
@ -273,7 +272,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('refresh interval', function () {
|
describe('refresh interval', function () {
|
||||||
it('should refetch when autofresh is enabled', async () => {
|
it('should refetch when autofresh is enabled', async () => {
|
||||||
const intervalS = 5;
|
const intervalS = 5;
|
||||||
await PageObjects.timePicker.startAutoRefresh(intervalS);
|
await timePicker.startAutoRefresh(intervalS);
|
||||||
|
|
||||||
const getRequestTimestamp = async () => {
|
const getRequestTimestamp = async () => {
|
||||||
// check inspector panel request stats for timestamp
|
// check inspector panel request stats for timestamp
|
||||||
|
@ -301,7 +300,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await inspector.close();
|
await inspector.close();
|
||||||
await PageObjects.timePicker.pauseAutoRefresh();
|
await timePicker.pauseAutoRefresh();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
|
const { common } = getPageObjects(['common']);
|
||||||
|
|
||||||
const defaultSettings = {
|
const defaultSettings = {
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
|
@ -39,7 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// and load a set of makelogs data
|
// and load a set of makelogs data
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
|
|
@ -16,10 +16,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const elasticChart = getService('elasticChart');
|
const elasticChart = getService('elasticChart');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects([
|
const { timePicker, dashboard, discover, common, header } = getPageObjects([
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'settings',
|
|
||||||
'discover',
|
'discover',
|
||||||
'common',
|
'common',
|
||||||
'header',
|
'header',
|
||||||
|
@ -44,29 +43,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
await security.testUser.setRoles(['kibana_admin', 'long_window_logstash']);
|
await security.testUser.setRoles(['kibana_admin', 'long_window_logstash']);
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash');
|
await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash');
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
await security.testUser.restoreDefaults();
|
await security.testUser.restoreDefaults();
|
||||||
await PageObjects.common.unsetTime();
|
await common.unsetTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
async function prepareTest(time: TimeStrings, interval?: string) {
|
async function prepareTest(time: TimeStrings, interval?: string) {
|
||||||
await PageObjects.common.setTime(time);
|
await common.setTime(time);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
if (interval) {
|
if (interval) {
|
||||||
await PageObjects.discover.setChartInterval(interval);
|
await discover.setChartInterval(interval);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should modify the time range when the histogram is brushed', async function () {
|
it('should modify the time range when the histogram is brushed', async function () {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const prevRenderingCount = await elasticChart.getVisualizationRenderingCount();
|
const prevRenderingCount = await elasticChart.getVisualizationRenderingCount();
|
||||||
await retry.waitFor('chart rendering complete', async () => {
|
await retry.waitFor('chart rendering complete', async () => {
|
||||||
const actualCount = await elasticChart.getVisualizationRenderingCount();
|
const actualCount = await elasticChart.getVisualizationRenderingCount();
|
||||||
|
@ -77,12 +76,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
let prevRowData = '';
|
let prevRowData = '';
|
||||||
// to make sure the table is already rendered
|
// to make sure the table is already rendered
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
prevRowData = await PageObjects.discover.getDocTableField(1);
|
prevRowData = await discover.getDocTableField(1);
|
||||||
log.debug(`The first timestamp value in doc table before brushing: ${prevRowData}`);
|
log.debug(`The first timestamp value in doc table before brushing: ${prevRowData}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
await PageObjects.discover.brushHistogram();
|
await discover.brushHistogram();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
const renderingCountInc = 2;
|
const renderingCountInc = 2;
|
||||||
await retry.waitFor('chart rendering complete after being brushed', async () => {
|
await retry.waitFor('chart rendering complete after being brushed', async () => {
|
||||||
const actualCount = await elasticChart.getVisualizationRenderingCount();
|
const actualCount = await elasticChart.getVisualizationRenderingCount();
|
||||||
|
@ -90,42 +89,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
log.debug(`renderings after brushing - actual: ${actualCount} expected: ${expectedCount}`);
|
log.debug(`renderings after brushing - actual: ${actualCount} expected: ${expectedCount}`);
|
||||||
return actualCount <= expectedCount;
|
return actualCount <= expectedCount;
|
||||||
});
|
});
|
||||||
const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours();
|
const newDurationHours = await timePicker.getTimeDurationInHours();
|
||||||
expect(Math.round(newDurationHours)).to.be(24); // might fail if histogram's width changes
|
expect(Math.round(newDurationHours)).to.be(24); // might fail if histogram's width changes
|
||||||
|
|
||||||
await retry.waitFor('doc table containing the documents of the brushed range', async () => {
|
await retry.waitFor('doc table containing the documents of the brushed range', async () => {
|
||||||
const rowData = await PageObjects.discover.getDocTableField(1);
|
const rowData = await discover.getDocTableField(1);
|
||||||
log.debug(`The first timestamp value in doc table after brushing: ${rowData}`);
|
log.debug(`The first timestamp value in doc table after brushing: ${rowData}`);
|
||||||
return prevRowData !== rowData;
|
return prevRowData !== rowData;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update correctly when switching data views and brushing the histogram', async () => {
|
it('should update correctly when switching data views and brushing the histogram', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.selectIndexPattern('logstash-*');
|
await discover.selectIndexPattern('logstash-*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.selectIndexPattern('long-window-logstash-*');
|
await discover.selectIndexPattern('long-window-logstash-*');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.brushHistogram();
|
await discover.brushHistogram();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be('7');
|
expect(await discover.getHitCount()).to.be('7');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update the histogram timerange when the query is resubmitted', async function () {
|
it('should update the histogram timerange when the query is resubmitted', async function () {
|
||||||
await kibanaServer.uiSettings.update({
|
await kibanaServer.uiSettings.update({
|
||||||
'timepicker:timeDefaults': '{ "from": "2015-09-18T19:37:13.000Z", "to": "now"}',
|
'timepicker:timeDefaults': '{ "from": "2015-09-18T19:37:13.000Z", "to": "now"}',
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
const initialTimeString = await PageObjects.discover.getChartTimespan();
|
const initialTimeString = await discover.getChartTimespan();
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('chart timespan to have changed', async () => {
|
await retry.waitFor('chart timespan to have changed', async () => {
|
||||||
const refreshedTimeString = await PageObjects.discover.getChartTimespan();
|
const refreshedTimeString = await discover.getChartTimespan();
|
||||||
await queryBar.clickQuerySubmitButton();
|
await queryBar.clickQuerySubmitButton();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
log.debug(
|
log.debug(
|
||||||
`Timestamp before: ${initialTimeString}, Timestamp after: ${refreshedTimeString}`
|
`Timestamp before: ${initialTimeString}, Timestamp after: ${refreshedTimeString}`
|
||||||
);
|
);
|
||||||
|
@ -153,7 +152,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await prepareTest({ from, to }, 'Day');
|
await prepareTest({ from, to }, 'Day');
|
||||||
const chartCanvasExist = await elasticChart.canvasExists();
|
const chartCanvasExist = await elasticChart.canvasExists();
|
||||||
expect(chartCanvasExist).to.be(true);
|
expect(chartCanvasExist).to.be(true);
|
||||||
const chartIntervalIconTip = await PageObjects.discover.getChartIntervalWarningIcon();
|
const chartIntervalIconTip = await discover.getChartIntervalWarningIcon();
|
||||||
expect(chartIntervalIconTip).to.be(false);
|
expect(chartIntervalIconTip).to.be(false);
|
||||||
});
|
});
|
||||||
it('should visualize monthly data with different years scaled to seconds', async () => {
|
it('should visualize monthly data with different years scaled to seconds', async () => {
|
||||||
|
@ -162,7 +161,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await prepareTest({ from, to }, 'Second');
|
await prepareTest({ from, to }, 'Second');
|
||||||
const chartCanvasExist = await elasticChart.canvasExists();
|
const chartCanvasExist = await elasticChart.canvasExists();
|
||||||
expect(chartCanvasExist).to.be(true);
|
expect(chartCanvasExist).to.be(true);
|
||||||
const chartIntervalIconTip = await PageObjects.discover.getChartIntervalWarningIcon();
|
const chartIntervalIconTip = await discover.getChartIntervalWarningIcon();
|
||||||
expect(chartIntervalIconTip).to.be(true);
|
expect(chartIntervalIconTip).to.be(true);
|
||||||
});
|
});
|
||||||
it('should allow hide/show histogram, persisted in url state', async () => {
|
it('should allow hide/show histogram, persisted in url state', async () => {
|
||||||
|
@ -171,7 +170,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await prepareTest({ from, to });
|
await prepareTest({ from, to });
|
||||||
let canvasExists = await elasticChart.canvasExists();
|
let canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(true);
|
expect(canvasExists).to.be(true);
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(false);
|
expect(canvasExists).to.be(false);
|
||||||
|
@ -180,8 +179,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await browser.refresh();
|
await browser.refresh();
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(false);
|
expect(canvasExists).to.be(false);
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(true);
|
expect(canvasExists).to.be(true);
|
||||||
|
@ -194,7 +193,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await prepareTest({ from, to });
|
await prepareTest({ from, to });
|
||||||
|
|
||||||
// close chart for saved search
|
// close chart for saved search
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
let canvasExists: boolean;
|
let canvasExists: boolean;
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
|
@ -202,43 +201,43 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// save search
|
// save search
|
||||||
await PageObjects.discover.saveSearch(savedSearch);
|
await discover.saveSearch(savedSearch);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// open new search
|
// open new search
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// load saved search
|
// load saved search
|
||||||
await PageObjects.discover.loadSavedSearch(savedSearch);
|
await discover.loadSavedSearch(savedSearch);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(false);
|
expect(canvasExists).to.be(false);
|
||||||
|
|
||||||
// open chart for saved search
|
// open chart for saved search
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await retry.waitFor(`Discover histogram to be displayed`, async () => {
|
await retry.waitFor(`Discover histogram to be displayed`, async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
return canvasExists;
|
return canvasExists;
|
||||||
});
|
});
|
||||||
|
|
||||||
// save search
|
// save search
|
||||||
await PageObjects.discover.saveSearch(savedSearch);
|
await discover.saveSearch(savedSearch);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// open new search
|
// open new search
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// load saved search
|
// load saved search
|
||||||
await PageObjects.discover.loadSavedSearch(savedSearch);
|
await discover.loadSavedSearch(savedSearch);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(true);
|
expect(canvasExists).to.be(true);
|
||||||
});
|
});
|
||||||
it('should show permitted hidden histogram state when returning back to discover', async () => {
|
it('should show permitted hidden histogram state when returning back to discover', async () => {
|
||||||
// close chart
|
// close chart
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
let canvasExists: boolean;
|
let canvasExists: boolean;
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
|
@ -246,28 +245,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// save search
|
// save search
|
||||||
await PageObjects.discover.saveSearch('persisted hidden histogram');
|
await discover.saveSearch('persisted hidden histogram');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// open chart
|
// open chart
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(true);
|
expect(canvasExists).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// go to dashboard
|
// go to dashboard
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
// go to discover
|
// go to discover
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(true);
|
expect(canvasExists).to.be(true);
|
||||||
|
|
||||||
// close chart
|
// close chart
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
canvasExists = await elasticChart.canvasExists();
|
canvasExists = await elasticChart.canvasExists();
|
||||||
expect(canvasExists).to.be(false);
|
expect(canvasExists).to.be(false);
|
||||||
|
@ -275,33 +274,33 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should recover from broken query search when clearing the query bar', async () => {
|
it('should recover from broken query search when clearing the query bar', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// Make sure the chart is visible
|
// Make sure the chart is visible
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// type an invalid search query, hit refresh
|
// type an invalid search query, hit refresh
|
||||||
await queryBar.setQuery('this is > not valid');
|
await queryBar.setQuery('this is > not valid');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
|
|
||||||
await PageObjects.discover.showsErrorCallout();
|
await discover.showsErrorCallout();
|
||||||
|
|
||||||
// now remove the query
|
// now remove the query
|
||||||
await queryBar.clearQuery();
|
await queryBar.clearQuery();
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
// check no error state
|
// check no error state
|
||||||
expect(await PageObjects.discover.isChartVisible()).to.be(true);
|
expect(await discover.isChartVisible()).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset all histogram state when resetting the saved search', async () => {
|
it('should reset all histogram state when resetting the saved search', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
const savedSearch = 'histogram state';
|
const savedSearch = 'histogram state';
|
||||||
await PageObjects.discover.saveSearch(savedSearch);
|
await discover.saveSearch(savedSearch);
|
||||||
await PageObjects.discover.chooseBreakdownField('extension.keyword');
|
await discover.chooseBreakdownField('extension.keyword');
|
||||||
await PageObjects.discover.setChartInterval('Second');
|
await discover.setChartInterval('Second');
|
||||||
let requestData =
|
let requestData =
|
||||||
(await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? '';
|
(await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? '';
|
||||||
expect(JSON.parse(requestData)).to.eql({
|
expect(JSON.parse(requestData)).to.eql({
|
||||||
|
@ -310,10 +309,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
timeInterval: 's',
|
timeInterval: 's',
|
||||||
breakdownField: 'extension.keyword',
|
breakdownField: 'extension.keyword',
|
||||||
});
|
});
|
||||||
await PageObjects.discover.toggleChartVisibility();
|
await discover.toggleChartVisibility();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.revertUnsavedChanges();
|
await discover.revertUnsavedChanges();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
requestData =
|
requestData =
|
||||||
(await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? '';
|
(await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? '';
|
||||||
expect(JSON.parse(requestData)).to.eql({
|
expect(JSON.parse(requestData)).to.eql({
|
||||||
|
|
|
@ -14,17 +14,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
|
const { common, discover, header, timePicker } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'discover',
|
||||||
|
'header',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
|
|
||||||
describe('discover unified histogram breakdown', function describeIndexTests() {
|
describe('discover unified histogram breakdown', function describeIndexTests() {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
|
||||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' });
|
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' });
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -32,30 +37,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should choose breakdown field', async () => {
|
it('should choose breakdown field', async () => {
|
||||||
await PageObjects.discover.chooseBreakdownField('extension.raw');
|
await discover.chooseBreakdownField('extension.raw');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const list = await PageObjects.discover.getHistogramLegendList();
|
const list = await discover.getHistogramLegendList();
|
||||||
expect(list).to.eql(['jpg', 'css', 'png', 'Other']);
|
expect(list).to.eql(['jpg', 'css', 'png', 'Other']);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add filter using histogram legend values', async () => {
|
it('should add filter using histogram legend values', async () => {
|
||||||
await PageObjects.discover.clickLegendFilter('png', '+');
|
await discover.clickLegendFilter('png', '+');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
expect(await filterBar.hasFilter('extension.raw', 'png')).to.be(true);
|
expect(await filterBar.hasFilter('extension.raw', 'png')).to.be(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should save breakdown field in saved search', async () => {
|
it('should save breakdown field in saved search', async () => {
|
||||||
await filterBar.removeFilter('extension.raw');
|
await filterBar.removeFilter('extension.raw');
|
||||||
await PageObjects.discover.saveSearch('with breakdown');
|
await discover.saveSearch('with breakdown');
|
||||||
|
|
||||||
await PageObjects.discover.clickNewSearchButton();
|
await discover.clickNewSearchButton();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const prevList = await PageObjects.discover.getHistogramLegendList();
|
const prevList = await discover.getHistogramLegendList();
|
||||||
expect(prevList).to.eql([]);
|
expect(prevList).to.eql([]);
|
||||||
|
|
||||||
await PageObjects.discover.loadSavedSearch('with breakdown');
|
await discover.loadSavedSearch('with breakdown');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
const list = await PageObjects.discover.getHistogramLegendList();
|
const list = await discover.getHistogramLegendList();
|
||||||
expect(list).to.eql(['jpg', 'css', 'png', 'Other']);
|
expect(list).to.eql(['jpg', 'css', 'png', 'Other']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const find = getService('find');
|
const find = getService('find');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'context']);
|
const { common, header, timePicker } = getPageObjects(['common', 'header', 'timePicker']);
|
||||||
|
|
||||||
const defaultSettings = {
|
const defaultSettings = {
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
|
@ -32,9 +32,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
// and load a set of makelogs data
|
// and load a set of makelogs data
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -45,7 +45,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
||||||
await rowActions[0].click();
|
await rowActions[0].click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await browser.pressKeys(browser.keys.TAB);
|
await browser.pressKeys(browser.keys.TAB);
|
||||||
await browser.pressKeys(browser.keys.SPACE);
|
await browser.pressKeys(browser.keys.SPACE);
|
||||||
await browser.pressKeys(browser.keys.TAB);
|
await browser.pressKeys(browser.keys.TAB);
|
||||||
|
|
|
@ -14,7 +14,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects(['common', 'header', 'discover', 'timePicker']);
|
const { common, header, discover, timePicker } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'header',
|
||||||
|
'discover',
|
||||||
|
'timePicker',
|
||||||
|
]);
|
||||||
|
|
||||||
describe('errors', function describeIndexTests() {
|
describe('errors', function describeIndexTests() {
|
||||||
before(async function () {
|
before(async function () {
|
||||||
|
@ -23,8 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load(
|
await kibanaServer.importExport.load(
|
||||||
'test/functional/fixtures/kbn_archiver/invalid_scripted_field'
|
'test/functional/fixtures/kbn_archiver/invalid_scripted_field'
|
||||||
);
|
);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -33,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('invalid scripted field error', () => {
|
describe('invalid scripted field error', () => {
|
||||||
it('is rendered', async () => {
|
it('is rendered', async () => {
|
||||||
await PageObjects.discover.showsErrorCallout();
|
await discover.showsErrorCallout();
|
||||||
const painlessStackTrace = await testSubjects.find('painlessStackTrace');
|
const painlessStackTrace = await testSubjects.find('painlessStackTrace');
|
||||||
expect(painlessStackTrace).not.to.be(undefined);
|
expect(painlessStackTrace).not.to.be(undefined);
|
||||||
});
|
});
|
||||||
|
@ -41,11 +46,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
describe('not found', () => {
|
describe('not found', () => {
|
||||||
it('should redirect to main page when trying to access invalid route', async () => {
|
it('should redirect to main page when trying to access invalid route', async () => {
|
||||||
await PageObjects.common.navigateToUrl('discover', '#/invalid-route', {
|
await common.navigateToUrl('discover', '#/invalid-route', {
|
||||||
useActualUrl: true,
|
useActualUrl: true,
|
||||||
ensureCurrentUrl: false,
|
ensureCurrentUrl: false,
|
||||||
});
|
});
|
||||||
await PageObjects.header.awaitKibanaChrome();
|
await header.awaitKibanaChrome();
|
||||||
|
|
||||||
const invalidLink = await testSubjects.find('invalidRouteMessage');
|
const invalidLink = await testSubjects.find('invalidRouteMessage');
|
||||||
expect(await invalidLink.getVisibleText()).to.be(
|
expect(await invalidLink.getVisibleText()).to.be(
|
||||||
|
|
|
@ -13,7 +13,11 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
describe('discover data grid tests', function describeDiscoverDataGrid() {
|
describe('discover data grid tests', function describeDiscoverDataGrid() {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'unifiedFieldList']);
|
const { common, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'timePicker',
|
||||||
|
'unifiedFieldList',
|
||||||
|
]);
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const defaultSettings = { defaultIndex: 'logstash-*' };
|
const defaultSettings = { defaultIndex: 'logstash-*' };
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
|
@ -27,8 +31,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can add fields to the table', async function () {
|
it('can add fields to the table', async function () {
|
||||||
|
@ -37,16 +41,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
expect(await getTitles()).to.be('@timestamp Document');
|
expect(await getTitles()).to.be('@timestamp Document');
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
expect(await getTitles()).to.be('@timestamp bytes');
|
expect(await getTitles()).to.be('@timestamp bytes');
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('agent');
|
await unifiedFieldList.clickFieldListItemAdd('agent');
|
||||||
expect(await getTitles()).to.be('@timestamp bytes agent');
|
expect(await getTitles()).to.be('@timestamp bytes agent');
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('bytes');
|
await unifiedFieldList.clickFieldListItemRemove('bytes');
|
||||||
expect(await getTitles()).to.be('@timestamp agent');
|
expect(await getTitles()).to.be('@timestamp agent');
|
||||||
|
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('agent');
|
await unifiedFieldList.clickFieldListItemRemove('agent');
|
||||||
expect(await getTitles()).to.be('@timestamp Document');
|
expect(await getTitles()).to.be('@timestamp Document');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, dashboard, header, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'settings',
|
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'header',
|
'header',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
|
@ -47,21 +46,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update(defaultSettings);
|
await kibanaServer.uiSettings.update(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
|
|
||||||
for (const columnName of TEST_COLUMN_NAMES) {
|
for (const columnName of TEST_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(columnName);
|
await unifiedFieldList.clickFieldListItemAdd(columnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItem(columnName);
|
await unifiedFieldList.clickFieldListItem(columnName);
|
||||||
await PageObjects.unifiedFieldList.clickFieldListPlusFilter(columnName, value);
|
await unifiedFieldList.clickFieldListPlusFilter(columnName, value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.resetDefaultAbsoluteRangeViaUiSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the context view with the selected document as anchor', async () => {
|
it('should open the context view with the selected document as anchor', async () => {
|
||||||
|
@ -103,16 +102,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('navigates to context view from embeddable', async () => {
|
it('navigates to context view from embeddable', async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.saveSearch('my search');
|
await discover.saveSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
|
|
||||||
await dashboardAddPanel.addSavedSearch('my search');
|
await dashboardAddPanel.addSavedSearch('my search');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const toasts = getService('toasts');
|
const toasts = getService('toasts');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'dashboard']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
const defaultSettings = {
|
const defaultSettings = {
|
||||||
defaultIndex: 'logstash-*',
|
defaultIndex: 'logstash-*',
|
||||||
};
|
};
|
||||||
|
@ -31,11 +31,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -45,7 +45,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should be able to copy a column values to clipboard', async () => {
|
it('should be able to copy a column values to clipboard', async () => {
|
||||||
const canReadClipboard = await browser.checkBrowserPermission('clipboard-read');
|
const canReadClipboard = await browser.checkBrowserPermission('clipboard-read');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickCopyColumnValues('@timestamp');
|
await dataGrid.clickCopyColumnValues('@timestamp');
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should be able to copy a column name to clipboard', async () => {
|
it('should be able to copy a column name to clipboard', async () => {
|
||||||
const canReadClipboard = await browser.checkBrowserPermission('clipboard-read');
|
const canReadClipboard = await browser.checkBrowserPermission('clipboard-read');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickCopyColumnName('@timestamp');
|
await dataGrid.clickCopyColumnName('@timestamp');
|
||||||
if (canReadClipboard) {
|
if (canReadClipboard) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const filterBar = getService('filterBar');
|
const filterBar = getService('filterBar');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'context']);
|
const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']);
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
|
@ -33,9 +33,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update(defaultSettings);
|
await kibanaServer.uiSettings.update(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the doc view of the selected document', async function () {
|
it('should open the doc view of the selected document', async function () {
|
||||||
|
@ -58,7 +58,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create an exists filter from doc view of the selected document', async function () {
|
it('should create an exists filter from doc view of the selected document', async function () {
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
await dataGrid.clickFieldActionInFlyout('@timestamp', 'addExistsFilterButton');
|
await dataGrid.clickFieldActionInFlyout('@timestamp', 'addExistsFilterButton');
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const monacoEditor = getService('monacoEditor');
|
const monacoEditor = getService('monacoEditor');
|
||||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, header, timePicker, dashboard, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'header',
|
'header',
|
||||||
|
@ -41,11 +41,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
@ -65,17 +65,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const fromTime = 'Sep 20, 2015 @ 23:00:00.000';
|
const fromTime = 'Sep 20, 2015 @ 23:00:00.000';
|
||||||
const toTime = 'Sep 20, 2015 @ 23:14:00.000';
|
const toTime = 'Sep 20, 2015 @ 23:14:00.000';
|
||||||
|
|
||||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
await timePicker.setAbsoluteRange(fromTime, toTime);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
const finalRows = await PageObjects.discover.getDocTableRows();
|
const finalRows = await discover.getDocTableRows();
|
||||||
expect(finalRows.length).to.be.below(initialRows.length);
|
expect(finalRows.length).to.be.below(initialRows.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show popover with expanded cell content by click on expand button', async () => {
|
it('should show popover with expanded cell content by click on expand button', async () => {
|
||||||
log.debug('open popover with expanded cell content to get json from the editor');
|
log.debug('open popover with expanded cell content to get json from the editor');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitForWithTimeout('timestamp matches expected doc', 5000, async () => {
|
await retry.waitForWithTimeout('timestamp matches expected doc', 5000, async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -111,14 +111,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
it('should show popover with expanded cell content by click on expand button on embeddable', async () => {
|
it('should show popover with expanded cell content by click on expand button on embeddable', async () => {
|
||||||
log.debug('open popover with expanded cell content to get json from the editor');
|
log.debug('open popover with expanded cell content to get json from the editor');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
await timePicker.setDefaultAbsoluteRange();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
await PageObjects.discover.saveSearch('expand-cell-search');
|
await discover.saveSearch('expand-cell-search');
|
||||||
|
|
||||||
await PageObjects.dashboard.navigateToApp();
|
await dashboard.navigateToApp();
|
||||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
await dashboard.gotoDashboardLandingPage();
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await dashboardAddPanel.addSavedSearch('expand-cell-search');
|
await dashboardAddPanel.addSavedSearch('expand-cell-search');
|
||||||
|
|
||||||
await retry.waitForWithTimeout('timestamp matches expected doc', 5000, async () => {
|
await retry.waitForWithTimeout('timestamp matches expected doc', 5000, async () => {
|
||||||
|
@ -221,42 +221,38 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove(column);
|
await unifiedFieldList.clickFieldListItemRemove(column);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add more columns to the table', async function () {
|
it('should add more columns to the table', async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clearFieldSearchInput();
|
await unifiedFieldList.clearFieldSearchInput();
|
||||||
await PageObjects.unifiedFieldList.findFieldByName(column);
|
await unifiedFieldList.findFieldByName(column);
|
||||||
await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields(
|
await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]);
|
||||||
expectedFieldLength[column]
|
await unifiedFieldList.clickFieldListItemAdd(column);
|
||||||
);
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(column);
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
|
||||||
// test the header now
|
// test the header now
|
||||||
const header = await dataGrid.getHeaderFields();
|
const headerFields = await dataGrid.getHeaderFields();
|
||||||
expect(header.join(' ')).to.have.string(column);
|
expect(headerFields.join(' ')).to.have.string(column);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove columns from the table', async function () {
|
it('should remove columns from the table', async function () {
|
||||||
for (const column of extraColumns) {
|
for (const column of extraColumns) {
|
||||||
await PageObjects.unifiedFieldList.clearFieldSearchInput();
|
await unifiedFieldList.clearFieldSearchInput();
|
||||||
await PageObjects.unifiedFieldList.findFieldByName(column);
|
await unifiedFieldList.findFieldByName(column);
|
||||||
await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields(
|
await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]);
|
||||||
expectedFieldLength[column]
|
await unifiedFieldList.clickFieldListItemAdd(column);
|
||||||
);
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(column);
|
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
|
||||||
}
|
}
|
||||||
// remove the second column
|
// remove the second column
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove(extraColumns[1]);
|
await unifiedFieldList.clickFieldListItemRemove(extraColumns[1]);
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
// test that the second column is no longer there
|
// test that the second column is no longer there
|
||||||
const header = await dataGrid.getHeaderFields();
|
const headerFields = await dataGrid.getHeaderFields();
|
||||||
expect(header.join(' ')).to.not.have.string(extraColumns[1]);
|
expect(headerFields.join(' ')).to.not.have.string(extraColumns[1]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,11 +15,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const queryBar = getService('queryBar');
|
const queryBar = getService('queryBar');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'header',
|
|
||||||
'discover',
|
'discover',
|
||||||
'visualize',
|
|
||||||
'timePicker',
|
'timePicker',
|
||||||
'unifiedFieldList',
|
'unifiedFieldList',
|
||||||
]);
|
]);
|
||||||
|
@ -34,9 +32,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
|
||||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update(defaultSettings);
|
await kibanaServer.uiSettings.update(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
});
|
});
|
||||||
describe('field data', function () {
|
describe('field data', function () {
|
||||||
it('search php should show the correct hit count', async function () {
|
it('search php should show the correct hit count', async function () {
|
||||||
|
@ -44,18 +42,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
await queryBar.setQuery('php');
|
await queryBar.setQuery('php');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be(expectedHitCount);
|
expect(hitCount).to.be(expectedHitCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('the search term should be highlighted in the field data', async function () {
|
it('the search term should be highlighted in the field data', async function () {
|
||||||
// marks is the style that highlights the text in yellow
|
// marks is the style that highlights the text in yellow
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
const marks = await PageObjects.discover.getMarks();
|
const marks = await discover.getMarks();
|
||||||
expect(marks.length).to.be.greaterThan(0);
|
expect(marks.length).to.be.greaterThan(0);
|
||||||
expect(marks.indexOf('php')).to.be(0);
|
expect(marks.indexOf('php')).to.be(0);
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemRemove('extension');
|
await unifiedFieldList.clickFieldListItemRemove('extension');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('search type:apache should show the correct hit count', async function () {
|
it('search type:apache should show the correct hit count', async function () {
|
||||||
|
@ -63,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await queryBar.setQuery('type:apache');
|
await queryBar.setQuery('type:apache');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await retry.try(async function tryingForTime() {
|
await retry.try(async function tryingForTime() {
|
||||||
const hitCount = await PageObjects.discover.getHitCount();
|
const hitCount = await discover.getHitCount();
|
||||||
expect(hitCount).to.be(expectedHitCount);
|
expect(hitCount).to.be(expectedHitCount);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -77,7 +75,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('doc view should sort ascending', async function () {
|
it('doc view should sort ascending', async function () {
|
||||||
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
|
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
|
||||||
await dataGrid.clickDocSortAsc();
|
await dataGrid.clickDocSortAsc();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
await retry.waitFor('first cell contains expected timestamp', async () => {
|
await retry.waitFor('first cell contains expected timestamp', async () => {
|
||||||
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
const cell = await dataGrid.getCellElementExcludingControlColumns(0, 0);
|
||||||
|
@ -92,8 +90,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'whitespace but "(" found.';
|
'whitespace but "(" found.';
|
||||||
await queryBar.setQuery('xxx(yyy))');
|
await queryBar.setQuery('xxx(yyy))');
|
||||||
await queryBar.submitQuery();
|
await queryBar.submitQuery();
|
||||||
await PageObjects.discover.showsErrorCallout();
|
await discover.showsErrorCallout();
|
||||||
const message = await PageObjects.discover.getDiscoverErrorMessage();
|
const message = await discover.getDiscoverErrorMessage();
|
||||||
expect(message).to.contain(expectedError);
|
expect(message).to.contain(expectedError);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const PageObjects = getPageObjects([
|
const { common, discover, timePicker, dashboard, unifiedFieldList, header } = getPageObjects([
|
||||||
'common',
|
'common',
|
||||||
'discover',
|
'discover',
|
||||||
'timePicker',
|
'timePicker',
|
||||||
|
@ -33,14 +33,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function findFirstColumnTokens() {
|
async function findFirstColumnTokens() {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
return await findFirstFieldIcons('euiDataGridBody > dataGridHeader');
|
return await findFirstFieldIcons('euiDataGridBody > dataGridHeader');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findFirstDocViewerTokens() {
|
async function findFirstDocViewerTokens() {
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
let fieldTokens: string[] | undefined = [];
|
let fieldTokens: string[] | undefined = [];
|
||||||
await retry.try(async () => {
|
await retry.try(async () => {
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
|
@ -85,14 +85,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update(defaultSettings);
|
await kibanaServer.uiSettings.update(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not render field tokens when Document column is visible', async function () {
|
it('should not render field tokens when Document column is visible', async function () {
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be('14,004');
|
expect(await discover.getHitCount()).to.be('14,004');
|
||||||
|
|
||||||
expect(await findFirstColumnTokens()).to.eql([]);
|
expect(await findFirstColumnTokens()).to.eql([]);
|
||||||
|
|
||||||
|
@ -111,10 +111,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render field tokens correctly when columns are selected', async function () {
|
it('should render field tokens correctly when columns are selected', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('ip');
|
await unifiedFieldList.clickFieldListItemAdd('ip');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
await unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
||||||
|
|
||||||
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text', 'IP address', 'Geo point']);
|
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text', 'IP address', 'Geo point']);
|
||||||
|
|
||||||
|
@ -133,13 +133,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render field tokens correctly for ES|QL', async function () {
|
it('should render field tokens correctly for ES|QL', async function () {
|
||||||
await PageObjects.discover.selectTextBaseLang();
|
await discover.selectTextBaseLang();
|
||||||
expect(await PageObjects.discover.getHitCount()).to.be('10');
|
expect(await discover.getHitCount()).to.be('10');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
await unifiedFieldList.clickFieldListItemAdd('@timestamp');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('ip');
|
await unifiedFieldList.clickFieldListItemAdd('ip');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
await unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
||||||
|
|
||||||
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text', 'IP address', 'Geo point']);
|
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text', 'IP address', 'Geo point']);
|
||||||
|
|
||||||
|
@ -158,16 +158,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render field tokens correctly on Dashboard', async function () {
|
it('should render field tokens correctly on Dashboard', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
await unifiedFieldList.clickFieldListItemAdd('geo.coordinates');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd(
|
await unifiedFieldList.clickFieldListItemAdd('relatedContent.article:modified_time');
|
||||||
'relatedContent.article:modified_time'
|
await discover.saveSearch('With columns');
|
||||||
);
|
|
||||||
await PageObjects.discover.saveSearch('With columns');
|
|
||||||
|
|
||||||
await PageObjects.common.navigateToApp('dashboard');
|
await common.navigateToApp('dashboard');
|
||||||
await PageObjects.dashboard.clickNewDashboard();
|
await dashboard.clickNewDashboard();
|
||||||
await dashboardAddPanel.clickOpenAddPanel();
|
await dashboardAddPanel.clickOpenAddPanel();
|
||||||
await dashboardAddPanel.addSavedSearch('With columns');
|
await dashboardAddPanel.addSavedSearch('With columns');
|
||||||
|
|
||||||
|
@ -188,8 +186,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render field tokens correctly on Surrounding Documents page', async function () {
|
it('should render field tokens correctly on Surrounding Documents page', async function () {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
|
await unifiedFieldList.clickFieldListItemAdd('bytes');
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('extension');
|
await unifiedFieldList.clickFieldListItemAdd('extension');
|
||||||
|
|
||||||
// navigate to the context view
|
// navigate to the context view
|
||||||
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
await dataGrid.clickRowToggle({ rowIndex: 0 });
|
||||||
|
@ -198,7 +196,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
rowIndex: 0,
|
rowIndex: 0,
|
||||||
});
|
});
|
||||||
await surroundingActionEl.click();
|
await surroundingActionEl.click();
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await header.waitUntilLoadingHasFinished();
|
||||||
|
|
||||||
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text']);
|
expect(await findFirstColumnTokens()).to.eql(['Number', 'Text']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const dataGrid = getService('dataGrid');
|
const dataGrid = getService('dataGrid');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'unifiedFieldList']);
|
const { common, discover, timePicker, unifiedFieldList } = getPageObjects([
|
||||||
|
'common',
|
||||||
|
'discover',
|
||||||
|
'timePicker',
|
||||||
|
'unifiedFieldList',
|
||||||
|
]);
|
||||||
const defaultSettings = { defaultIndex: 'logstash-*' };
|
const defaultSettings = { defaultIndex: 'logstash-*' };
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
|
@ -39,10 +44,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||||
await kibanaServer.uiSettings.update(defaultSettings);
|
await kibanaServer.uiSettings.update(defaultSettings);
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show footer only for the last page and allow to load more', async () => {
|
it('should show footer only for the last page and allow to load more', async () => {
|
||||||
|
@ -71,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// press "Load more"
|
// press "Load more"
|
||||||
await testSubjects.click(LOAD_MORE_SELECTOR);
|
await testSubjects.click(LOAD_MORE_SELECTOR);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
// more pages appeared and the footer is gone
|
// more pages appeared and the footer is gone
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
|
@ -86,7 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// press "Load more"
|
// press "Load more"
|
||||||
await testSubjects.click(LOAD_MORE_SELECTOR);
|
await testSubjects.click(LOAD_MORE_SELECTOR);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
// more pages appeared and the footer is gone
|
// more pages appeared and the footer is gone
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
|
@ -110,7 +115,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(await testSubjects.isEnabled(LOAD_MORE_SELECTOR)).to.be(true);
|
expect(await testSubjects.isEnabled(LOAD_MORE_SELECTOR)).to.be(true);
|
||||||
|
|
||||||
// enable the refresh interval
|
// enable the refresh interval
|
||||||
await PageObjects.timePicker.startAutoRefresh(10);
|
await timePicker.startAutoRefresh(10);
|
||||||
|
|
||||||
// the button is disabled now
|
// the button is disabled now
|
||||||
await retry.waitFor('disabled state', async function () {
|
await retry.waitFor('disabled state', async function () {
|
||||||
|
@ -118,7 +123,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// disable the refresh interval
|
// disable the refresh interval
|
||||||
await PageObjects.timePicker.pauseAutoRefresh();
|
await timePicker.pauseAutoRefresh();
|
||||||
|
|
||||||
// the button is enabled again
|
// the button is enabled again
|
||||||
await retry.waitFor('enabled state', async function () {
|
await retry.waitFor('enabled state', async function () {
|
||||||
|
@ -142,7 +147,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await PageObjects.common.setTime({
|
await common.setTime({
|
||||||
from: 'Sep 10, 2015 @ 00:00:00.000',
|
from: 'Sep 10, 2015 @ 00:00:00.000',
|
||||||
to: 'Sep 30, 2019 @ 00:00:00.000',
|
to: 'Sep 30, 2019 @ 00:00:00.000',
|
||||||
});
|
});
|
||||||
|
@ -151,13 +156,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
'discover:sampleSize': 4,
|
'discover:sampleSize': 4,
|
||||||
'discover:sampleRowsPerPage': 2,
|
'discover:sampleRowsPerPage': 2,
|
||||||
});
|
});
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await common.navigateToApp('discover');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work for date nanos too', async () => {
|
it('should work for date nanos too', async () => {
|
||||||
await PageObjects.unifiedFieldList.clickFieldListItemAdd('_id');
|
await unifiedFieldList.clickFieldListItemAdd('_id');
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
expect(await dataGrid.getRowsText()).to.eql([
|
expect(await dataGrid.getRowsText()).to.eql([
|
||||||
'Sep 22, 2019 @ 23:50:13.253123345AU_x3-TaGFA8no6QjiSJ',
|
'Sep 22, 2019 @ 23:50:13.253123345AU_x3-TaGFA8no6QjiSJ',
|
||||||
|
@ -185,7 +190,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// press "Load more"
|
// press "Load more"
|
||||||
await testSubjects.click(LOAD_MORE_SELECTOR);
|
await testSubjects.click(LOAD_MORE_SELECTOR);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
// more pages appeared and the footer is gone
|
// more pages appeared and the footer is gone
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
|
@ -205,7 +210,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
|
||||||
// press "Load more"
|
// press "Load more"
|
||||||
await testSubjects.click(LOAD_MORE_SELECTOR);
|
await testSubjects.click(LOAD_MORE_SELECTOR);
|
||||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
await discover.waitUntilSearchingHasFinished();
|
||||||
|
|
||||||
// more pages appeared and the footer is gone
|
// more pages appeared and the footer is gone
|
||||||
await retry.try(async function () {
|
await retry.try(async function () {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue