-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Cloud Security] Cypress Test for Misconfiguration Preview and Table for Contextual Flyout #193125
Conversation
/ci |
/ci |
/ci |
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
...security_solution_cypress/cypress/e2e/explore/hosts/misconfiguration_contextual_flyout.cy.ts
Outdated
Show resolved
Hide resolved
...security_solution_cypress/cypress/e2e/explore/hosts/misconfiguration_contextual_flyout.cy.ts
Outdated
Show resolved
Hide resolved
...security_solution_cypress/cypress/e2e/explore/hosts/misconfiguration_contextual_flyout.cy.ts
Outdated
Show resolved
Hide resolved
@animehart couple of asks:
|
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.
LGTM!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
@@ -0,0 +1,232 @@ | |||
/* |
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.
Thanks for adding the test. Looks like it's interacting with alerts page and the flyout, shall we move it to x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout?
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.
ah kk
So I placed that test in the current folder because @machadoum suggested to put it here
would it be better if i move it to x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout instead ? @machadoum
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.
@animehart If the tested feature is only displayed inside the expandable flyout, placing the test where @angorayc suggested might make sense. But that is up to the @elastic/security-threat-hunting-investigations team to decide since they own the cypress/e2e/investigations
folder. I strongly suggest you create a folder for your team (cloud_security_posture?) so you don't depend on other teams for code reviews.
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.
@machadoum
As discussed before, we were planning to add our own folder later, the reason being is because adding a specific folder for our team now will involve further steps to to make the new test to be ran on CI and because of this time constraint we think its better for us to put our test in existing folder for now
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.
LGTM but I have a couple of questions I would like to hear your opinion on.
DM me after for approval
...security_solution_cypress/cypress/e2e/explore/hosts/misconfiguration_contextual_flyout.cy.ts
Outdated
Show resolved
Hide resolved
}); | ||
|
||
it('should display insight tabs and findings table upon clicking on misconfiguration accordion', () => { | ||
cy.contains('Failed findings', { timeout: 3000 }); |
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.
🤔 Whenever I see a time-out in a test, it concerns me that we have a performance issue with the UI (sometimes the test runner).
Have we had to do the same in the Selenium tests for the Findings?
I would have expected with mock data that we should be showing the table in under 3 seconds.
|
||
echo "--- Cloud Security Posture Workflows Cypress tests" | ||
|
||
cd x-pack/plugins/security_solution |
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.
This path should be changed to: x-pack/test/security_solution_cypress
where the package.json commands and the tests live.
|
||
echo "--- Cloud Security Posture Workflows Cypress tests on Serverless" | ||
|
||
cd x-pack/plugins/security_solution |
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.
This path should be changed to: x-pack/test/security_solution_cypress
where the package.json commands and the tests live.
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.
lgtm, couple of nit comments. Thanks for incorporating all the feedback!
|
||
const timestamp = Date.now(); | ||
|
||
// Create a Date object using the timestamp |
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.
nit: comments like this doesn't bring any value really as they are just describing the code below as is. So the can be safely removed
// Create a Date object using the timestamp | ||
const date = new Date(timestamp); | ||
|
||
// Convert the Date object to ISO 8601 format |
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.
nit: same as the comment about, just stating the obvious
}); | ||
|
||
afterEach(() => { | ||
deleteDataStream(); |
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.
here it is worth commenting that we deleting the data stream while we don't create it because the data stream is being created automatically when any cloud_security_api
is hit
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7174[✅] Cloud Security Posture - Cypress: 39/39 tests passed. |
.github/CODEOWNERS
Outdated
@@ -1861,8 +1861,8 @@ x-pack/plugins/osquery @elastic/security-defend-workflows | |||
/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.* @elastic/fleet @elastic/kibana-cloud-security-posture | |||
/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/cloud_posture_third_party_support_callout.* @elastic/fleet @elastic/kibana-cloud-security-posture | |||
/x-pack/plugins/security_solution/public/cloud_security_posture @elastic/kibana-cloud-security-posture | |||
/x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/vulnerabilities_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture | |||
|
|||
/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/misconfiguration_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture |
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.
Is it possible to move this test to your new folder?
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.
oh woops
missed that
@@ -20,6 +20,7 @@ For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide | |||
1. [End-to-End Tests](../../test/cloud_security_posture_functional/config.ts) | |||
1. [Serverless API Integration tests](../../test_serverless/api_integration/test_suites/security/config.ts) | |||
1. [Serverless End-to-End Tests](../../test_serverless/functional/test_suites/security/config.ts) | |||
1. [Cypress End-to-End Tests (Temporary location)](../../test/security_solution_cypress/cypress/e2e/cloud_security_posture) |
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.
Is this going to be a temporary location?
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.
nope, this is going to be the permanent location (unless its a problem ?)
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 is not! then let's remove the Temporary location
from the readme :)
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.
ah, you mean that text lol
I thought you talking about the directory XD
@@ -73,6 +74,17 @@ yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/securi | |||
yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts | |||
``` | |||
|
|||
Run [**End-to-End Cypress Tests**](https://github.com/elastic/kibana/tree/main/x-pack/test/security_solution_cypress/cypress): |
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.
The README inside the security_solution_cypress
folder should be updated as well.
}); | ||
|
||
it('should display insight tabs and findings table upon clicking on misconfiguration accordion', () => { | ||
cy.get(CSP_INSIGHT_MISCONFIGURATION_TITLE).click(); |
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.
NIT: Wrap this issue into a task method.
}); | ||
|
||
it('should display insight tabs and findings table upon clicking on misconfiguration accordion', () => { | ||
cy.get(CSP_INSIGHT_MISCONFIGURATION_TITLE).click(); |
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.
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7178[✅] Cloud Security Posture - Cypress: 45/45 tests passed. |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7187[✅] Cloud Security Posture - Cypress: 45/45 tests passed. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7189[✅] Cloud Security Posture - Cypress: 45/45 tests passed. |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7190[✅] Cloud Security Posture - Cypress: 45/45 tests passed. |
Starting backport for target branches: 8.16 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Summary
This PR is for Cypress test for the Misconfiguration Preview and Data table