Skip to content

Commit

Permalink
[8.6] [Security Solution] Refactors All exception lists - read only
Browse files Browse the repository at this point in the history
… tests to remove flakiness (#146677) (#146708)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Security Solution] Refactors `All exception lists - read only` tests
to remove flakiness
(#146677)](#146677)

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

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

<!--BACKPORT [{"author":{"name":"Gloria
Hornero","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-30T15:41:44Z","message":"[Security
Solution] Refactors `All exception lists - read only` tests to remove
flakiness (#146677)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"8a6cc0cd26425afa67a448ffadc4de15f82d208d","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team:Security Solution
Platform","v8.6.0","v8.7.0"],"number":146677,"url":"https://github.com/elastic/kibana/pull/146677","mergeCommit":{"message":"[Security
Solution] Refactors `All exception lists - read only` tests to remove
flakiness (#146677)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"8a6cc0cd26425afa67a448ffadc4de15f82d208d"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146677","number":146677,"mergeCommit":{"message":"[Security
Solution] Refactors `All exception lists - read only` tests to remove
flakiness (#146677)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"8a6cc0cd26425afa67a448ffadc4de15f82d208d"}}]}]
BACKPORT-->

Co-authored-by: Gloria Hornero <[email protected]>
  • Loading branch information
kibanamachine and MadameSheema authored Nov 30, 2022
1 parent 5351c0a commit 262f09c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,35 @@
* 2.0.
*/

import { cleanKibana } from '../../../tasks/common';
import { ROLES } from '../../../../common/test';
import { getExceptionList } from '../../../objects/exception';
import { EXCEPTIONS_TABLE_SHOWING_LISTS } from '../../../screens/exceptions';
import { createExceptionList } from '../../../tasks/api_calls/exceptions';
import { createExceptionList, deleteExceptionList } from '../../../tasks/api_calls/exceptions';
import {
dismissCallOut,
getCallOut,
waitForCallOutToBeShown,
} from '../../../tasks/common/callouts';
import { esArchiverResetKibana } from '../../../tasks/es_archiver';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { EXCEPTIONS_URL } from '../../../urls/navigation';

const MISSING_PRIVILEGES_CALLOUT = 'missing-user-privileges';

describe('All exception lists - read only', () => {
before(() => {
esArchiverResetKibana();
cleanKibana();
});

beforeEach(() => {
deleteExceptionList(getExceptionList().list_id, getExceptionList().namespace_type);

// Create exception list not used by any rules
createExceptionList(getExceptionList(), getExceptionList().list_id);

login(ROLES.reader);
visitWithoutDateRange(EXCEPTIONS_URL, ROLES.reader);

cy.reload();

// Using cy.contains because we do not care about the exact text,
// just checking number of lists shown
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '1');
Expand Down

0 comments on commit 262f09c

Please sign in to comment.