-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] Discuss trade offs Cypress's "force: true" provides #152470
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
@MadameSheema it needs your attention. |
Hey @maximpn!! Lots of thanks for starting a discussion on this!! This is my two cents on the subject: We should avoid using If I'm not mistaken, the use of the I'm in favor of auditing the places where we are using the Until the whole audit is not performed, I'll go for the first option. Please let me know what you think. Thanks! |
There is a small update related to the forced Cypress actions (aka Inability to avoid a forced typing in Cypress tests for persistent rules tables state to re-enable it led me to creation of the ticket #152344. The ticket was stuck for some time but the problem has been solved eventually in #158392 and it turned out to be some code added to fix EUI problem which was fixed by the EUI team eventually but the code wasn't removed. This way it helped to fund a problem and I believe getting rid of forced actions will help us to track any appearing quirks in the UI. I've created a PR to get rid of forced actions in Detection rules Cypress tests. On the other hand if it's impossible to avoid a forced action a comment should be left. |
…s tests (#158560) **Relates to:** #152344, #152470 **Depends on:** #158392 ## Summary Removes `force` option from Cypress actions like `type()`, `click()` and etc. It helps to catch UI quirks instead of silently ignoring them. ## Details After merging back of #158392 it's possible to remove `force: true` flag from the Cypress actions used in Detection rules tests. Based on the discussion in #152470 it's bette to avoid forced actions and leave a comment if there is no other way than forcing an action.
As the result of discussion the docs were updated by #158705. Closing this ticket. |
Relates to: #151244
Description
While looking through our Cypress tests one can see usage of
{ force: true }
option. It's passed to some Cypress actions likeclick
,type
and etc. You can find it here or here (just two random places). This approach doesn't look consistent.Forcing a Cypress action allows to avoid some checks before interacting with an element. Engineers tend to use it to reduce tests sensitivity or to just to make a test working. While forcing an action may look like a good idea it could lead to missing or even intentionally ignoring some UI bugs so the number will accumulate. For example recent EUI upgrade to
v75.0.0
revealed UI problems which caused our tests failing. Forced typing would let the tests pass but we wouldn't know about the problem anything.Taking the above into account to consider the following strategies (feel free to suggest more):
{ force: true }
for Cypress actions, every usage require an explanation comment so we tend to remove them later when an UI bug is fixed or to keep them in some exceptional cases{ force: true }
by default everywhere{ force: true }
is neededThe text was updated successfully, but these errors were encountered: