Gray box end-to-end testing and automation framework for mobile apps

Kalinin Dmitry
2 min readSep 22, 2020

--

High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it’s running in a real device/simulator, interacting with it just like a real user.

The most difficult part of automated testing on mobile is the tip of the testing pyramid — E2E. The core problem with E2E tests is flakiness — tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. That’s where Detox comes into play.

  • Cross Platform: Write cross-platform tests in JavaScript. Currently supports iOS and Android.
  • Runs on Devices (not yet supported on iOS): Gain confidence to ship by testing your app on a device/simulator just like a real user.
  • Automatically Synchronized: Stops flakiness at the core by monitoring asynchronous operations in your app.
  • Made For CI: Execute your E2E tests on CI platforms like Travis without grief.
  • Test Runner Independent: Use Jest, Mocha, AVA, or any other JavaScript test runner you like (spoiler: we have our favourite).
  • Debuggable: Modern async-await API allows breakpoints in asynchronous tests to work as expected.

This is a test for a login screen, it runs on a device/simulator like an actual user:

describe('Login flow', () => {

it('should login successfully', async () => {
await device.reloadReactNative();

await element(by.id('email')).typeText('john@example.com');
await element(by.id('password')).typeText('123456');
await element(by.text('Login')).tap();

await expect(element(by.text('Welcome'))).toBeVisible();
await expect(element(by.id('email'))).toNotExist();
});

});

--

--

Kalinin Dmitry
Kalinin Dmitry

Written by Kalinin Dmitry

Engineer. Constructivist. Lean manufacturing. Blockchain Enthusiast. IoT Enthusiast. https://github.com/null-none https://www.linkedin.com/in/kal1sha/

No responses yet