Skip to content

Commit

Permalink
[Cases] Fix flaky tests in the create case form (#145211)
Browse files Browse the repository at this point in the history
## Summary

This PR fixes a number of issues with the same error:
`TestingLibraryElementError: Unable to find an element by:
[data-test-subj="caseTitle"]`. The PR:

- Clears unnecessary `act`
- Wait for the form to render before trying to fill the form
- Wait for the component to update all states to eliminate warnings
- Fill tags when necessary to improve tests execution time
- Replace `userEvent.type` with `userEvent.aste` when possible to
improve execution time
- Add `skipPointerEventsCheck: true` when necessary

I run the test file 100 times locally without any errors.

Fixes: #142287,
#142288,
#142285,
#142286,
#142284,
#142283,
#142282,
#142281,
#143407,
#143406,
#143405,
#143408,
#143403

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
cnasikas authored Nov 16, 2022
1 parent eb21f17 commit 6936644
Showing 1 changed file with 214 additions and 247 deletions.
Loading

0 comments on commit 6936644

Please sign in to comment.