-
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
[Security Solution][Detection Engine] Getting rid off before hook if is not loading an archive #178876
[Security Solution][Detection Engine] Getting rid off before hook if is not loading an archive #178876
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,10 @@ import { | |
import { createExceptionList } from '../../../../../../tasks/api_calls/exceptions'; | ||
|
||
import { TOASTER } from '../../../../../../screens/alerts_detection_rules'; | ||
import { | ||
deleteAlertsAndRules, | ||
deleteExceptionLists, | ||
} from '../../../../../../tasks/api_calls/common'; | ||
|
||
const EXCEPTION_LIST_NAME = 'My test list'; | ||
const EXCEPTION_LIST_TO_DUPLICATE_NAME = 'A test list 2'; | ||
|
@@ -56,7 +60,9 @@ describe( | |
{ tags: ['@ess', '@serverless'] }, | ||
() => { | ||
describe('Create/Export/Delete List', () => { | ||
before(() => { | ||
beforeEach(() => { | ||
deleteAlertsAndRules(); | ||
deleteExceptionLists(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing the same pattern as above here: after the last test, any rules and exception lists created will still be present for the next test. There should probably also be an Trying to set up a pristine state in the |
||
createRule(getNewRule({ name: 'Another rule' })); | ||
|
||
// Create exception list associated with a rule | ||
|
@@ -79,9 +85,7 @@ describe( | |
createExceptionList(getExceptionList1(), getExceptionList1().list_id).then((response) => { | ||
exceptionListResponse = response; | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
login(); | ||
visit(EXCEPTIONS_URL); | ||
waitForExceptionsTableToBeLoaded(); | ||
|
@@ -124,13 +128,13 @@ describe( | |
it('Delete exception list without rule reference', () => { | ||
// Using cy.contains because we do not care about the exact text, | ||
// just checking number of lists shown | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '4'); | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '3'); | ||
|
||
deleteExceptionListWithoutRuleReferenceByListId(getExceptionList1().list_id); | ||
|
||
// Using cy.contains because we do not care about the exact text, | ||
// just checking number of lists shown | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '3'); | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '2'); | ||
}); | ||
|
||
it('Deletes exception list with rule reference', () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,13 +27,10 @@ const alertRunTimeField = 'field.name.alert.page'; | |
const timelineRuntimeField = 'field.name.timeline'; | ||
|
||
describe('Create DataView runtime field', { tags: ['@ess', '@serverless'] }, () => { | ||
before(() => { | ||
deleteRuntimeField('security-solution-default', alertRunTimeField); | ||
deleteRuntimeField('security-solution-default', timelineRuntimeField); | ||
}); | ||
|
||
beforeEach(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, no |
||
login(); | ||
deleteRuntimeField('security-solution-default', alertRunTimeField); | ||
deleteRuntimeField('security-solution-default', timelineRuntimeField); | ||
}); | ||
|
||
it('adds field to alert table', () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { login } from '../../../../tasks/login'; | |
const dataViews = ['auditbeat-*,fakebeat-*', 'auditbeat-*,*beat*,siem-read*,.kibana*,fakebeat-*']; | ||
|
||
describe('Sourcerer permissions', { tags: ['@ess', '@brokenInServerless'] }, () => { | ||
before(() => { | ||
beforeEach(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😢 |
||
dataViews.forEach((dataView: string) => postDataView(dataView)); | ||
}); | ||
|
||
|
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 looks like
DATAVIEW
will still exist after the last test is run. Should there be an additionalafterEach
with adeleteDataView(DATAVIEW)
?