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

[TESTID-125,126,127,128,129] Saved Query Test Scope #9229

Merged
merged 44 commits into from
Jan 28, 2025

Conversation

ArgusLi
Copy link
Contributor

@ArgusLi ArgusLi commented Jan 21, 2025

Description

Adds a Cypress test suite for Saved Queries Test Scope in the Discover page.

Issues Resolved

Closes #8975, #8977, #8978, #8979, #8980.

Screenshot

saved-queries-1.mp4
saved-queries-2.mp4
saved-queries-3.mp4

Testing the changes

With OSD running, run yarn run cypress open. In E2E specs, you will see 2 new test specs saved_queries.spec.js and saved_queries_old_ui.spec.js. Run saved_queries.spec.js if data.savedQueriesNewUI.enabled: true in the OSD config, else run saved_queries_old_ui.spec.js.

Changelog

  • test: Add cypress integration test for the old and new UI view saved queries.

ArgusLi and others added 27 commits January 8, 2025 21:09
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Argus Li <[email protected]>
@angle943
Copy link
Collaborator

@ArgusLi i believe you are having a test failure related to this change: #9150

SAVE_AS_NEW_QUERY_SUFFIX,
validateSaveAsNewQueryMatchingNameHasError,
} from '../../../../../utils/apps/query_enhancements/saved_queries';

Copy link
Collaborator

@angle943 angle943 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename this file to saved_queries.spec.js


