WhoBuilt

Introducing E2E tests to React Native core

Aug 24, 2023· 37 min· 1.4K views·Watch on YouTube

Speakers

Mateusz, Callstack’s quality assurance team leader, and Szymon Włodarczyk, a Callstack open-source expert, discuss React Native core’s new end-to-end tests with the host on Callstack’s React Native Show podcast.

Why add end-to-end tests

The team added end-to-end tests to RNTester, React Native’s showcase app, to automate checks that release crew members and contributors previously performed by building apps and clicking through them manually. The discussion describes testing two apps across eight configurations, including the old and new architectures and Hermes and JavaScriptCore. Automation lets the team rerun checks after a bug is found instead of repeating hours of manual testing.

What the first phase covers

The initial framework runs in CircleCI on Android and iOS, with one component test at the time of recording. The plan is to add tests for critical positive and negative paths across the app. The guests stress that RNTester can check components in isolation, but teams still need to test how components behave when wrapped or combined in their own apps.

How the testing setup works

The team created an `rn-tester-e2e` package and chose Appium with WebdriverIO, using JavaScript tests that run with Jest. The approach treats the app as a black box, so the same tests can run against different React Native configurations without changing application code. Tests build the app and run on emulators or simulators for each commit and pull request; device support was planned for later.

Tradeoffs and next steps

The guests identify test maintenance as a cost: visual changes may require test updates, and failures need investigation. They planned to expand test coverage, support connected real devices and device farms, and explore sequential and screen testing. Detox was ruled out because the team needed physical iOS device and device farm support; Maestro was ruled out because it lacked desktop and device farm support at the time, and used YAML tests.

Takeaways

  • Automating repetitive release checks can reduce rerun effort when a defect is found.
  • A black-box test suite can be reused across multiple runtime and architecture configurations.
  • Component tests in a showcase app do not replace testing components in the context of a product’s own app.
  • Budget for maintaining tests and investigating failures alongside writing them.
  • Choose an end-to-end testing tool against required platforms and device access, not only ease of authoring.

Mentioned in this talk

Search inside this talk

What was claimed 13

Show all 13 facts

Related talks