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

[Table visualization] Add functional tests for new table vis #423

Merged
merged 5 commits into from
May 24, 2023

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Dec 13, 2022

Description

There are five test cases:

  • basic.spec.js contains tests related to vis page, like inspector, save an object.
basic.mov
  • data.spec.js tests diff metrics and buckets aggregations.
data.mov
  • options.spec.js contains tests on options panel.
options.mov
  • split.spec.js tests table functions, like sort, adjust col width, split tables and etc.
split.mov
  • embed.spec.js tests how an embedded table visualization works.
embed.mov

Most tests are the same as the removed funtional tests. split.spec.js is the only one with all new tests.

Partially Resolved

#401

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

cy.deleteIndex(TABLE_INDEX_ID);
cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
cy.createIndexPattern(TABLE_INDEX_PATTERN, {
Copy link
Member

Choose a reason for hiding this comment

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

your saved object seems to already have the required index pattern. Do you still need to run this command?

Copy link
Member Author

@ananzh ananzh Jan 9, 2023

Choose a reason for hiding this comment

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

Yes. For saved index pattern, I used two ways to test in table.

  1. Manually add an index pattern in saved object then create a table vis cy.createIndexPattern. This is used in basic.spec.js
  2. Import an saved object through cy.importSavedObjects(TABLE_PATH_SO_DATA). This method is used in other three tests.

Basically I would like to try both to make sure table vis can created from both ways.

* Terms Aggregation
*/

Cypress.Commands.add('toggleOtherBucket', (request) => {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add prefixes to these custom commands? I can see other commands being named similarly. e.g for VisBuilder specific commands i prefixed them with vb so that there arent two commands with the same name.

Copy link
Member Author

@ananzh ananzh Jan 9, 2023

Choose a reason for hiding this comment

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

Good call. I didn't realize that. I will update the command names and add a prefix tb to all of them, which represents table. If tb is ambiguous, pls let me know.

Comment on lines 50 to 43
it('Should allow applying changed params', () => {
cy.setHistogramInterval('201', 2);
cy.isUpdateAggregationSettingsEnabled();
});
Copy link
Member

Choose a reason for hiding this comment

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

Each test should be atomic. so that even if one test does not pass, the next test runs without being affected.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. I will modify this one. Thank you.

@tianleh
Copy link
Member

tianleh commented Feb 15, 2023

@ananzh Do you need confirmation from Ashwin before merging? If not, we can approve and get it merged.

@ashwin-pc
Copy link
Member

@tianleh no you do not :) I only had minor comments on the original PR. Sorry @ananzh for letting this slip through the cracks, this PR however might need to be rebased since some of the changes seem to be irrelevant to the PR and all the checks do not pass right now.

ananzh added 4 commits May 18, 2023 16:47
There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
opensearch-project#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@kavilla kavilla merged commit 3dffb5f into opensearch-project:main May 24, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 24, 2023
* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 24, 2023
* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)
kavilla pushed a commit that referenced this pull request May 24, 2023
…671)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
peterzhuamazon pushed a commit that referenced this pull request May 26, 2023
…672)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
leanneeliatra pushed a commit to leanneeliatra/opensearch-dashboards-functional-test-fork that referenced this pull request Sep 15, 2023
…rch-project#423) (opensearch-project#671)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
opensearch-project#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants