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

[Reporting] use data-test-subj on toast to check for failure #25482

Merged
merged 7 commits into from
Nov 16, 2018

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Nov 9, 2018

Depends on: elastic/eui#1302
Resolves: #25418

Summary

This fixes a regression bug in Reporting's detection of Error and Warning toast notifications.

Screenshot

image

To test:

  1. Start a Kibana "A" instance:
    node scripts/kibana -c config/kibana.dev.xpack.yml
    
  2. Start a Kibana "B" instance with reporting polling disabled:
    node scripts/kibana -c config/kibana.dev.xpack.yml --kibana.index=.kibana-boo --server.port=5661 --xpack.reporting.queue.pollEnabled=false
    
  3. Create a dashboard in the "B" instance (http://localhost:5661)
  4. Queue a report of the dashboard in the "B" instance
    • The "A" instance should claim the reporting job
  5. Report should fail with a clear message

Checklist

@tsullivan tsullivan added bug Fixes for quality problems that affect the customer experience review regression v7.0.0 v6.6.0 labels Nov 9, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

Cool! code review only. this will be great. Just a reminder, bug fixes only to go into master until November 13th.

screenshot: '[data-shared-item]',
renderComplete: '[data-shared-item]',
itemsCountAttribute: 'data-shared-items-count',
timefilterFromAttribute: 'data-shared-timefilter-from',
timefilterToAttribute: 'data-shared-timefilter-to',
toastHeader: '[data-test-subj="euiToastHeader"]',
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nitpick: seems odd to mix selectors with dom-attributes in a selectors object. Not relevant to your PR but had me scratching my head for a second since some values had brackets and some didn't.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, it seems a little weird that it was originally done this way.

@@ -59,9 +59,16 @@ export function screenshotsObservableFactory(server) {
await browser.waitForSelector(`${layout.selectors.renderComplete},[${layout.selectors.itemsCountAttribute}]`);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this function confused me for a bit as I didn't expect it to throw (reading it without context, that is). Maybe something like waitForToastError? I guess something to query the developer that this function will throw when called.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had it as-is because we can't reliably differentiate "error" toast messages from any other kind of toast. So if "error" is not going to refer to what we're looking for on the page. This wouldn't be do-able if we don't also grab the message from the toast. The user can review what was there and decide if configuration needs to be fixed, or if was just a flash message and they can re-try again.

How about checkForToastMessage?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me, and agreed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@tsullivan
Copy link
Member Author

interesting build failure:

21:30:44 Running "run:checkFileCasing" (run) task
21:30:54 
21:30:54 Running "licenses" task
21:31:11 Fatal error: Non-conforming licenses: 
21:31:11   cycle
21:31:11     version: 1.0.3
21:31:11     all licenses: Custom: https://github.com/douglascrockford/JSON-js
21:31:11     invalid licenses: Custom: https://github.com/douglascrockford/JSON-js
21:31:11     path: node_modules/cycle
21:31:11 
21:31:11   infra
21:31:11     version: 7.0.0
21:31:11     all licenses: UNKNOWN
21:31:11     invalid licenses: UNKNOWN
21:31:11     path: x-pack/plugins/infra

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@tsullivan tsullivan merged commit c6fece7 into elastic:master Nov 16, 2018
@tsullivan tsullivan deleted the fix/reporting-toast-detection branch November 16, 2018 19:10
tsullivan added a commit to tsullivan/kibana that referenced this pull request Nov 16, 2018
…#25482)

* [Reporting] use data-test-subj on toast to check for failure

* use header subj selector

* use toast header text

* helper function rename - checkForToastMessage
tsullivan added a commit that referenced this pull request Nov 16, 2018
…#25826)

* [Reporting] use data-test-subj on toast to check for failure

* use header subj selector

* use toast header text

* helper function rename - checkForToastMessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience regression review v6.6.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Reporting] Detect Saved Object Not Found
4 participants