-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discover Test] TestID-69: Filtering, Test Suite: Filter actions in table field #9011
Changes from 20 commits
073a9ff
c24d5bc
8f58bce
473c0ae
4dac5a7
1c744d6
b31206a
f6d345b
080b0db
340326f
d5e0087
e07680b
fe616e7
4e54e2f
0d308da
98e9042
5f95d74
6861c54
cd6c3d8
a649b6d
36bf5e8
41ac8ab
025b206
3f65938
6118ee5
2a53a55
f78b3e5
cde2eaf
fda96ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- [Workspace] [Bug] Check if workspaces exists when creating saved objects. ([#8739](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8739)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
chore: | ||
- Bump `@opensearch-project/opensearch` from 2.9.0 to 2.13.0 ([#8886](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8886)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
refactor: | ||
- [Workspace] Isolate objects based on workspace when calling get/bulkGet ([#8888](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8888)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Optimize recent items and filter out items whose workspace is deleted ([#8900](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8900)) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Change some of the http link in settings page to https link ([#8919](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8919)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- [workspace]support search dev tools by its category name ([#8920](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8920)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Update saved search initialization logic to use current query instead of default query ([#8930](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8930)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- SQL syntax highlighting double quotes ([#8951](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8951)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Support imports without extensions in cypress webpack build ([#8993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8993)) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { defineConfig } from 'cypress'; | ||
import webpackPreprocessor from '@cypress/webpack-preprocessor'; | ||
|
||
module.exports = defineConfig({ | ||
defaultCommandTimeout: 60000, | ||
requestTimeout: 60000, | ||
responseTimeout: 60000, | ||
viewportWidth: 2000, | ||
viewportHeight: 1320, | ||
env: { | ||
openSearchUrl: 'http://localhost:9200', | ||
SECURITY_ENABLED: false, | ||
AGGREGATION_VIEW: false, | ||
username: 'admin', | ||
password: 'myStrongPassword123!', | ||
ENDPOINT_WITH_PROXY: false, | ||
MANAGED_SERVICE_ENDPOINT: false, | ||
VISBUILDER_ENABLED: true, | ||
DATASOURCE_MANAGEMENT_ENABLED: false, | ||
ML_COMMONS_DASHBOARDS_ENABLED: true, | ||
WAIT_FOR_LOADER_BUFFER_MS: 0, | ||
}, | ||
e2e: { | ||
baseUrl: 'http://localhost:5601', | ||
supportFile: 'cypress/support/e2e.{js,jsx,ts,tsx}', | ||
specPattern: 'cypress/integration/**/*_spec.{js,jsx,ts,tsx}', | ||
testIsolation: true, | ||
setupNodeEvents, | ||
}, | ||
}); | ||
|
||
function setupNodeEvents( | ||
on: Cypress.PluginEvents, | ||
config: Cypress.PluginConfigOptions | ||
): Cypress.PluginConfigOptions { | ||
const { webpackOptions } = webpackPreprocessor.defaultOptions; | ||
|
||
/** | ||
* By default, cypress' internal webpack preprocessor doesn't allow imports without file extensions. | ||
* This makes our life a bit hard since if any file in our testing dependency graph has an import without | ||
* the .js extension our cypress build will fail. | ||
* | ||
* This extra rule relaxes this a bit by allowing imports without file extension | ||
* ex. import module from './module' | ||
*/ | ||
webpackOptions!.module!.rules.unshift({ | ||
test: /\.m?js/, | ||
resolve: { | ||
enforceExtension: false, | ||
}, | ||
}); | ||
|
||
on( | ||
'file:preprocessor', | ||
webpackPreprocessor({ | ||
webpackOptions, | ||
}) | ||
); | ||
|
||
return config; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('filter for value spec', () => { | ||
beforeEach(() => { | ||
cy.localLogin(Cypress.env('username'), Cypress.env('password')); | ||
miscUtils.visitPage('app/data-explorer/discover'); | ||
cy.getNewSearchButton().click(); | ||
}); | ||
describe('filter actions in table field', () => { | ||
describe('index pattern dataset', () => { | ||
// filter actions should exist for DQL | ||
it('DQL', () => { | ||
cy.selectIndexPatternDataset('DQL'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for fully utilizing utils here across this test file. |
||
cy.setSearchRelativeDateRange('15', 'Years ago'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(true); | ||
cy.checkDocTableFirstFieldFilterForButtonFiltersCorrectField(); | ||
cy.checkDocTableFirstFieldFilterOutButtonFiltersCorrectField(); | ||
}); | ||
// filter actions should exist for Lucene | ||
it('Lucene', () => { | ||
cy.selectIndexPatternDataset('Lucene'); | ||
cy.setSearchRelativeDateRange('15', 'Years ago'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(true); | ||
cy.checkDocTableFirstFieldFilterForButtonFiltersCorrectField(); | ||
cy.checkDocTableFirstFieldFilterOutButtonFiltersCorrectField(); | ||
}); | ||
// filter actions should not exist for SQL | ||
it('SQL', () => { | ||
cy.selectIndexPatternDataset('OpenSearch SQL'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(false); | ||
}); | ||
// filter actions should not exist for PPL | ||
it('PPL', () => { | ||
cy.selectIndexPatternDataset('PPL'); | ||
cy.setSearchRelativeDateRange('15', 'Years ago'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(false); | ||
}); | ||
}); | ||
describe('index dataset', () => { | ||
// filter actions should not exist for SQL | ||
it('SQL', () => { | ||
cy.selectIndexDataset('OpenSearch SQL'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(false); | ||
}); | ||
// filter actions should not exist for PPL | ||
it('PPL', () => { | ||
cy.selectIndexDataset('PPL'); | ||
cy.checkDocTableFirstFieldFilterForAndOutButton(false); | ||
}); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,14 @@ | |
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import '../utils/commands'; | ||
import '../utils/commands.js'; | ||
import '../utils/dashboards/data_explorer/commands.js'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
Cypress.on('uncaught:exception', (_err) => { | ||
// returning false here prevents Cypress from failing the test | ||
return false; | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, there are some uncaught errors that we do want to gracefully ignore. That being said, I feel there are times when bubbling up an uncaught exception would be really useful. For example, if a page fails to render it'd be nice to see the exception in the runner rather than having to run locally and dig for it. Can we be a bit more selective here and only swallow the error you were seeing needed to be handled gracefully? Ex.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I added this as I was getting a specific navigation error. Keeping the ignore selective makes a lot of sense to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in newest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a part of the Cypress I saw a couple existing tests that are not written in an isolated manner, which caused failures when I enabled this initially.
If all our tests pass with isolation on now, that's great! Let's just check the cypress tests on this PR when they run to verify that there are no new failures due to this enablement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that the other tests are running, I will revert the testIsolation to false and change my test to reflect the lack of test isolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in newest commit.