[8.8] Attempt to make Cases FTR tests less fragile (#156972) (#156983)

# Backport

This will backport the following commits from `main` to `8.8`:
- [Attempt to make Cases FTR tests less fragile
(#156972)](https://github.com/elastic/kibana/pull/156972)

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

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

<!--BACKPORT [{"author":{"name":"Coen
Warmer","email":"coen.warmer@gmail.com"},"sourceCommit":{"committedDate":"2023-05-08T12:28:00Z","message":"Attempt
to make Cases FTR tests less fragile
(#156972)","sha":"6ad8c42d58a30e8188776bf56479124e7941f569","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.8.0","v8.9.0"],"number":156972,"url":"https://github.com/elastic/kibana/pull/156972","mergeCommit":{"message":"Attempt
to make Cases FTR tests less fragile
(#156972)","sha":"6ad8c42d58a30e8188776bf56479124e7941f569"}},"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/156972","number":156972,"mergeCommit":{"message":"Attempt
to make Cases FTR tests less fragile
(#156972)","sha":"6ad8c42d58a30e8188776bf56479124e7941f569"}}]}]
BACKPORT-->

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
This commit is contained in:
Kibana Machine 2023-05-08 09:29:00 -04:00 committed by GitHub
parent 783c33dd01
commit 5b0052ed9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,10 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
});
it('renders case options in the overflow menu', async () => {
await observability.alerts.common.openActionsMenuForRow(0);
await retry.try(async () => {
await observability.alerts.common.openActionsMenuForRow(0);
});
await retry.try(async () => {
await observability.alerts.addToCase.getAddToExistingCaseSelectorOrFail();
await observability.alerts.addToCase.getAddToNewCaseSelectorOrFail();
@ -59,7 +62,9 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
});
it('opens a modal when Add to existing case is clicked', async () => {
await observability.alerts.common.openActionsMenuForRow(0);
await retry.try(async () => {
await observability.alerts.common.openActionsMenuForRow(0);
});
await retry.try(async () => {
await observability.alerts.addToCase.addToExistingCaseButtonClick();
@ -84,7 +89,9 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
});
it('does not render case options in the overflow menu', async () => {
await observability.alerts.common.openActionsMenuForRow(0);
await retry.try(async () => {
await observability.alerts.common.openActionsMenuForRow(0);
});
await retry.try(async () => {
await observability.alerts.addToCase.missingAddToExistingCaseSelectorOrFail();
await observability.alerts.addToCase.missingAddToNewCaseSelectorOrFail();