mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution] Fix attach to case test (#119589)
* updates the detections script in order to take into consideration the new alerts index * refactors and unskips attach to case test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
40eb1a370e
commit
d3d61d3482
10 changed files with 22 additions and 13 deletions
|
@ -8,7 +8,11 @@
|
|||
import { getNewRule } from '../../objects/rule';
|
||||
import { ROLES } from '../../../common/test';
|
||||
|
||||
import { waitForAlertsIndexToBeCreated, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts';
|
||||
import {
|
||||
expandFirstAlertActions,
|
||||
waitForAlertsIndexToBeCreated,
|
||||
waitForAlertsPanelToBeLoaded,
|
||||
} from '../../tasks/alerts';
|
||||
import { createCustomRuleActivated } from '../../tasks/api_calls/rules';
|
||||
import { cleanKibana } from '../../tasks/common';
|
||||
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
|
||||
|
@ -16,7 +20,7 @@ import { login, loginAndWaitForPage, waitForPageWithoutDateRange } from '../../t
|
|||
import { refreshPage } from '../../tasks/security_header';
|
||||
|
||||
import { ALERTS_URL } from '../../urls/navigation';
|
||||
import { ATTACH_ALERT_TO_CASE_BUTTON, TIMELINE_CONTEXT_MENU_BTN } from '../../screens/alerts';
|
||||
import { ATTACH_ALERT_TO_CASE_BUTTON } from '../../screens/alerts';
|
||||
|
||||
const loadDetectionsPage = (role: ROLES) => {
|
||||
waitForPageWithoutDateRange(ALERTS_URL, role);
|
||||
|
@ -44,7 +48,7 @@ describe('Alerts timeline', () => {
|
|||
});
|
||||
|
||||
it('should not allow user with read only privileges to attach alerts to cases', () => {
|
||||
cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true });
|
||||
expandFirstAlertActions();
|
||||
cy.get(ATTACH_ALERT_TO_CASE_BUTTON).should('not.exist');
|
||||
});
|
||||
});
|
||||
|
@ -54,9 +58,8 @@ describe('Alerts timeline', () => {
|
|||
loadDetectionsPage(ROLES.platform_engineer);
|
||||
});
|
||||
|
||||
// Skipping due to alerts not refreshing for platform_engineer despite being returned from API?
|
||||
it.skip('should allow a user with crud privileges to attach alerts to cases', () => {
|
||||
cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true });
|
||||
it('should allow a user with crud privileges to attach alerts to cases', () => {
|
||||
expandFirstAlertActions();
|
||||
cy.get(ATTACH_ALERT_TO_CASE_BUTTON).first().should('not.be.disabled');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -60,6 +60,10 @@ export const closeAlerts = () => {
|
|||
.should('not.be.visible');
|
||||
};
|
||||
|
||||
export const expandFirstAlertActions = () => {
|
||||
cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true });
|
||||
};
|
||||
|
||||
export const expandFirstAlert = () => {
|
||||
cy.get(EXPAND_ALERT_BTN).should('exist');
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
{
|
||||
"names": [
|
||||
".siem-signals-*",
|
||||
".alerts-security*",
|
||||
".lists*",
|
||||
".items*",
|
||||
"apm-*-transaction*",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"privileges": ["read", "write"]
|
||||
},
|
||||
{
|
||||
"names": [".siem-signals-*"],
|
||||
"names": [".alerts-security*", ".siem-signals-*"],
|
||||
"privileges": ["read", "write"]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"privileges": ["all"]
|
||||
},
|
||||
{
|
||||
"names": [".siem-signals-*"],
|
||||
"names": [".alerts-security*", ".siem-signals-*"],
|
||||
"privileges": ["all"]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
"indices": [
|
||||
{
|
||||
"names" : [
|
||||
".siem-signals*",
|
||||
".siem-signals-*",
|
||||
".alerts-security*",
|
||||
".lists*",
|
||||
".items*",
|
||||
"metrics-endpoint.metadata_current_*",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"privileges": ["read", "write"]
|
||||
},
|
||||
{
|
||||
"names": [".siem-signals-*"],
|
||||
"names": [".alerts-security*", ".siem-signals-*"],
|
||||
"privileges": ["read", "write", "maintenance", "view_index_metadata"]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"privileges": ["read", "write"]
|
||||
},
|
||||
{
|
||||
"names": [".siem-signals-*"],
|
||||
"names": [".alerts-security*", ".siem-signals-*"],
|
||||
"privileges": ["read", "write", "manage"]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"elasticsearch": {
|
||||
"cluster": [],
|
||||
"indices": [
|
||||
{ "names": [".siem-signals-*"], "privileges": ["read", "write", "maintenance"] },
|
||||
{ "names": [".alerts-security*", ".siem-signals-*"], "privileges": ["read", "write", "maintenance"] },
|
||||
{
|
||||
"names": [
|
||||
"apm-*-transaction*",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"elasticsearch": {
|
||||
"cluster": [],
|
||||
"indices": [
|
||||
{ "names": [".siem-signals-*"], "privileges": ["read", "write", "maintenance"] },
|
||||
{ "names": [".alerts-security*", ".siem-signals-*"], "privileges": ["read", "write", "maintenance"] },
|
||||
{
|
||||
"names": [
|
||||
".lists*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue