Detox: Detox fails to run tests with jest(with both new and old implementations)
Description
Was trying different ways but can’t get it to work. Wondering if it’s an issue on my side(most likely) or there is some incompatibility with newer versions.
It might be related to this issue #330 as I recently installed new Xcode 9.
e2e.setup.js
const detox = require('detox');
const config = require('./package.json').detox;
// Set the default timeout
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;
beforeAll(async () => {
await detox.init(config, {launchApp: true});
});
afterAll(async () => {
await detox.cleanup();
});
jest.config-e2e.json
{
"preset": "react-native",
"testMatch": ["**/app/__tests__/e2e/specs/?(*.)(spec|test).js?(x)"],
"setupTestFrameworkScriptFile": "./e2e.setup.js"
}
package.json
"detox": {
"runner": "jest",
"specs": "./app/__tests__/e2e/specs/",
"configurations": {
"ios.sim.debug": {
"binaryPath":
"ios/build/Build/Products/Debug-iphonesimulator/appname.app",
"build":
"xcodebuild -workspace ios/appname.xcworkspace -configuration Debug -scheme appscheme -sdk iphonesimulator -derivedDataPath build",
"type": "ios.simulator",
"name": "iPhone 7"
}
}
}
Detox, Node, Device, Xcode and macOS Versions
- Detox: 5.9.2
- Node: v8.7.0
- Device: Iphone 7
- Xcode: 9
- macOS: Sierra v.10.12.6
- React-native: 0.49.3
- React: 16.0.0
Device and verbose Detox logs
When running jest directly with detox build && jest --verbose --runInBand --forceExit -c ./jest.config-e2e.json
, it hangs on “Searching for device”.
** BUILD SUCCEEDED **
server listening on localhost:52384...
: Searching for device matching iPhone 7...
RUNS app/__tests__/e2e/specs/eventsSection.test.js
After making the updates specified in https://github.com/wix/detox/blob/master/docs/Guide.Jest.md. Running detox build && detox test
:
ReferenceError: element/device is not defined // with
Cannot determine which configuration to use. use --configuration to choose one of the following:
ios.sim.debug
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 16 (8 by maintainers)
@aamorozov I get the same issue when running ios e2e tests with jest on the example project.