-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Federico Silva <[email protected]>
- Loading branch information
1 parent
d947bd6
commit 6b9b3ed
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
cypress/integration/core-opensearch-dashboards/opensearch-dashboards/discover_table.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { | ||
WORKSPACE_NAME, | ||
DATASOURCE_NAME, | ||
INDEX_NAME, | ||
INDEX_PATTERN_NAME, | ||
START_TIME, | ||
END_TIME, | ||
DATASET_CONFIGS, | ||
} from '../../../../../utils/apps/constants'; | ||
import * as fieldFiltering from '../../../../../integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/utils/field_display_filtering.js'; | ||
import { SECONDARY_ENGINE, BASE_PATH } from '../../../../../utils/constants'; | ||
import { NEW_SEARCH_BUTTON } from '../../../../../utils/dashboards/data_explorer/elements.js'; | ||
|
||
const randomString = Math.random().toString(36).substring(7); | ||
const workspace = `${WORKSPACE_NAME}-${randomString}`; | ||
|
||
describe('filter for value spec', () => { | ||
before(() => { | ||
// Load test data | ||
cy.setupTestData( | ||
SECONDARY_ENGINE.url, | ||
['cypress/fixtures/query_enhancements/data-logs-1/data_logs_small_time_1.mapping.json'], | ||
['cypress/fixtures/query_enhancements/data-logs-1/data_logs_small_time_1.data.ndjson'] | ||
); | ||
|
||
// Add data source | ||
cy.addDataSource({ | ||
name: `${DATASOURCE_NAME}`, | ||
url: `${SECONDARY_ENGINE.url}`, | ||
authType: 'no_auth', | ||
}); | ||
// Create workspace | ||
cy.deleteWorkspaceByName(`${workspace}`); | ||
cy.visit('/app/home'); | ||
cy.createInitialWorkspaceWithDataSource(`${DATASOURCE_NAME}`, `${workspace}`); | ||
cy.wait(2000); | ||
cy.createWorkspaceIndexPatterns({ | ||
url: `${BASE_PATH}`, | ||
workspaceName: `${workspace}`, | ||
indexPattern: INDEX_NAME, | ||
timefieldName: 'timestamp', | ||
indexPatternHasTimefield: true, | ||
dataSource: DATASOURCE_NAME, | ||
isEnhancement: true, | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.navigateToWorkSpaceSpecificPage({ | ||
url: BASE_PATH, | ||
workspaceName: `${workspace}`, | ||
page: 'discover', | ||
isEnhancement: true, | ||
}); | ||
cy.getElementByTestId(NEW_SEARCH_BUTTON).click(); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteWorkspaceByName(`${workspace}`); | ||
cy.deleteDataSourceByName(`${DATASOURCE_NAME}`); | ||
// TODO: Modify deleteIndex to handle an array of index and remove hard code | ||
cy.deleteIndex(INDEX_PATTERN_NAME); | ||
}); | ||
}); |