Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cypress tests for inspect button on explore pages (#151714)
EPIC: elastic/security-team#5979 Test: `C164772 | Validate that Inspect button works correctly and details display as per the data view selected after the build upgrade` ## Summary * Group all inspect button tests into one file to make the test quicker. * Add entries for missing visualizations and tables Many cypress tests are broken because I enabled the experimental feature. They will be fixed by this PR #150531 - [x] Unkip cypress tests listed [here](#152359) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
1 parent
c8b3ae2
commit b1d2915
Showing
20 changed files
with
414 additions
and
173 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
50 changes: 0 additions & 50 deletions
50
x-pack/plugins/security_solution/cypress/e2e/hosts/inspect.cy.ts
This file was deleted.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
x-pack/plugins/security_solution/cypress/e2e/inspect/inspect_button.cy.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,80 @@ | ||
/* | ||
* 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 { | ||
INSPECT_BUTTONS_IN_SECURITY, | ||
INSPECT_MODAL, | ||
INSPECT_MODAL_INDEX_PATTERN, | ||
} from '../../screens/inspect'; | ||
import { | ||
closesModal, | ||
openLensVisualizationsInspectModal, | ||
openTab, | ||
openTableInspectModal, | ||
} from '../../tasks/inspect'; | ||
import { login, visit } from '../../tasks/login'; | ||
import { HOSTS_URL } from '../../urls/navigation'; | ||
import { postDataView, waitForPageToBeLoaded } from '../../tasks/common'; | ||
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; | ||
import { selectDataView } from '../../tasks/sourcerer'; | ||
|
||
const DATA_VIEW = 'auditbeat-*'; | ||
|
||
describe('Inspect Explore pages', () => { | ||
before(() => { | ||
esArchiverLoad('risk_users'); | ||
esArchiverLoad('risk_hosts'); | ||
login(); | ||
|
||
// Create and select data view | ||
postDataView(DATA_VIEW); | ||
visit(HOSTS_URL); | ||
selectDataView(DATA_VIEW); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('risk_users'); | ||
esArchiverUnload('risk_hosts'); | ||
}); | ||
|
||
INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => { | ||
/** | ||
* Group all tests of a page into one "it" call to improve speed | ||
*/ | ||
it(`inspect ${pageName} page`, () => { | ||
visit(url); | ||
waitForPageToBeLoaded(); | ||
|
||
lensVisualizations.forEach((lens) => { | ||
cy.log(`inspects the ${lens.title} visualization`); | ||
openTab(lens.tab); | ||
|
||
openLensVisualizationsInspectModal(lens, () => { | ||
cy.get(INSPECT_MODAL).should('be.visible'); | ||
cy.get(INSPECT_MODAL_INDEX_PATTERN).should( | ||
'contain.text', | ||
lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW | ||
); | ||
}); | ||
}); | ||
|
||
tables.forEach((table) => { | ||
cy.log(`inspects the ${table.title}`); | ||
openTab(table.tab); | ||
|
||
openTableInspectModal(table); | ||
cy.get(INSPECT_MODAL).should('be.visible'); | ||
cy.get(INSPECT_MODAL_INDEX_PATTERN).should( | ||
'contain.text', | ||
table.customIndexPattern ? table.customIndexPattern : DATA_VIEW | ||
); | ||
|
||
closesModal(); | ||
}); | ||
}); | ||
}); | ||
}); |
37 changes: 0 additions & 37 deletions
37
x-pack/plugins/security_solution/cypress/e2e/network/inspect.cy.ts
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
x-pack/plugins/security_solution/cypress/e2e/users/inspect.cy.ts
This file was deleted.
Oops, something went wrong.
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.