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

[Lens] Add functional tests on chart transitions and pie chart #74083

Merged
merged 9 commits into from
Aug 6, 2020

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Aug 3, 2020

Summary

Part of #72585

This PR adds tests that test the following functionalities:

Apart from that, I've refactored few methods (by making them more universal and moving them to lens pageObject) and moved dashboard specific tests to separate suite.

I ran the tests both in flaky-test-runner and cloud-flaky-test-runner:

@mbondyra mbondyra changed the title [Lens] Add functional tests on chart transitions [Lens] Add functional tests on chart transitions and pie chart Aug 3, 2020
@elastic elastic deleted a comment from kibanamachine Aug 4, 2020
@mbondyra mbondyra force-pushed the lens/functional-tests-transitions branch from 86dc30a to ba7221c Compare August 4, 2020 12:10
@mbondyra mbondyra force-pushed the lens/functional-tests-transitions branch 2 times, most recently from 02f797d to 78cf61a Compare August 4, 2020 14:24
@mbondyra mbondyra marked this pull request as ready for review August 4, 2020 14:25
@mbondyra mbondyra requested a review from a team August 4, 2020 14:25
@mbondyra mbondyra added Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0 labels Aug 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

This looks great, thanks a lot! I added two small nits about asserting a little more, but even without that it's very helpful.

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 5, 2020

@elasticmachine merge upstream

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Overall looking good, but added some nitpicks that I'd like to get another iteration on

x-pack/test/functional/page_objects/lens_page.ts Outdated Show resolved Hide resolved
x-pack/test/functional/page_objects/lens_page.ts Outdated Show resolved Hide resolved
/**
* Gets text of the specified datatable header cell
*
* @param index - index of th element in datatable
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't typically use the position of the element to make assertions, could this be done in a less-brittle way?

* Gets text of the specified datatable cell
*
* @param rowIndex - index of row of the cell
* @param colIndex - index of column of the cell
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks brittle again, like I wouldn't want to reuse this function for other uses.

Copy link
Contributor Author

@mbondyra mbondyra Aug 6, 2020

Choose a reason for hiding this comment

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

How we were testing it before, was to check only the first element, so the index could have been not specified explicitly but it worked the same. I'm not exactly understanding what you mean by this being brittle and why you wouldn't reuse this function for other uses – you're more than welcome to write the example, please 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

I was mostly expecting the selector to work backwards. Here, you provide the expected index and get the text at that index. Is there a way to provide the text, and get the index of the text?

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 6, 2020

@elasticmachine merge upstream

@mbondyra mbondyra force-pushed the lens/functional-tests-transitions branch from a4c70fb to 67f8497 Compare August 6, 2020 09:38
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
lens 843.2KB +234.0B 843.0KB

History

  • 💔 Build #66838 failed a4c70fb59d243fa7e4b66f4eb231b5ba36e1c27f
  • 💔 Build #66827 failed 2383e5b38bde1e028877f05057c5e1760b3f2cc3
  • 💔 Build #66674 failed 0afbb799ea2f155978ab3332120e2587f19857e9
  • 💚 Build #66395 succeeded e107ce0201f3827b4d22f0f6caac199155b56c44
  • 💔 Build #66386 failed 02f797dac466e442defd4390b9bab3351a9ef8c5

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Overall LGTM, the discussion about index vs text selection is interesting but mostly nitpicky

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 6, 2020

Thanks @wylieconlon for your comment! I'll try to find some patterns of how to test tables, maybe there's a better way.

@mbondyra mbondyra merged commit fa2251d into elastic:master Aug 6, 2020
@mbondyra mbondyra deleted the lens/functional-tests-transitions branch August 6, 2020 16:52
mbondyra added a commit to mbondyra/kibana that referenced this pull request Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants