-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add cypress tests for discover 2.0 #1598
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
6c0afef
to
b869203
Compare
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.
Overall i love the tests. A few coments and concerns. Let me know what you think of them
...opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/dataset_navigator.spec.js
Outdated
Show resolved
Hide resolved
cy.getElementByTestId('queryEditorLanguageSelector').should( | ||
'contain', | ||
'SQL' | ||
); |
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.
This will be flakey unless we can set this before hand right?
// The following steps are needed because when selecting SQL, discover loaded with data but the | ||
// multi-line query editor are not loaded properly(it renders a single line query bar) unless we select SQL again | ||
// This bug only exist in cypress test; can not reproduce manually | ||
cy.get(`[data-test-subj="queryEditorLanguageSelector"]`).click(); |
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.
Will a wait help?
'contain', | ||
'Step 2: Configure data' | ||
); | ||
// should have two options: SQL and PPL; PPL should be selected |
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.
How do we ensure this? Wont this be flakey?
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.
yea it prob be flaky. Will change to click PPL as a option
); | ||
}); | ||
|
||
it('with SQL as default language', function () { |
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.
Lets be more specific about what this test is doing
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` | ||
); | ||
|
||
cy.get(`[class~="datasetSelector__button"]`).click(); |
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.
If there are index patterns, the default index pattern should be selected by default. We should not have to select it
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.
Yea when i tried it manually, the default index pattern will be picked up by default; but somehow in the test, it wont. @ashwin-pc
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 also saw this issue. I think due to double render, first select as the default index then render. So in cypress we will capture this and need to re-select it. Also saw SuperDatePicker detached from the DOM due to the same reason. We will document any issues due to render or async.
...tion/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/queries.spec.js
Show resolved
Hide resolved
@@ -34,6 +34,7 @@ | |||
"osd:ciGroup7": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/doc_navigation.spec.js,apps/data_explorer/doc_table.spec.js,apps/data_explorer/errors.spec.js,apps/data_explorer/field_data.spec.js,apps/data_explorer/zzz_after.spec.js", | |||
"osd:ciGroup8": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/field_visualize.spec.js,apps/data_explorer/filter_editor.spec.js,apps/data_explorer/index_pattern_with_encoded_id.spec.js,apps/data_explorer/index_pattern_without_field.spec.js,apps/data_explorer/zzz_after.spec.js", | |||
"osd:ciGroup9": "echo apps/data_explorer/aaa_before.spec.js,apps/data_explorer/inspector.spec.js,apps/data_explorer/large_string.spec.js,apps/data_explorer/saved_queries.spec.js,apps/data_explorer/shared_links.spec.js,apps/data_explorer/sidebar.spec.js,apps/data_explorer/source_filter.spec.js,apps/data_explorer/zzz_after.spec.js", | |||
"osd:ciGroup10": "echo apps/query_enhancement/*.js", |
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.
Wont this require all the YAML settings and Advanced settings for this view to be set correctly?
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.
what do you mean by this?
); | ||
|
||
// Switch language to SQL | ||
cy.getElementByTestId('queryEditorLanguageSelector').click(); |
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.
could we wrap the switch language to a method to avoid duplication of code
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Description
Add two test files to test on discover 2.0 functionalities.
Issues Resolved
[List any issues this PR will resolve]
Check List
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.