google / EarlGrey

:tea: iOS UI Automation Test Framework
http://google.github.io/EarlGrey/
Apache License 2.0
5.62k stars 744 forks source link

Take screenshots by always passing `afterScreenUpdates:YES`. #1982

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Take screenshots by always passing afterScreenUpdates:YES.

Motivation: a lot of tests use [GREYScreenshotter snapshotElement] method to take screenshots which currently uses afterScreenUpdates:NO. This means that changes done in the current run loop iteration won't be visible in the screenshot. This can cause flakiness and it's better to always use afterScreenUpdates:YES to get the most accurate current UI state.