Detox: E2E Testing in React Native

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.

Here’s a sample test for a login screen:

describe('Login flow', () => {
  it('should login successfully', async () => {
    await device.reloadReactNative();
    await expect(element('email'))).toBeVisible();
    await element('email')).typeText('[email protected]');
    await element('password')).typeText('123456');
    await element(by.label('Login')).tap();
    await expect(element(by.label('Welcome'))).toBeVisible();
    await expect(element('email'))).toNotExist();

wix/detox (GitHub) →
Testing in React Native — Jest & Detox →

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.