Skip to content

Commit

Permalink
[EDR Workflows] test alerts_linked_apps.cy.ts (#170708)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsonpl authored Nov 7, 2023
1 parent 3b4a901 commit 0eeb3c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions x-pack/plugins/osquery/cypress/e2e/all/add_integration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ describe('ALL - Add Integration', { tags: ['@ess', '@serverless'] }, () => {
cy.getBySel('epmList.searchBar').type('osquery');
cy.getBySel('integration-card:epr:osquery_manager').click();
cy.getBySel('addIntegrationPolicyButton').click();
cy.getBySel('globalLoadingIndicator').should('not.exist');

cy.getBySel('agentPolicySelect').within(() => {
cy.contains(policyName);
});
cy.getBySel('packagePolicyNameInput')
.wait(500)
.type(`{selectall}{backspace}${integrationName}`);
cy.getBySel('packagePolicyNameInput').clear().wait(500);
cy.getBySel('packagePolicyNameInput').type(`${integrationName}`);
cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click();
cy.getBySel('confirmModalCancelButton').click();
cy.get(`[title="${integrationName}"]`).should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
import { closeModalIfVisible, closeToastIfVisible } from '../../tasks/integrations';
import { RESULTS_TABLE, RESULTS_TABLE_BUTTON } from '../../screens/live_query';

// FLAKY: https://github.com/elastic/kibana/issues/170521
describe.skip(
describe(
'Alert Event Details',
{
tags: ['@ess', '@serverless'],
Expand All @@ -46,9 +45,10 @@ describe.skip(
cy.getBySel('editRuleSettingsLink').click();
cy.getBySel('globalLoadingIndicator').should('not.exist');
cy.getBySel('edit-rule-actions-tab').click();

cy.getBySel('osquery-investigation-guide-text').should('exist');
cy.getBySel('osqueryAddInvestigationGuideQueries').should('not.be.disabled');
cy.getBySel('globalLoadingIndicator').should('not.exist');
cy.contains('Loading connectors...').should('not.exist');

cy.getBySel('osqueryAddInvestigationGuideQueries').click();
cy.getBySel('osquery-investigation-guide-text').should('not.exist');

Expand All @@ -60,6 +60,7 @@ describe.skip(
cy.getBySel(RESPONSE_ACTIONS_ITEM_1).within(() => {
cy.contains('select * from users');
});

cy.contains('Save changes').click();
cy.contains(`${ruleName} was saved`).should('exist');
closeToastIfVisible();
Expand Down
6 changes: 4 additions & 2 deletions x-pack/plugins/osquery/cypress/tasks/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export const addIntegration = (agentPolicy = DEFAULT_POLICY) => {
export const addCustomIntegration = (integrationName: string, policyName: string) => {
cy.getBySel(ADD_POLICY_BTN).click();
cy.getBySel(DATA_COLLECTION_SETUP_STEP).find('.euiLoadingSpinner').should('not.exist');
cy.getBySel('packagePolicyNameInput').type(`{selectall}{backspace}${integrationName}`);
cy.getBySel('createAgentPolicyNameField').type(`{selectall}{backspace}${policyName}`);
cy.getBySel('packagePolicyNameInput').clear();
cy.getBySel('packagePolicyNameInput').type(`${integrationName}`);
cy.getBySel('createAgentPolicyNameField').clear();
cy.getBySel('createAgentPolicyNameField').type(`${policyName}`);
cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click();
// No agent is enrolled with this policy, close "Add agent" modal
cy.getBySel('confirmModalCancelButton').click();
Expand Down

0 comments on commit 0eeb3c3

Please sign in to comment.