-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove_kbn_ace
- Loading branch information
Showing
63 changed files
with
1,753 additions
and
125 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
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
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
115 changes: 115 additions & 0 deletions
115
x-pack/plugins/fleet/cypress/e2e/integrations_automatic_import.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,115 @@ | ||
/* | ||
* 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 { deleteIntegrations } from '../tasks/integrations'; | ||
import { | ||
UPLOAD_PACKAGE_LINK, | ||
ASSISTANT_BUTTON, | ||
TECH_PREVIEW_BADGE, | ||
CREATE_INTEGRATION_LANDING_PAGE, | ||
BUTTON_FOOTER_NEXT, | ||
INTEGRATION_TITLE_INPUT, | ||
INTEGRATION_DESCRIPTION_INPUT, | ||
DATASTREAM_TITLE_INPUT, | ||
DATASTREAM_DESCRIPTION_INPUT, | ||
DATASTREAM_NAME_INPUT, | ||
DATA_COLLECTION_METHOD_INPUT, | ||
LOGS_SAMPLE_FILE_PICKER, | ||
EDIT_PIPELINE_BUTTON, | ||
SAVE_PIPELINE_BUTTON, | ||
VIEW_INTEGRATION_BUTTON, | ||
INTEGRATION_SUCCESS_SECTION, | ||
SAVE_ZIP_BUTTON, | ||
} from '../screens/integrations_automatic_import'; | ||
import { cleanupAgentPolicies } from '../tasks/cleanup'; | ||
import { login, logout } from '../tasks/login'; | ||
import { createBedrockConnector, deleteConnectors } from '../tasks/api_calls/connectors'; | ||
import { | ||
ecsResultsForJson, | ||
categorizationResultsForJson, | ||
relatedResultsForJson, | ||
} from '../tasks/api_calls/graph_results'; | ||
|
||
describe('Add Integration - Automatic Import', () => { | ||
beforeEach(() => { | ||
login(); | ||
|
||
cleanupAgentPolicies(); | ||
deleteIntegrations(); | ||
|
||
// Create a mock connector | ||
deleteConnectors(); | ||
createBedrockConnector(); | ||
// Mock API Responses | ||
cy.intercept('POST', '/api/integration_assistant/ecs', { | ||
statusCode: 200, | ||
body: { | ||
results: ecsResultsForJson, | ||
}, | ||
}); | ||
cy.intercept('POST', '/api/integration_assistant/categorization', { | ||
statusCode: 200, | ||
body: { | ||
results: categorizationResultsForJson, | ||
}, | ||
}); | ||
cy.intercept('POST', '/api/integration_assistant/related', { | ||
statusCode: 200, | ||
body: { | ||
results: relatedResultsForJson, | ||
}, | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
deleteConnectors(); | ||
cleanupAgentPolicies(); | ||
deleteIntegrations(); | ||
logout(); | ||
}); | ||
|
||
it('should create an integration', () => { | ||
cy.visit(CREATE_INTEGRATION_LANDING_PAGE); | ||
|
||
cy.getBySel(ASSISTANT_BUTTON).should('exist'); | ||
cy.getBySel(UPLOAD_PACKAGE_LINK).should('exist'); | ||
cy.getBySel(TECH_PREVIEW_BADGE).should('exist'); | ||
|
||
// Create Integration Assistant Page | ||
cy.getBySel(ASSISTANT_BUTTON).click(); | ||
cy.getBySel(BUTTON_FOOTER_NEXT).click(); | ||
|
||
// Integration details Page | ||
cy.getBySel(INTEGRATION_TITLE_INPUT).type('Test Integration'); | ||
cy.getBySel(INTEGRATION_DESCRIPTION_INPUT).type('Test Integration Description'); | ||
cy.getBySel(BUTTON_FOOTER_NEXT).click(); | ||
|
||
// Datastream details page | ||
cy.getBySel(DATASTREAM_TITLE_INPUT).type('Audit'); | ||
cy.getBySel(DATASTREAM_DESCRIPTION_INPUT).type('Test Datastream Description'); | ||
cy.getBySel(DATASTREAM_NAME_INPUT).type('audit'); | ||
cy.getBySel(DATA_COLLECTION_METHOD_INPUT).type('file stream'); | ||
cy.get('body').click(0, 0); | ||
|
||
// Select sample logs file and Analyze logs | ||
cy.fixture('teleport.ndjson', null).as('myFixture'); | ||
cy.getBySel(LOGS_SAMPLE_FILE_PICKER).selectFile('@myFixture'); | ||
cy.getBySel(BUTTON_FOOTER_NEXT).click(); | ||
|
||
// Edit Pipeline | ||
cy.getBySel(EDIT_PIPELINE_BUTTON).click(); | ||
cy.getBySel(SAVE_PIPELINE_BUTTON).click(); | ||
|
||
// Deploy | ||
cy.getBySel(BUTTON_FOOTER_NEXT).click(); | ||
cy.getBySel(INTEGRATION_SUCCESS_SECTION).should('exist'); | ||
cy.getBySel(SAVE_ZIP_BUTTON).should('exist'); | ||
|
||
// View Integration | ||
cy.getBySel(VIEW_INTEGRATION_BUTTON).click(); | ||
}); | ||
}); |
Oops, something went wrong.