New issue
Advanced search Search tips

Issue 876573 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task

Blocking:
issue 787183



Sign in to add a comment

Do not assert inside VerifyAccessibilityForCurrentScreen

Project Member Reported by eugene...@chromium.org, Aug 22

Issue description

GREYAssert 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. 
 
Cc: -linds...@chromium.org
Owner: linds...@chromium.org
Status: Assigned (was: Untriaged)
lindsayw@ could you PTAL?
Status: WontFix (was: Assigned)
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.
Blocking: 787183
Cc: linds...@chromium.org
Owner: ----
Status: Available (was: WontFix)
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