-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.x' into backport/7.x/pr-72020
- Loading branch information
Showing
21 changed files
with
400 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
x-pack/plugins/security_solution/cypress/fixtures/value_list.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
these | ||
are | ||
keywords | ||
for | ||
a | ||
list |
43 changes: 43 additions & 0 deletions
43
x-pack/plugins/security_solution/cypress/integration/value_lists.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login'; | ||
import { DETECTIONS_URL } from '../urls/navigation'; | ||
import { | ||
waitForAlertsPanelToBeLoaded, | ||
waitForAlertsIndexToBeCreated, | ||
goToManageAlertsDetectionRules, | ||
} from '../tasks/alerts'; | ||
import { | ||
waitForListsIndexToBeCreated, | ||
waitForValueListsModalToBeLoaded, | ||
openValueListsModal, | ||
selectValueListsFile, | ||
uploadValueList, | ||
} from '../tasks/lists'; | ||
import { VALUE_LISTS_TABLE, VALUE_LISTS_ROW } from '../screens/lists'; | ||
|
||
describe('value lists', () => { | ||
describe('management modal', () => { | ||
it('creates a keyword list from an uploaded file', () => { | ||
loginAndWaitForPageWithoutDateRange(DETECTIONS_URL); | ||
waitForAlertsPanelToBeLoaded(); | ||
waitForAlertsIndexToBeCreated(); | ||
waitForListsIndexToBeCreated(); | ||
goToManageAlertsDetectionRules(); | ||
waitForValueListsModalToBeLoaded(); | ||
openValueListsModal(); | ||
selectValueListsFile(); | ||
uploadValueList(); | ||
|
||
cy.get(VALUE_LISTS_TABLE) | ||
.find(VALUE_LISTS_ROW) | ||
.should(($row) => { | ||
expect($row.text()).to.contain('value_list.txt'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const VALUE_LISTS_MODAL_ACTIVATOR = '[data-test-subj="open-value-lists-modal-button"]'; | ||
export const VALUE_LISTS_TABLE = '[data-test-subj="value-lists-table"]'; | ||
export const VALUE_LISTS_ROW = '.euiTableRow'; | ||
export const VALUE_LIST_FILE_PICKER = '[data-test-subj="value-list-file-picker"]'; | ||
export const VALUE_LIST_FILE_UPLOAD_BUTTON = '[data-test-subj="value-lists-form-import-action"]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
VALUE_LISTS_MODAL_ACTIVATOR, | ||
VALUE_LIST_FILE_PICKER, | ||
VALUE_LIST_FILE_UPLOAD_BUTTON, | ||
} from '../screens/lists'; | ||
|
||
export const waitForListsIndexToBeCreated = () => { | ||
cy.request({ url: '/api/lists/index', retryOnStatusCodeFailure: true }).then((response) => { | ||
if (response.status !== 200) { | ||
cy.wait(7500); | ||
} | ||
}); | ||
}; | ||
|
||
export const waitForValueListsModalToBeLoaded = () => { | ||
cy.get(VALUE_LISTS_MODAL_ACTIVATOR).should('exist'); | ||
cy.get(VALUE_LISTS_MODAL_ACTIVATOR).should('not.be.disabled'); | ||
}; | ||
|
||
export const openValueListsModal = () => { | ||
cy.get(VALUE_LISTS_MODAL_ACTIVATOR).click(); | ||
}; | ||
|
||
export const selectValueListsFile = () => { | ||
cy.get(VALUE_LIST_FILE_PICKER).attachFile('value_list.txt').trigger('change', { force: true }); | ||
}; | ||
|
||
export const uploadValueList = () => { | ||
cy.get(VALUE_LIST_FILE_UPLOAD_BUTTON).click(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.