Skip to content

Commit

Permalink
pr Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
animehart committed Oct 18, 2024
1 parent 9292da7 commit 602865d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1861,8 +1861,9 @@ 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/investigations/alerts/expandable_flyout/misconfiguration_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture
/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/vulnerabilities_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture
/x-pack/test/security_solution_cypress/cypress/e2e/cloud_security_posture/misconfiguration_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture
/x-pack/test/security_solution_cypress/cypress/e2e/cloud_security_posture/vulnerabilities_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture

# Security Solution onboarding tour
/x-pack/plugins/security_solution/public/common/components/guided_onboarding @elastic/security-threat-hunting-explore

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cloud_security_posture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +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)
1. [Cypress End-to-End Tests](../../test/security_solution_cypress/cypress/e2e/cloud_security_posture)


### Tools
Expand Down
3 changes: 3 additions & 0 deletions x-pack/test/security_solution_cypress/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Run the tests with the following yarn scripts from `x-pack/test/security_solutio
| cypress:detection_engine:run:serverless | Runs all tests tagged as SERVERLESS in the `e2e/detection_response/detection_engine` excluding `e2e/detection_response/detection_engine` directory in headless mode |
| cypress:ai_assistant:run:ess | Runs all tests tagged as ESS in the `e2e/ai_assistant` directory in headless mode |
| cypress:ai_assistant:run:serverless | Runs all tests tagged as SERVERLESS in the `e2e/ai_assistant` directory in headless mode |
| cypress:cloud_security_posture:run:ess | Runs all tests tagged as ESS in the `e2e/cloud_security_posture` directory in headless mode |
| cypress:cloud_security_posture:run:serverless | Runs all tests tagged as SERVERLESS in the `e2e/cloud_security_posture` directory in headless mode |
| cypress:detection_engine:exceptions:run:serverless | Runs all tests tagged as ESS in the `e2e/detection_response/detection_engine/exceptions` directory in headless mode |
| cypress:investigations:run:ess | Runs all tests tagged as SERVERLESS in the `e2e/investigations` directory in headless mode |
| cypress:explore:run:ess | Runs all tests tagged as ESS in the `e2e/explore` directory in headless mode |
Expand All @@ -88,6 +90,7 @@ Run the tests with the following yarn scripts from `x-pack/test/security_solutio
| cypress:run:qa:serverless:entity_analytics | Runs all tests tagged as SERVERLESS placed in the `e2e/entity_analytics` directory in headless mode using the QA environment and real MKI projects.|
| cypress:run:qa:serverless:explore | Runs all tests tagged as SERVERLESS in the `e2e/explore` directory in headless mode using the QA environment and real MKI prorjects. |
| cypress:run:qa:serverless:investigations | Runs all tests tagged as SERVERLESS in the `e2e/investigations` directory in headless mode using the QA environment and reak MKI projects. |
| cypress:run:qa:serverless:cloud_security_posture | Runs all tests tagged as SERVERLESS in the `e2e/cloud_security_posture` directory in headless mode using the QA environment and reak MKI projects. |
| cypress:run:qa:serverless:rule_management | Runs all tests tagged as SERVERLESS in the `e2e/detection_response/rule_management` directory, excluding `e2e/detection_response/rule_management/prebuilt_rules` in headless mode using the QA environment and reak MKI projects. |
| cypress:run:qa:serverless:rule_management:prebuilt_rules | Runs all tests tagged as SERVERLESS in the `e2e/detection_response/rule_management/prebuilt_rules` directory in headless mode using the QA environment and reak MKI projects. |
| cypress:run:qa:serverless:detection_engine | Runs all tests tagged as SERVERLESS in the `e2e/detection_response/detection_engine` directory, excluding `e2e/detection_response/detection_engine/exceptions` in headless mode using the QA environment and reak MKI projects. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ const CSP_INSIGHT_TABLE = getDataTestSubjectSelector(
'securitySolutionFlyoutMisconfigurationFindingsTable'
);

const clickMisconfigurationTitle = () => {
cy.get(CSP_INSIGHT_MISCONFIGURATION_TITLE).click();
};

const timestamp = Date.now();

// Create a Date object using the timestamp
const date = new Date(timestamp);

// Convert the Date object to ISO 8601 format
const iso8601String = date.toISOString();

const mockFindingHostName = (matches: boolean) => {
Expand All @@ -46,7 +48,7 @@ const mockFindingHostName = (matches: boolean) => {
name: 'kubelet',
sub_type: 'lower case sub type',
},
result: { evaluation: matches ? 'passed' : 'failed' }, // Adjusting result based on matches
result: { evaluation: matches ? 'passed' : 'failed' },
rule: {
name: 'Upper case rule name',
section: 'Upper case section',
Expand Down Expand Up @@ -74,7 +76,7 @@ const mockFindingUserName = (matches: boolean) => {
name: 'kubelet',
sub_type: 'lower case sub type',
},
result: { evaluation: matches ? 'passed' : 'failed' }, // Adjusting result based on matches
result: { evaluation: matches ? 'passed' : 'failed' },
rule: {
name: 'Upper case rule name',
section: 'Upper case section',
Expand Down Expand Up @@ -132,6 +134,7 @@ describe('Alert Host details expandable flyout', { tags: ['@ess', '@serverless']
});

afterEach(() => {
/* Deleting data stream even though we don't create it because data stream is automatically created when Cloud security API is used */
deleteDataStream();
});

Expand All @@ -141,7 +144,7 @@ describe('Alert Host details expandable flyout', { tags: ['@ess', '@serverless']
});

it('should display insight tabs and findings table upon clicking on misconfiguration accordion', () => {
cy.get(CSP_INSIGHT_MISCONFIGURATION_TITLE).click();
clickMisconfigurationTitle();
cy.get(CSP_INSIGHT_TAB_TITLE).should('be.visible');
cy.get(CSP_INSIGHT_TABLE).should('be.visible');
});
Expand Down Expand Up @@ -186,7 +189,7 @@ describe('Alert Host details expandable flyout', { tags: ['@ess', '@serverless']
});

it('should display insight tabs and findings table upon clicking on misconfiguration accordion', () => {
cy.get(CSP_INSIGHT_MISCONFIGURATION_TITLE).click();
clickMisconfigurationTitle();
cy.get(CSP_INSIGHT_TAB_TITLE).should('be.visible');
cy.get(CSP_INSIGHT_TABLE).should('be.visible');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ const CSP_INSIGHT_VULNERABILITIES_TABLE = getDataTestSubjectSelector(

const timestamp = Date.now();

// Create a Date object using the timestamp
const date = new Date(timestamp);

// Convert the Date object to ISO 8601 format
const iso8601String = date.toISOString();

const getMockVulnerability = (isNameMatchesAlert: boolean) => {
Expand Down Expand Up @@ -166,6 +164,7 @@ describe('Alert Host details expandable flyout', { tags: ['@ess', '@serverless']
});

afterEach(() => {
/* Deleting data stream even though we don't create it because data stream is automatically created when Cloud security API is used */
deleteDataStream();
});

Expand Down

0 comments on commit 602865d

Please sign in to comment.