Skip to content

Commit e85fcb5

Browse files
authored
[Data grid][Scout] Use data view mode (elastic#267978)
## Summary Closes elastic#266912 Closes elastic#266907 Closes elastic#266909 Closes elastic#266910 Closes elastic#266904 Closes elastic#266906 Closes elastic#266911 Closes elastic#266908 Closes elastic#266905 Closes elastic#266903 The latest failures for all the core scout suite in discover points out to discover loading in ESQL mode, to mitigate this a new method has been added to transition to classic view if needed and is now run in the before each. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [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 - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
1 parent d401cf8 commit e85fcb5

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/platform/packages/shared/kbn-scout/src/playwright/page_objects/discover_app.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import type { ScoutPage } from '..';
1313
import { expect } from '..';
1414
import { KibanaCodeEditorWrapper } from '../ui_components';
1515

16+
const DISCOVER_QUERY_MODE_KEY = 'discover.defaultQueryMode';
17+
1618
export class DiscoverApp {
1719
public readonly codeEditor: KibanaCodeEditorWrapper;
1820

@@ -613,4 +615,13 @@ export class DiscoverApp {
613615

614616
await expect(docTable).toContainText(text);
615617
}
618+
619+
public setQueryMode(mode: 'esql' | 'classic') {
620+
return this.page.addInitScript(
621+
([_mode, _discoverQueryModeKey]) => {
622+
window.localStorage.setItem(_discoverQueryModeKey, JSON.stringify(_mode));
623+
},
624+
[mode, DISCOVER_QUERY_MODE_KEY]
625+
);
626+
}
616627
}

src/platform/plugins/shared/discover/test/scout/ui/parallel_tests/core/data_grid_doc_table.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ spaceTest.describe('Discover data grid - doc table', { tag: testData.DISCOVER_CO
3939
spaceTest.beforeEach(async ({ browserAuth, pageObjects }) => {
4040
// Viewer is sufficient for read-only grid interactions.
4141
await browserAuth.loginAsViewer();
42+
await pageObjects.discover.setQueryMode('classic');
4243
await pageObjects.discover.goto();
4344
await pageObjects.discover.waitUntilSearchingHasFinished();
4445
// Search can finish before the grid leaves "Loading documents" (histogram may

src/platform/plugins/shared/discover/test/scout/ui/parallel_tests/core/data_grid_doc_viewer.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spaceTest.describe('Discover data grid - doc viewer', { tag: testData.DISCOVER_C
3838
spaceTest.beforeEach(async ({ browserAuth, pageObjects }) => {
3939
// Privileged user is needed to save the search used by the embeddable test.
4040
await browserAuth.loginAsPrivilegedUser();
41+
await pageObjects.discover.setQueryMode('classic');
4142
await pageObjects.discover.goto();
4243
await pageObjects.discover.waitUntilSearchingHasFinished();
4344
await pageObjects.discover.waitForDocTableRendered();

0 commit comments

Comments
 (0)