Skip to content

Commit

Permalink
[Security Solution] Fix Overview cypress tests (#82761)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski authored Nov 5, 2020
1 parent 250fe67 commit 9bff56d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { OVERVIEW_URL } from '../urls/navigation';

describe('Overview Page', () => {
it('Host stats render with correct values', () => {
cy.stubSearchStrategyApi('overviewHostQuery', 'overview_search_strategy');
cy.stubSearchStrategyApi('overview_search_strategy');
loginAndWaitForPage(OVERVIEW_URL);
expandHostStats();

Expand All @@ -23,7 +23,7 @@ describe('Overview Page', () => {
});

it('Network stats render with correct values', () => {
cy.stubSearchStrategyApi('overviewNetworkQuery', 'overview_search_strategy');
cy.stubSearchStrategyApi('overview_search_strategy');
loginAndWaitForPage(OVERVIEW_URL);
expandNetworkStats();

Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/security_solution/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Cypress.Commands.add('stubSecurityApi', function (dataFileName) {
});

Cypress.Commands.add('stubSearchStrategyApi', function (
queryId,
dataFileName,
searchStrategyName = 'securitySolutionSearchStrategy'
) {
Expand All @@ -49,7 +48,7 @@ Cypress.Commands.add('stubSearchStrategyApi', function (
});
cy.server();
cy.fixture(dataFileName).as(`${dataFileName}JSON`);
cy.route('POST', `internal/search/${searchStrategyName}/${queryId}`, `@${dataFileName}JSON`);
cy.route('POST', `internal/search/${searchStrategyName}`, `@${dataFileName}JSON`);
});

Cypress.Commands.add(
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/security_solution/cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ declare namespace Cypress {
interface Chainable<Subject> {
promisify(): Promise<Subject>;
stubSecurityApi(dataFileName: string): Chainable<Subject>;
stubSearchStrategyApi(
queryId: string,
dataFileName: string,
searchStrategyName?: string
): Chainable<Subject>;
stubSearchStrategyApi(dataFileName: string, searchStrategyName?: string): Chainable<Subject>;
attachFile(fileName: string, fileType?: string): Chainable<JQuery>;
waitUntil(
fn: (subject: Subject) => boolean | Chainable<boolean>,
Expand Down

0 comments on commit 9bff56d

Please sign in to comment.