Do not assert inside VerifyAccessibilityForCurrentScreen |
|||
Issue descriptionGREYAssert macro prints a line number which help to diagnose test failures. This is very useful and allows to debug tests just by looking into logs. However GREYAssert is only useful when called inside the test, and not from the test helper. Test helpers can be called inside the test multiple times, and line number printed by GREYAssert will be the same for each helper call. A better approach will be to return bool from the helper and call GREYAssert inside the test.
,
Dec 21
In the migration to the AXE util for replacing our accessibility_utility I got the feedback that asserting in the utility was the right thing to do. See https://chromium-review.googlesource.com/c/chromium/src/+/1291570/9/ios/chrome/test/earl_grey/accessibility_util.mm#118 I'll close this as wontfix, but please feel free to lmk if there are any other questions.
,
Jan 2
I believe the feedback on that CL means that NSLog is useless because NSLog does not fail the test. GREYAssert fails the test. Feedback advocates for failing the test, but GREYAssert does not have to be used inside test helper. As described in the bug, GREYAssert prints a line number which help to diagnose test failures. It is useful if line number belongs to the test, so it is clear from the log where the test has failed. This bug is a special case of crbug.com/787183 |
|||
►
Sign in to add a comment |
|||
Comment 1 by sczs@chromium.org
, Aug 22Owner: linds...@chromium.org
Status: Assigned (was: Untriaged)