Skip to content

Commit

Permalink
[SIEM] Upgrades cypress to version 4.0.2 (elastic#58400)
Browse files Browse the repository at this point in the history
* upgrades cypress to version 4.0.2

* fixes failing tests
  • Loading branch information
MadameSheema committed Feb 25, 2020
1 parent 46da04c commit c2e4dda
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ describe('timeline search or filter KQL bar', () => {

cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.should('be.above', 0);
.then(strCount => {
const intCount = +strCount;
cy.wrap(intCount).should('be.above', 0);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ describe('url state', () => {

cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.should('be.above', 0);
.then(strCount => {
const intCount = +strCount;
cy.wrap(intCount).should('be.above', 0);
});

const bestTimelineName = 'The Best Timeline';
addNameToTimeline(bestTimelineName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
*/

import { AUTHENTICATIONS_TABLE } from '../../screens/hosts/authentications';
import { REFRESH_BUTTON } from '../../screens/siem_header';

export const waitForAuthenticationsToBeLoaded = () => {
cy.get(AUTHENTICATIONS_TABLE).should('exist');
cy.get(REFRESH_BUTTON)
.invoke('text')
.should('not.equal', 'Updating');
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
*/

import { UNCOMMON_PROCESSES_TABLE } from '../../screens/hosts/uncommon_processes';
import { REFRESH_BUTTON } from '../../screens/siem_header';

export const waitForUncommonProcessesToBeLoaded = () => {
cy.get(UNCOMMON_PROCESSES_TABLE).should('exist');
cy.get(REFRESH_BUTTON)
.invoke('text')
.should('not.equal', 'Updating');
};
5 changes: 4 additions & 1 deletion x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export const populateTimeline = () => {
executeTimelineKQL(hostExistsQuery);
cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.should('be.above', 0);
.then(strCount => {
const intCount = +strCount;
cy.wrap(intCount).should('be.above', 0);
});
};

export const uncheckTimestampToggleField = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

import { mount } from 'enzyme';
import React from 'react';

import { mockBrowserFields } from '../../containers/source/mock';
import { TestProviders } from '../../mock';
import { defaultHeaders } from '../timeline/body/column_headers/default_headers';

import { Header } from './header';

const timelineId = 'test';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"cheerio": "0.22.0",
"commander": "3.0.2",
"copy-webpack-plugin": "^5.0.4",
"cypress": "^3.6.1",
"cypress": "^4.0.2",
"cypress-multi-reporters": "^1.2.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
Expand Down

0 comments on commit c2e4dda

Please sign in to comment.