forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCS Cypress integration (elastic#103941) (elastic#104496)
* Add CCS Cypress test runner * Split flow for CCS Cypress tests * Make esArchiver load data onto the remote cluster * Add CCS specific rules with customizable remote name * Allow overriding @kbn/dev-utils's CA_CERT_PATH * Add CCS related docs Co-authored-by: Gloria Hornero <[email protected]> Co-authored-by: Domenico Andreoli <[email protected]> Co-authored-by: Gloria Hornero <[email protected]>
- Loading branch information
1 parent
b85bf3c
commit b1335ea
Showing
8 changed files
with
228 additions
and
1 deletion.
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
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
72 changes: 72 additions & 0 deletions
72
...plugins/security_solution/cypress/ccs_integration/detection_alerts/alerts_details.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,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { CELL_TEXT, JSON_LINES, TABLE_ROWS } from '../../screens/alerts_details'; | ||
|
||
import { | ||
expandFirstAlert, | ||
waitForAlertsIndexToBeCreated, | ||
waitForAlertsPanelToBeLoaded, | ||
} from '../../tasks/alerts'; | ||
import { openJsonView, openTable, scrollJsonViewToBottom } from '../../tasks/alerts_details'; | ||
import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; | ||
import { cleanKibana } from '../../tasks/common'; | ||
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; | ||
import { esArchiverCCSLoad, esArchiverCCSUnload } from '../../tasks/es_archiver'; | ||
|
||
import { unmappedCCSRule } from '../../objects/rule'; | ||
|
||
import { ALERTS_URL } from '../../urls/navigation'; | ||
|
||
describe('Alert details with unmapped fields', () => { | ||
beforeEach(() => { | ||
cleanKibana(); | ||
esArchiverCCSLoad('unmapped_fields'); | ||
loginAndWaitForPageWithoutDateRange(ALERTS_URL); | ||
waitForAlertsPanelToBeLoaded(); | ||
waitForAlertsIndexToBeCreated(); | ||
createCustomRuleActivated(unmappedCCSRule); | ||
loginAndWaitForPageWithoutDateRange(ALERTS_URL); | ||
waitForAlertsPanelToBeLoaded(); | ||
expandFirstAlert(); | ||
}); | ||
|
||
afterEach(() => { | ||
esArchiverCCSUnload('unmapped_fields'); | ||
}); | ||
|
||
it('Displays the unmapped field on the JSON view', () => { | ||
const expectedUnmappedField = { line: 2, text: ' "unmapped": "This is the unmapped field"' }; | ||
|
||
openJsonView(); | ||
scrollJsonViewToBottom(); | ||
|
||
cy.get(JSON_LINES).then((elements) => { | ||
const length = elements.length; | ||
cy.wrap(elements) | ||
.eq(length - expectedUnmappedField.line) | ||
.should('have.text', expectedUnmappedField.text); | ||
}); | ||
}); | ||
|
||
it('Displays the unmapped field on the table', () => { | ||
const expectedUnmmappedField = { | ||
row: 55, | ||
field: 'unmapped', | ||
text: 'This is the unmapped field', | ||
}; | ||
|
||
openTable(); | ||
|
||
cy.get(TABLE_ROWS) | ||
.eq(expectedUnmmappedField.row) | ||
.within(() => { | ||
cy.get(CELL_TEXT).eq(0).should('have.text', expectedUnmmappedField.field); | ||
cy.get(CELL_TEXT).eq(1).should('have.text', expectedUnmmappedField.text); | ||
}); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
|
||
import { SecuritySolutionCypressCcsTestRunner } from './runner'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const securitySolutionCypressConfig = await readConfigFile(require.resolve('./config.ts')); | ||
return { | ||
...securitySolutionCypressConfig.getAll(), | ||
|
||
testRunner: SecuritySolutionCypressCcsTestRunner, | ||
}; | ||
} |
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