-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
@@ -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'); |
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.
It might be better to move it to a separate it
block:
it('contains a page title', () => {});
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 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
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.
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', ...
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.
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.
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.
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
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.
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.
Pinging @elastic/endpoint-app-team (Feature:Endpoint) |
Pinging @elastic/endpoint-response (Team:Endpoint Response) |
@elasticmachine merge upstream |
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 () => { |
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.
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 () => {});
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.
That's better than what I have, will update shortly. Thanks P.
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 modified, lets see how we like the latest when folks have time to review
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.
Looks good. Thanks!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* 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) ...
* 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>
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. |
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. |
7.x/7.7: e29c401 |
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.
Checklist
n/a
For maintainers
n/a