// This spec assumes data.savedQueriesNewUI.enabled is true.
export const runSavedQueriesFlyoutUITests = () => {
describe('saved queries flyout UI', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove flyout UI

ananzh
ananzh previously approved these changes Jan 24, 2025
@LDrago27 LDrago27 added backport 2.x discover_2.0-test Issues that are specific to the Discover 2.0 testing initiative labels Jan 24, 2025
This removes delay when waiting for toast to disperse.

Signed-off-by: Argus Li <[email protected]>
ananzh
ananzh previously approved these changes Jan 28, 2025
@ananzh
Copy link
Member

ananzh commented Jan 28, 2025

Update branch to re-run tests, especially ciGroup 10

Issue was caused by Cypress being too fast for the date picker to appear.

Signed-off-by: Argus Li <[email protected]>
@LDrago27 LDrago27 merged commit 969114f into opensearch-project:main Jan 28, 2025
69 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 28, 2025
* add spec for old ui

Signed-off-by: Argus Li <[email protected]>

* Add comment about cleaning up saved queries

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query button for new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for open query button in query management popover

Signed-off-by: Argus Li <[email protected]>

* Add new ui spec to test list saved queries

Signed-off-by: Argus Li <[email protected]>

* Fix DataSource url

Signed-off-by: Argus Li <[email protected]>

* Changeset file for PR #9166 created/updated

* Address Justin's comments.

Signed-off-by: Argus Li <[email protected]>

* Remove final force.

Signed-off-by: Argus Li <[email protected]>

* Fix final force.

Signed-off-by: Argus Li <[email protected]>

* Move utils to Suchit's suggested location, fix comments

Signed-off-by: Argus Li <[email protected]>

* Rename specs, change cypress workflow to use new save query ui, merge old ui and new ui commands

Signed-off-by: Argus Li <[email protected]>

* fix import

Signed-off-by: Argus Li <[email protected]>

* Load query

Signed-off-by: Argus Li <[email protected]>

* Complete load query popover and flyout

Signed-off-by: Argus Li <[email protected]>

* Modularize view and load query popover and flyout

Signed-off-by: Argus Li <[email protected]>

* Complete valid Saved Queries shown across Visualize Pages

Signed-off-by: Argus Li <[email protected]>

* Complete Popover delete saved query

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for flyoutbody and delete button.

Signed-off-by: Argus Li <[email protected]>

* Complete flyout delete saved query

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for saveAsNewQueryCheckbox

Signed-off-by: Argus Li <[email protected]>

* Complete Flyout Update Saved Query

Signed-off-by: Argus Li <[email protected]>

* Complete Flyout Save as New Saved Query

Signed-off-by: Argus Li <[email protected]>

* Complete Popout Save as New Saved Query

Signed-off-by: Argus Li <[email protected]>

* Changeset file for PR #9229 created/updated

* Fix merge

Signed-off-by: Argus Li <[email protected]>

* Move data-test-subj changes to another PR.

Signed-off-by: Argus Li <[email protected]>

* Remove savedQueriesNewUI

Signed-off-by: Argus Li <[email protected]>

* Address all comments.

Signed-off-by: Argus Li <[email protected]>

* Fix cypress command namespacing.

Signed-off-by: Argus Li <[email protected]>

* Rename saved queries spec.

Signed-off-by: Argus Li <[email protected]>

* Remove references to flyout

Signed-off-by: Argus Li <[email protected]>

* Refactor tests to work with beforeEach and afterEach

Signed-off-by: Argus Li <[email protected]>

* Add force to click when loading saved query.

This removes delay when waiting for toast to disperse.

Signed-off-by: Argus Li <[email protected]>

* Fix test issue. Thank you @angle943 for finding a solution.

Issue was caused by Cypress being too fast for the date picker to appear.

Signed-off-by: Argus Li <[email protected]>

---------

Signed-off-by: Argus Li <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <[email protected]>
(cherry picked from commit 969114f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ananzh ananzh added the v2.19.0 label Jan 28, 2025
ananzh added a commit that referenced this pull request Jan 29, 2025
* add spec for old ui



* Add comment about cleaning up saved queries



* Add data-test-subj for save query new ui



* Add data-test-subj for save query button for new ui



* Add data-test-subj for open query button in query management popover



* Add new ui spec to test list saved queries



* Fix DataSource url



* Changeset file for PR #9166 created/updated

* Address Justin's comments.



* Remove final force.



* Fix final force.



* Move utils to Suchit's suggested location, fix comments



* Rename specs, change cypress workflow to use new save query ui, merge old ui and new ui commands



* fix import



* Load query



* Complete load query popover and flyout



* Modularize view and load query popover and flyout



* Complete valid Saved Queries shown across Visualize Pages



* Complete Popover delete saved query



* Add data-test-subj for flyoutbody and delete button.



* Complete flyout delete saved query



* Add data-test-subj for saveAsNewQueryCheckbox



* Complete Flyout Update Saved Query



* Complete Flyout Save as New Saved Query



* Complete Popout Save as New Saved Query



* Changeset file for PR #9229 created/updated

* Fix merge



* Move data-test-subj changes to another PR.



* Remove savedQueriesNewUI



* Address all comments.



* Fix cypress command namespacing.



* Rename saved queries spec.



* Remove references to flyout



* Refactor tests to work with beforeEach and afterEach



* Add force to click when loading saved query.

This removes delay when waiting for toast to disperse.



* Fix test issue. Thank you @angle943 for finding a solution.

Issue was caused by Cypress being too fast for the date picker to appear.



---------




(cherry picked from commit 969114f)

Signed-off-by: Argus Li <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <[email protected]>
ruchidh pushed a commit to ruchidh/OpenSearch-Dashboards that referenced this pull request Jan 30, 2025
…ct#9229)

* add spec for old ui

Signed-off-by: Argus Li <[email protected]>

* Add comment about cleaning up saved queries

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query button for new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for open query button in query management popover

Signed-off-by: Argus Li <[email protected]>

* Add new ui spec to test list saved queries

Signed-off-by: Argus Li <[email protected]>

* Fix DataSource url

Signed-off-by: Argus Li <[email protected]>

* Changeset file for PR opensearch-project#9166 created/updated

* Address Justin's comments.

Signed-off-by: Argus Li <[email protected]>

* Remove final force.

Signed-off-by: Argus Li <[email protected]>

* Fix final force.

Signed-off-by: Argus Li <[email protected]>

* Move utils to Suchit's suggested location, fix comments

Signed-off-by: Argus Li <[email protected]>

* Rename specs, change cypress workflow to use new save query ui, merge old ui and new ui commands

Signed-off-by: Argus Li <[email protected]>

* fix import

Signed-off-by: Argus Li <[email protected]>

* Load query

Signed-off-by: Argus Li <[email protected]>

* Complete load query popover and flyout

Signed-off-by: Argus Li <[email protected]>

* Modularize view and load query popover and flyout

Signed-off-by: Argus Li <[email protected]>

* Complete valid Saved Queries shown across Visualize Pages

Signed-off-by: Argus Li <[email protected]>

* Complete Popover delete saved query

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for flyoutbody and delete button.

Signed-off-by: Argus Li <[email protected]>

* Complete flyout delete saved query

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for saveAsNewQueryCheckbox

Signed-off-by: Argus Li <[email protected]>

* Complete Flyout Update Saved Query

Signed-off-by: Argus Li <[email protected]>

* Complete Flyout Save as New Saved Query

Signed-off-by: Argus Li <[email protected]>

* Complete Popout Save as New Saved Query

Signed-off-by: Argus Li <[email protected]>

* Changeset file for PR opensearch-project#9229 created/updated

* Fix merge

Signed-off-by: Argus Li <[email protected]>

* Move data-test-subj changes to another PR.

Signed-off-by: Argus Li <[email protected]>

* Remove savedQueriesNewUI

Signed-off-by: Argus Li <[email protected]>

* Address all comments.

Signed-off-by: Argus Li <[email protected]>

* Fix cypress command namespacing.

Signed-off-by: Argus Li <[email protected]>

* Rename saved queries spec.

Signed-off-by: Argus Li <[email protected]>

* Remove references to flyout

Signed-off-by: Argus Li <[email protected]>

* Refactor tests to work with beforeEach and afterEach

Signed-off-by: Argus Li <[email protected]>

* Add force to click when loading saved query.

This removes delay when waiting for toast to disperse.

Signed-off-by: Argus Li <[email protected]>

* Fix test issue. Thank you @angle943 for finding a solution.

Issue was caused by Cypress being too fast for the date picker to appear.

Signed-off-by: Argus Li <[email protected]>

---------

Signed-off-by: Argus Li <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <[email protected]>
Signed-off-by: Ubuntu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x discover_2.0-test Issues that are specific to the Discover 2.0 testing initiative repeat-contributor v2.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Saved Queries] TESTID-125: Loading a Saved query with filters, time range , query
4 participants