mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
14fcda880c
Summary: This test has been failing internally because it attempts to access external images during CI execution, which it is blocked from doing. Because Detox synchronizes with the app to make sure network requests and animations are complete before continuing, the test waits indefinitely for these images to be fetched. This diff makes the following changes * External images are replaced with fb-hosted images * Timeout threshold is reduced * Detox initialization is broken out into two steps to help debug any future instances of this occurring * If Detox is blocked for over 20 seconds, diagnostic messages will be printed indicating why it's being blocked Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D19671592 fbshipit-source-id: 368c683101ed7fc68578fc7758061b31c96c241d
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
/* eslint-env jasmine */
|
|
/* global device */
|
|
|
|
const detox = require('detox');
|
|
const config = require('../../package.json').detox;
|
|
const adapter = require('detox/runners/jest/adapter');
|
|
jest.setTimeout(120000);
|
|
jasmine.getEnv().addReporter(adapter);
|
|
|
|
beforeAll(async () => {
|
|
await detox.init(config, {launchApp: false});
|
|
await device.launchApp({
|
|
launchArgs: {
|
|
newInstance: true,
|
|
// see https://github.com/wix/Detox/blob/master/docs/Troubleshooting.Synchronization.md
|
|
// and uncomment below if app fails to launch
|
|
// detoxPrintBusyIdleResources: 'YES',
|
|
},
|
|
permissions: {
|
|
notifications: 'YES',
|
|
camera: 'YES',
|
|
medialibrary: 'YES',
|
|
photos: 'YES',
|
|
microphone: 'YES',
|
|
},
|
|
});
|
|
});
|
|
|
|
beforeEach(async function() {
|
|
await adapter.beforeEach();
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await adapter.afterAll();
|
|
await detox.cleanup();
|
|
});
|
|
|
|
process.on('unhandledRejection', (reason, p) => {
|
|
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
|
});
|