Skip to content

RNTesterSnapshotTests: Fix testScrollViewExample flakiness #23539

@hramos

Description

@hramos

Help Wanted: Fix ScrollViewExample flakiness

As part of the RNTesterSnapshotTests, the RNTester ScrollViewExample is loaded and a screenshot is saved. The snapshot test is flaky as the Facebook thumbs images might not load before the screenshot is taken. This is therefore recorded as a failing snapshot test.

Comparison: blank snapshot on the left, and proper snapshot on the right.
testscrollviewexample_1-ios12 2x

The test is defined in JavaScript at RNTester/js/ScrollViewExample.js, and is invoked by RNTesterSnapshotTests.m in RNTester/RNTester.xcodeproj.

Potential solutions include delaying the recording of the snapshot long enough for images to have loaded, or simply replacing the images from ScrollViewExample with something else.

Steps to reproduce:

  1. Run yarn at the repository root.
  2. Open RNTester/RNTester.xcodeproj on Xcode 10.1.0.
  3. Build RNTester.
  4. Run tests (CMD+U) on an iPhone 6s simulator.

You can generate a new snapshot for comparison by editing RNTesterSnapshotTests.m and setting record mode to on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions