Skip to content

Commit

Permalink
Add tests for saved search creation and loading for query enhancement
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Kim <[email protected]>
  • Loading branch information
angle943 committed Dec 21, 2024
1 parent 66331eb commit 871b474
Show file tree
Hide file tree
Showing 8 changed files with 541 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ export const DATASOURCE_NAME = 'query-cluster';
export const WORKSPACE_NAME = 'query-workspace';
export const START_TIME = 'Jan 1, 2020 @ 00:00:00.000';
export const END_TIME = 'Jan 1, 2024 @ 00:00:00.000';

export const INDEX_WITH_TIME_1 = 'data_logs_small_time_1';
export const INDEX_WITH_TIME_2 = 'data_logs_small_time_2';
export const INDEX_PATTERN_WITH_TIME = 'data_logs_small_time_*';
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,15 @@ describe('dataset selector', { scrollBehavior: false }, () => {
it('create index pattern and select it', function () {
// Create and select index pattern for data_logs_small_time_1*
cy.createWorkspaceIndexPatterns({
url: `${BASE_PATH}`,
workspaceName: `${WORKSPACE_NAME}`,
workspaceName: WORKSPACE_NAME,
indexPattern: 'data_logs_small_time_1',
timefieldName: 'timestamp',
indexPatternHasTimefield: true,
dataSource: DATASOURCE_NAME,
isEnhancement: true,
});

cy.navigateToWorkSpaceHomePage(`${BASE_PATH}`, `${WORKSPACE_NAME}`);
cy.navigateToWorkSpaceHomePage(WORKSPACE_NAME);

cy.waitForLoader(true);
cy.getElementByTestId(`datasetSelectorButton`).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ describe('query enhancement queries', { scrollBehavior: false }, () => {

// Create and select index pattern for data_logs_small_time_1*
cy.createWorkspaceIndexPatterns({
url: `${BASE_PATH}`,
workspaceName: `${WORKSPACE_NAME}`,
workspaceName: WORKSPACE_NAME,
indexPattern: 'data_logs_small_time_1',
timefieldName: 'timestamp',
indexPatternHasTimefield: true,
Expand All @@ -39,7 +38,7 @@ describe('query enhancement queries', { scrollBehavior: false }, () => {
});

// Go to workspace home
cy.navigateToWorkSpaceHomePage(`${BASE_PATH}`, `${WORKSPACE_NAME}`);
cy.navigateToWorkSpaceHomePage(WORKSPACE_NAME);
cy.setTopNavDate(START_TIME, END_TIME);
cy.waitForLoader(true);
});
Expand All @@ -55,7 +54,7 @@ describe('query enhancement queries', { scrollBehavior: false }, () => {
cy.setQueryLanguage('DQL');

const query = `_id:1`;
cy.setSingleLineQueryEditor(query);
cy.setQueryEditor(query);
cy.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);
Expand All @@ -69,7 +68,7 @@ describe('query enhancement queries', { scrollBehavior: false }, () => {
cy.setQueryLanguage('Lucene');

const query = `_id:1`;
cy.setSingleLineQueryEditor(query);
cy.setQueryEditor(query);
cy.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);
Expand Down
Loading

0 comments on commit 871b474

Please sign in to comment.