[8.8] [Security Solution][Investigations] - remove flaky cypress test (#156258) (#156289)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Security Solution][Investigations] - remove flaky cypress test
(#156258)](https://github.com/elastic/kibana/pull/156258)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2023-05-01T17:54:04Z","message":"[Security
Solution][Investigations] - remove flaky cypress test (#156258)\n\nThis
PR removes a flaky test which fails when trying to visit a
url.\r\nFurther investigation is needed to determine why the test
sometimes\r\nvisits the login screen when trying to visit the given url,
but for the\r\ntime being should be removed to unblock future
PRs.","sha":"a8269ea7bd34dbf29fad591c58d6f318e8d73cde","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","v8.8.0","v8.9.0"],"number":156258,"url":"https://github.com/elastic/kibana/pull/156258","mergeCommit":{"message":"[Security
Solution][Investigations] - remove flaky cypress test (#156258)\n\nThis
PR removes a flaky test which fails when trying to visit a
url.\r\nFurther investigation is needed to determine why the test
sometimes\r\nvisits the login screen when trying to visit the given url,
but for the\r\ntime being should be removed to unblock future
PRs.","sha":"a8269ea7bd34dbf29fad591c58d6f318e8d73cde"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156258","number":156258,"mergeCommit":{"message":"[Security
Solution][Investigations] - remove flaky cypress test (#156258)\n\nThis
PR removes a flaky test which fails when trying to visit a
url.\r\nFurther investigation is needed to determine why the test
sometimes\r\nvisits the login screen when trying to visit the given url,
but for the\r\ntime being should be removed to unblock future
PRs.","sha":"a8269ea7bd34dbf29fad591c58d6f318e8d73cde"}}]}] BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
This commit is contained in:
Kibana Machine 2023-05-01 15:54:32 -04:00 committed by GitHub
parent ccc95b57c0
commit f2ada86485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 29 deletions

View file

@ -24,7 +24,6 @@ import { login, visit, visitWithoutDateRange } from '../../tasks/login';
import { getUnmappedRule } from '../../objects/rule';
import { ALERTS_URL } from '../../urls/navigation';
import { tablePageSelector } from '../../screens/table_pagination';
import { ALERTS_COUNT } from '../../screens/alerts';
describe('Alert details flyout', () => {
describe('With unmapped fields', { testIsolation: false }, () => {
@ -96,59 +95,40 @@ describe('Alert details flyout', () => {
login();
visit(ALERTS_URL);
waitForAlertsToPopulate();
});
beforeEach(() => {
expandFirstAlert();
});
it('should store the flyout state in the url when it is opened', () => {
expandFirstAlert();
cy.get(OVERVIEW_RULE).should('be.visible');
cy.url().should('include', 'eventFlyout=');
});
it('should remove the flyout state from the url when it is closed', () => {
expandFirstAlert();
cy.get(OVERVIEW_RULE).should('be.visible');
closeAlertFlyout();
cy.url().should('not.include', 'eventFlyout=');
});
it('should open the alert flyout when the page is refreshed', () => {
expandFirstAlert();
cy.get(OVERVIEW_RULE).should('be.visible');
cy.reload();
cy.get(OVERVIEW_RULE).should('be.visible');
cy.get(OVERVIEW_RULE).then((field) => {
expect(field).to.contain('Endpoint Security');
});
cy.get(OVERVIEW_RULE).should('contain', 'Endpoint Security');
});
it('should show the copy link button for the flyout', () => {
expandFirstAlert();
cy.get(COPY_ALERT_FLYOUT_LINK).should('be.visible');
});
it('should open the flyout given the custom url', () => {
expandFirstAlert();
openTable();
filterBy('_id');
cy.get('[data-test-subj="event-field-_id"]')
.invoke('text')
.then((alertId) => {
cy.visit(`http://localhost:5620/app/security/alerts/redirect/${alertId}`);
cy.get('[data-test-subj="unifiedQueryInput"]').should('have.text', `_id: ${alertId}`);
cy.get(ALERTS_COUNT).should('have.text', '1 alert');
cy.get(OVERVIEW_RULE).should('be.visible');
});
});
it('should have the `kibana.alert.url` field set', () => {
expandFirstAlert();
const alertUrl =
'http://localhost:5601/app/security/alerts/redirect/eabbdefc23da981f2b74ab58b82622a97bb9878caa11bc914e2adfacc94780f1?index=.alerts-security.alerts-default&timestamp=2023-04-27T11:03:57.906Z';
openTable();
filterBy('kibana.alert.url');
cy.get('[data-test-subj="formatted-field-kibana.alert.url"]').should(
'have.text',
'http://localhost:5601/app/security/alerts/redirect/eabbdefc23da981f2b74ab58b82622a97bb9878caa11bc914e2adfacc94780f1?index=.alerts-security.alerts-default&timestamp=2023-04-27T11:03:57.906Z'
);
cy.get('[data-test-subj="formatted-field-kibana.alert.url"]').should('have.text', alertUrl);
});
});
});

View file

@ -67,7 +67,8 @@ describe('Isolate command', () => {
beforeEach(() => {
login();
});
it('should allow filtering endpoint by Isolated status', () => {
// FLAKY: https://github.com/elastic/security-team/issues/6518
it.skip('should allow filtering endpoint by Isolated status', () => {
cy.visit(APP_PATH + getEndpointListPath({ name: 'endpointList' }));
closeAllToasts();
filterOutIsolatedHosts();

View file

@ -150,7 +150,7 @@ describe('Response actions', () => {
cleanupRule(ruleId);
});
// flaky
// FLAKY: https://github.com/elastic/security-team/issues/6518
it.skip('All response action controls are disabled', () => {
visitRuleActions(ruleId);
cy.getByTestSubj('response-actions-wrapper').within(() => {