Skip to content
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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
073a9ff
Mitigate the incorrect layout of Discover due to a race condition bet…
AMoo-Miki Nov 26, 2024
c24d5bc
[Workspace] feat: optimize recent items and filter out items whose wo…
raintygao Nov 27, 2024
8f58bce
[Auto Suggest] SQL Syntax Highlighting fix (#8951)
paulstn Nov 27, 2024
473c0ae
Bump `@opensearch-project/opensearch` from 2.9.0 to 2.13.0 (#8886)
AMoo-Miki Nov 27, 2024
4dac5a7
[workspace]fix: Change some of the http link in settings page to http…
Qxisylolo Nov 28, 2024
1c744d6
[Workspace]Support search dev tools by its category name (#8920)
Hailong-am Nov 28, 2024
b31206a
[Workspace] Isolate objects based on workspace when calling get/bulkG…
yubonluo Dec 2, 2024
f6d345b
Add utils to select a data source.
ArgusLi Dec 3, 2024
080b0db
[Discover] Fix Initialization if No Saved Query (#8930)
sejli Dec 3, 2024
340326f
[Workspace][Bug] Check if workspaces exists when creating saved objec…
yubonluo Dec 3, 2024
d5e0087
[Discover] fix PPL to not throw error if aggregation query fails (#8992)
joshuali925 Dec 3, 2024
e07680b
Upgrade Cypress to v12 (#8995)
d-rowe Dec 3, 2024
fe616e7
[Query enhancements] use status 503 if search strategy throws 500 (#8…
joshuali925 Dec 3, 2024
4e54e2f
Add support for different languages when creating dataset. Filter Out…
ArgusLi Dec 4, 2024
0d308da
Merge branch 'main' of https://github.com/ArgusLi/OpenSearch-Dashboar…
ArgusLi Dec 4, 2024
98e9042
Revert "[augmenter] do not support datasources with no version (#8915…
ohltyler Dec 4, 2024
5f95d74
Reformat to match OSD-functional-tests.
ArgusLi Dec 4, 2024
6861c54
Merge remote-tracking branch 'origin/main' into testid-69-filtering
ArgusLi Dec 4, 2024
cd6c3d8
Complete test suite filter actions in table field.
ArgusLi Dec 5, 2024
a649b6d
Fix filter_label.test.tsx failing due to added data-test-subj
ArgusLi Dec 5, 2024
36bf5e8
[Workspace] Clear the attribute of error objects (#9003)
yubonluo Dec 5, 2024
41ac8ab
bump `url` to 0.11.4 (#8611)
joshuali925 Dec 5, 2024
025b206
Merge branch 'opensearch-project:main' into testid-69-filtering-suite…
ArgusLi Dec 5, 2024
3f65938
[Discover] use roundUp when converting timestamp for PPL (#8935)
joshuali925 Dec 5, 2024
6118ee5
Address comments.
ArgusLi Dec 5, 2024
2a53a55
Merge branch 'opensearch-project:main' into testid-69-filtering-suite…
ArgusLi Dec 5, 2024
f78b3e5
Reformat to use POM.
ArgusLi Dec 5, 2024
cde2eaf
Remove should be visible as each command should be a simple get.
ArgusLi Dec 6, 2024
fda96ff
Merge branch 'cypress-unification' into testid-69-filtering-suite-tab…
ArgusLi Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8611.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Bump url to 0.11.4 ([#8611](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8611))
2 changes: 2 additions & 0 deletions changelogs/fragments/8739.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8886.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8888.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8900.yml
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))
2 changes: 0 additions & 2 deletions changelogs/fragments/8915.yml

This file was deleted.

2 changes: 2 additions & 0 deletions changelogs/fragments/8919.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8920.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8930.yml
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))
2 changes: 2 additions & 0 deletions changelogs/fragments/8935.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Use roundUp when converting timestamp for PPL ([#8935](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8935))
2 changes: 2 additions & 0 deletions changelogs/fragments/8951.yml
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))
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = defineConfig({
},
e2e: {
baseUrl: 'http://localhost:5601',
supportFile: 'cypress/support/e2e.{js,jsx,ts,tsx}',
specPattern: 'cypress/integration/**/*_spec.{js,jsx,ts,tsx}',
testIsolation: false,
setupNodeEvents,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
import { DataExplorerPage } from '../../utils/dashboards/data_explorer/data_explorer_page.po';

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', () => {
DataExplorerPage.selectIndexPatternDataset('DQL');
DataExplorerPage.setSearchRelativeDateRange('15', 'Years ago');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(true);
DataExplorerPage.checkDocTableFirstFieldFilterForButtonFiltersCorrectField();
DataExplorerPage.checkDocTableFirstFieldFilterOutButtonFiltersCorrectField();
});
// filter actions should exist for Lucene
it('Lucene', () => {
DataExplorerPage.selectIndexPatternDataset('Lucene');
DataExplorerPage.setSearchRelativeDateRange('15', 'Years ago');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(true);
DataExplorerPage.checkDocTableFirstFieldFilterForButtonFiltersCorrectField();
DataExplorerPage.checkDocTableFirstFieldFilterOutButtonFiltersCorrectField();
});
// filter actions should not exist for SQL
it('SQL', () => {
DataExplorerPage.selectIndexPatternDataset('OpenSearch SQL');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(false);
});
// filter actions should not exist for PPL
it('PPL', () => {
DataExplorerPage.selectIndexPatternDataset('PPL');
DataExplorerPage.setSearchRelativeDateRange('15', 'Years ago');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(false);
});
});
describe('index dataset', () => {
// filter actions should not exist for SQL
it('SQL', () => {
DataExplorerPage.selectIndexDataset('OpenSearch SQL');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(false);
});
// filter actions should not exist for PPL
it('PPL', () => {
DataExplorerPage.selectIndexDataset('PPL');
DataExplorerPage.checkDocTableFirstFieldFilterForAndOutButton(false);
});
});
});
});
15 changes: 14 additions & 1 deletion cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@
* 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')

const scopedHistoryNavigationError =
/^[^(ScopedHistory instance has fell out of navigation scope)]/;
Cypress.on('uncaught:exception', (err) => {
/* returning false here prevents Cypress from failing the test */
if (scopedHistoryNavigationError.test(err.message)) {
return false;
}
});
40 changes: 39 additions & 1 deletion cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,51 @@
* SPDX-License-Identifier: Apache-2.0
*/

// --- Typed commands --
import {
MiscUtils,
LoginPage,
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';

const miscUtils = new MiscUtils(cy);
const loginPage = new LoginPage(cy);

/**
* Get DOM element by data-test-subj id.
*/
Cypress.Commands.add('getElementByTestId', (testId, options = {}) => {
return cy.get(`[data-test-subj="${testId}"]`, options);
});

/**
* Get multiple DOM elements by data-test-subj ids.
*/
Cypress.Commands.add('getElementsByTestIds', (testIds, options = {}) => {
const selectors = [testIds].flat(Infinity).map((testId) => `[data-test-subj="${testId}"]`);
return cy.get(selectors.join(','), options);
});

/**
* Find element from previous chained element by data-test-subj id.
*/
Cypress.Commands.add(
'findElementByTestId',
{ prevSubject: true },
(subject, testId, options = {}) => {
return cy.wrap(subject).find(`[data-test-subj="${testId}"]`, options);
}
);

/**
* Go to the local instance of OSD's home page and login if needed.
*/
Cypress.Commands.add('localLogin', (username, password) => {
miscUtils.visitPage('/app/home');
cy.url().then(($url) => {
if ($url.includes('login')) {
loginPage.enterUserName(username);
loginPage.enterPassword(password);
loginPage.submit();
}
cy.url().should('contain', '/app/home');
});
});
50 changes: 50 additions & 0 deletions cypress/utils/dashboards/data_explorer/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { DATA_EXPLORER_PAGE_ELEMENTS } from './elements.js';

/**
* Get the New Search button.
*/
Cypress.Commands.add('getNewSearchButton', () => {
return cy.getElementByTestId(DATA_EXPLORER_PAGE_ELEMENTS.NEW_SEARCH_BUTTON, { timeout: 10000 });
});

/**
* Get the Query Submit button.
*/
Cypress.Commands.add('getQuerySubmitButton', () => {
return cy.getElementByTestId(DATA_EXPLORER_PAGE_ELEMENTS.QUERY_SUBMIT_BUTTON);
});

/**
* Get the Search Bar Date Picker button.
*/
Cypress.Commands.add('getSearchDatePickerButton', () => {
return cy.getElementByTestId(DATA_EXPLORER_PAGE_ELEMENTS.SEARCH_DATE_PICKER_BUTTON);
});

/**
* Get the Relative Date tab in the Search Bar Date Picker.
*/
Cypress.Commands.add('getDatePickerRelativeTab', () => {
return cy.getElementByTestId(DATA_EXPLORER_PAGE_ELEMENTS.SEARCH_DATE_PICKER_RELATIVE_TAB);
});

/**
* Get the Relative Date Input in the Search Bar Date Picker.
*/
Cypress.Commands.add('getDatePickerRelativeInput', () => {
return cy.getElementByTestId(DATA_EXPLORER_PAGE_ELEMENTS.SEARCH_DATE_RELATIVE_PICKER_INPUT);
});

/**
* Get the Relative Date Unit selector in the Search Bar Date Picker.
*/
Cypress.Commands.add('getDatePickerRelativeUnitSelector', () => {
return cy.getElementByTestId(
DATA_EXPLORER_PAGE_ELEMENTS.SEARCH_DATE_RELATIVE_PICKER_UNIT_SELECTOR
);
});
8 changes: 8 additions & 0 deletions cypress/utils/dashboards/data_explorer/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const INDEX_CLUSTER_NAME = 'cypress-test-os';
export const INDEX_NAME = 'vis-builder';
export const INDEX_PATTERN_NAME = 'cypress-test-os::vis-builder*';
Loading