teammates icon indicating copy to clipboard operation
teammates copied to clipboard

Nonspecific error messages on E2E tests

Open domoberzin opened this issue 2 years ago • 1 comments

  • Environment: master

Steps to reproduce Modify any parameter of any verifyStatusMessage method call such that the expected message will differ from the actual status message in the toast in a specific E2E test.

Before modification: image After modification: image

Expected behaviour Test fails with an error relating to the failed assertion between expected and actual message.

Actual behaviour Test freezes and fails with some permutation of this error: org.gradle.internal.serialize.PlaceholderException: Expected condition failed: waiting for presence of element located by: By.className: toast-body (tried for 25 second(s) with 500 milliseconds interval)

Example error in this test run

Additional info

domoberzin avatar Jul 13 '23 12:07 domoberzin

This is not as simple as it sounds.

The nature of the verification is different: this is waiting for some event to happen, in this case for a toast with specified message to appear. Consider this scenario:

  • Toast with the modified message appears in page
  • Verification fails; wait for the specified timeout
  • Another toast with totally unrelated message appears in page
  • Verification fails

The suggested expected behaviour will compare the unrelated message, which is hardly any better. Granted that the chance of toast with unrelated message appearing is low, but it should show why it is not as simple as "show expected vs actual message".

wkurniawan07 avatar Jul 16 '23 08:07 wkurniawan07