[Discover] Improve indexpattern without timefield functional test#67031
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
@elasticmachine merge upstream |
…xpattern-without-timefield-test
|
@elasticmachine merge upstream |
…xpattern-without-timefield-test
| it('should display a timepicker after switching to an index pattern with timefield', async function() { | ||
| expect(await PageObjects.timePicker.timePickerExists()).to.be(false); | ||
| await PageObjects.discover.selectIndexPattern('with-timefield'); | ||
| expect(await PageObjects.timePicker.timePickerExists()).to.be(true); |
There was a problem hiding this comment.
Unrelated recommendation: I think avoiding boolean assertions makes failures a lot easier to debug. It's often unhelpful to get expected false to be true, but it's really easy to do this:
if (!await PageObjects.timePicker.timePickerExists()) {
throw new Error('expected timepicker to exist')
}There was a problem hiding this comment.
this is so true! thx for that! but shouldn't there be at least 1 expect in a test? or isn't it necessary?
There was a problem hiding this comment.
Nope, using expect() is not necessary to write meaningful assertions.
There was a problem hiding this comment.
thx, i've refactored it this way
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…ine-editor * 'master' of github.com:elastic/kibana: (129 commits) [Canvas] Force embeddables to refresh when renderable reevaluated (#67133) [Canvas] Better handling navigating to/from canvas (#66407) [Ingest pipelines] Fix schema validation for simulate and update routes (#67199) do not use es from setup (#67277) Auto expand replicas for event log (#67286) Observability & APM do not use elasticsearch client provided via setup contract (#67263) Fix privileges check when security is not enabled (#67308) add IIS home (#66918) [ML] Adding additional job service endpoint tests (#66892) [Ingest Manager] Update fleet internal doc with latest flags (#67193) [Discover] Deangularize the loading spinner (#67165) Add `application.navigateToUrl` core API (#67110) Improve indexpattern without timefield functional test (#67031) KibanaContext in index pattern managment ui (#66985) Fix Azure metrics tutorial inside the App Home/ Add data area (#66901) add azure logs home (#66910) fix: rum agent should work correctly on new platform (#67037) [test_utils/Testbed] Move to src/test_utils folder (OSS) (#66898) only block registration when appRoute contains the exact basePath (#67125) Changed actions API endpoints urls to follow Kibana STYLEGUIDE (#65936) ... # Conflicts: # x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
4 similar comments
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Summary
While the flaky test runner couldn't reproduce the flakiness, I've improved the code by pre-selecting the index pattern in the uiSettings. A screenshot of a cloud failure, pointed to this direction. The test was stuck selecting the right index pattern. This simple tweak reduced the time used for this test to about 20% (!) of the former implementation.
Fixes #63273
Here's the flaky test runner run of this implementation: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/470/
Checklist
Delete any items that are not applicable to this PR.