[Security Solution][Attacks/Alerts] Add a scheduled attack icon (#17461)#271871
[Security Solution][Attacks/Alerts] Add a scheduled attack icon (#17461)#271871e40pud wants to merge 8 commits into
Conversation
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#12538[✅] x-pack/solutions/security/plugins/security_solution/test/scout_security_attacks_alignment/ui/parallel.playwright.config.ts (--arch stateful --domain classic): 50/50 tests passed. |
MadameSheema
left a comment
There was a problem hiding this comment.
Follow-up: loginAsAdmin() grants full admin privileges, which is broader than what these tests actually need. The Scout Security Solution convention is to use the least-privileged role — browserAuth.loginAsPlatformEngineer() is the right default for standard CRUD access on the Attacks page.
This isn't introduced by this PR so I'm not blocking on it, but since you're already touching these specs it would be a good time to swap it :)
| await this.attackDetailsFlyoutBody.waitFor({ state: 'visible' }); | ||
| } | ||
|
|
||
| async openFirstScheduleDetailsFromTable() { |
There was a problem hiding this comment.
This is semantically equivalent to .first(), which playwright/no-nth-methods targets. Since the test always seeds exactly one attack and tableScheduleButtons is already scoped to attacksTableSection, the locator should resolve to a single element — which means await this.tableScheduleButtons.click() would work directly and Playwright's strict mode would enforce uniqueness. The .all() destructure adds complexity without benefit here.
The same issue exists in the pre-existing openFirstAttackDetailsFromTable() method — but since you're adding a new method, it's worth getting right rather than copying the pattern.
There was a problem hiding this comment.
I agree that .click() would work with Playwright's strict mode right now since we only seed one attack. However, in an upcoming PR, I will be extending the seeding to add multiple attacks to the table. I've left the .all() destructuring pattern in place to future-proof these methods so they don't break when multiple buttons are present.
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Page load bundle
History
cc @e40pud |
I completely agree that we should be using the least-privileged role (browserAuth.loginAsPlatformEngineer()) here. I actually tried swapping it during development, but it caused some unexpected test failures (it seemed the platform engineer role couldn't see the seeded attacks, causing the locators to fail). Since figuring out the exact privilege gap or setup issue might take a bit of digging, I've created a follow-up ticket to address this specifically so it doesn't block this feature delivery: https://github.com/elastic/security-team/issues/17653. We'll get this swapped over in that PR! |
Summary
Closes https://github.com/elastic/security-team/issues/17461
This PR introduces a "scheduled" icon to the Attack Group component within the Attacks table and the Attack Discovery page. Clicking this icon opens the schedule details flyout.
Key Changes:
ScheduleDetailsButtoncomponent with its own translations.AttackGroupContent(Attacks table) andTitle(Attack Discovery panel header) components.EuiToolTipfor sighted users, added properaria-labels, and stopped event propagation on click to prevent unintentionally expanding the attack group details row.AttacksEventTypes.ScheduleDetailsFlyoutOpened) with sourcesattacks_page_tableandattack_discovery_page.attacks_page_smoke.spec.tsandattacks_schedule.spec.ts) to verify the button and flyout visibility.Verification Steps
AttacksEventTypes.ScheduleDetailsFlyoutOpenedevent is fired with the correctsource(attacks_page_tableorattack_discovery_page).Screenshots
PR developed with Cursor + Gemini 3.1 Pro