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

[Endpoint] TEST: verify alerts page header says 'Alerts' #60206

Merged
merged 6 commits into from
Mar 16, 2020

Conversation

EricDavisX
Copy link
Contributor

Summary

Adds in a test to verify that the word 'Alerts' is the Alert header for the page. other pages have it so it seemed a silly easy way to do a first PR as I explore Typescript and our repo and code.

Screen Shot 2020-03-14 at 3 56 08 PM

Checklist

n/a

For maintainers

n/a

@EricDavisX EricDavisX requested a review from a team as a code owner March 14, 2020 19:57
@EricDavisX EricDavisX added v7.7.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Mar 15, 2020
@EricDavisX EricDavisX changed the title TEST: test to verify alerts page header says alerts TEST: verify alerts page header says 'Alerts' Mar 15, 2020
@@ -21,6 +21,8 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('loads the Alert List Page', async () => {
await testSubjects.existOrFail('alertListPage');
const alertsTitle = await testSubjects.getVisibleText('alertsViewTitle');
expect(alertsTitle).to.equal('Alerts');
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to move it to a separate it block:

it('contains a page title', () => {});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can update this, but I disagree on the premise.

I have a separate discussion I'm going to post to our team and possibly the larger group about our test groupings. We're loading the page 3-5 times and thus far doing nothing interactive and there isn't even any data - it can be streamlined, and the tests run faster, if we choose to.

For now I'd propose we leave this as is, the word 'Alerts' is an integral part of the initial page load as the test case assesses. @peluja1012

Copy link
Contributor

Choose a reason for hiding this comment

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

It would seem that this expect should be in it's own it block based on how this describe block is already structured. Perhaps
it('includes Alerts title', ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It feels immaterial to me as I hope every page that loads has a title to be assessed. I can update it all the same, tho. Most importantly I am interested in driving the conversation further on test code structure best practices.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, i updated the test to a new 'it' block. i still disagree its needed or best, but I got 2 opinions on this that concurred, so its fine by me as its still fairly immaterial. Testrail updated to include a new test. Please re-review, @charlie-pichette @peluja1012

Copy link
Contributor

Choose a reason for hiding this comment

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

My reasoning for having it in a separate it() block was that it would be easier to determine on a failed test execution that the test failed because the Alerts title changed as opposed to the page not rendering at all. But I can also see the point that the title could be considered an integral part of the page loading.

@peluja1012 peluja1012 added the Feature:Endpoint Elastic Endpoint feature label Mar 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

@peluja1012 peluja1012 added the Team:Endpoint Response Endpoint Response Team label Mar 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-response (Team:Endpoint Response)

@EricDavisX
Copy link
Contributor Author

@elasticmachine merge upstream

@EricDavisX
Copy link
Contributor Author

Thanks Pedro. I acknowledge it would be helpful to know, its good to split them, as is done.

And Charlie urged me to better assess the page logins/reloads and I found it wasn't due to the number of tests anyhow, so the overall test time increase concern isn't / wasn't valid.

@@ -22,6 +22,10 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('loads the Alert List Page', async () => {
await testSubjects.existOrFail('alertListPage');
});
it('verifies the Alert List Page title', async () => {
Copy link
Contributor

@peluja1012 peluja1012 Mar 16, 2020

Choose a reason for hiding this comment

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

The way this test description is written will cause the test execution to read like this:

Endpoint Alert List verifies the Alert List Page title

I suggest updating the description such that the execution read better. Maybe something like:

Endpoint Alert List contains the Alerts title
it('contains the Alerts title', async () => {});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's better than what I have, will update shortly. Thanks P.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i modified, lets see how we like the latest when folks have time to review

@peluja1012 peluja1012 changed the title TEST: verify alerts page header says 'Alerts' [Endpoint] TEST: verify alerts page header says 'Alerts' Mar 16, 2020
Copy link
Contributor

@peluja1012 peluja1012 left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@EricDavisX EricDavisX merged commit 132383c into elastic:master Mar 16, 2020
@EricDavisX EricDavisX deleted the alerts-list-tests branch March 16, 2020 21:25
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 17, 2020
* master: (30 commits)
  [TSVB] fix text color when using custom background color (elastic#60261)
  Fix import to timefilter from in TSVB (elastic#60296)
  [NP] Get rid of usage redirectWhenMissing service (elastic#59777)
  [SIEM] Fix Timeline footer styling (elastic#59587)
  [ML] Fixes to error handling for analytics jobs and file data viz (elastic#60249)
  Give better stack traces for Unhandled Promise Rejection warnings (elastic#60235)
  resolves elastic#58905 (elastic#60120)
  Added variables button for text fields in Pagerduty component. (elastic#60189)
  adds test that action vars are rendered for alert action parms (elastic#60310)
  Closes 59786 by removing the update toast (elastic#60172)
  [EPM] Packages list tabs (elastic#60167)
  Added message variables button for Webhook body form field (elastic#60174)
  Revert "adds new test (elastic#60064)"
  [Maps] move MapSavedObject type out of telemetry (elastic#60127)
  [Reporting] Fix error handling for job handler in route (elastic#60161)
  [Endpoint] TEST: verify alerts page header says 'Alerts' (elastic#60206)
  EMT-248: implement ack resource to accept event payload to acknowledge agent actions (elastic#60218)
  Migrate dual validated range (elastic#59689)
  Embeddable triggers (elastic#58440)
  [Endpoint] Sample data generator CLI script (elastic#59952)
  ...
EricDavisX added a commit to EricDavisX/kibana that referenced this pull request Mar 17, 2020
* test to verify alerts page header says alerts

* updating test with pr feedback

* updating test with pr feedback and better verbiage

* updating test with pr feedback for better test titling

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
EricDavisX added a commit to EricDavisX/kibana that referenced this pull request Mar 17, 2020
* test to verify alerts page header says alerts

* updating test with pr feedback

* updating test with pr feedback and better verbiage

* updating test with pr feedback for better test titling

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
EricDavisX added a commit to EricDavisX/kibana that referenced this pull request Mar 17, 2020
* test to verify alerts page header says alerts

* updating test with pr feedback

* updating test with pr feedback and better verbiage

* updating test with pr feedback for better test titling

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 17, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 19, 2020
@spalger
Copy link
Contributor

spalger commented Mar 19, 2020

7.x/7.7: e29c401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes Team:Endpoint Response Endpoint Response Team v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants