A clear and concise description of what the bug is.
Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
my init.js for jest circus
const detox = require("detox")
const adapter = require("detox/runners/jest/adapter")
const specReporter = require("detox/runners/jest/specReporter")
const assignReporter = require("detox/runners/jest/assignReporter")
const config = require("./config.json")
// Set the default timeout
jest.setTimeout(60000)
// console.log({dto: detoxCircus.getEnv()})
// eslint-disable-next-line
detoxCircus.getEnv().addEventsListener(adapter)
// eslint-disable-next-line
detoxCircus.getEnv().addEventsListener(specReporter)
// eslint-disable-next-line
detoxCircus.getEnv().addEventsListener(assignReporter)
beforeAll(async () => {
await detox.init({ config, launchApp: false })
await device.launchApp({
launchArgs: { detoxPrintBusyIdleResources: "YES" },
permissions: {
notifications: "YES",
camera: "YES",
medialibrary: "YES",
photos: "YES",
microphone: "YES"
}
})
}, 60000)
beforeEach(async () => {
await adapter.beforeEach()
})
afterAll(async () => {
await adapter.afterAll()
await detox.cleanup()
})
my init-jasmine.js
const detox = require("detox")
const adapter = require("detox/runners/jest/adapter")
const specReporter = require("detox/runners/jest/specReporter")
const assignReporter = require("detox/runners/jest/assignReporter")
const config = require("./config-jasmine.json")
// eslint-disable-next-line
jasmine.getEnv().addReporter(adapter)
// This takes care of generating status logs on a per-spec basis. By default, jest only reports at file-level.
// This is strictly optional.
// eslint-disable-next-line
jasmine.getEnv().addReporter(specReporter)
// This will post which device has assigned to run a suite, which can be useful in a multiple-worker tests run.
// This is strictly optional.
// eslint-disable-next-line
jasmine.getEnv().addReporter(assignReporter)
// Set the default timeout
jest.setTimeout(90000)
beforeAll(async () => {
console.log("DETOX init start")
await detox.init(config, { launchApp: false })
console.log("DETOX init end")
console.log("DETOX launchApp start")
await device.launchApp({
newInstance: true,
launchArgs: { detoxPrintBusyIdleResources: "YES" },
permissions: {
notifications: "YES",
camera: "YES",
medialibrary: "YES",
photos: "YES",
microphone: "YES"
}
})
console.log("DETOX launchApp end")
}, 30000)
beforeEach(async () => {
try {
await adapter.beforeEach()
} catch (err) {
await detox.cleanup()
throw err
}
})
afterAll(async () => {
await adapter.afterAll()
await detox.cleanup()
})
A clear and concise description of what you expected to happen.
I'm pretty sure your issue is that the config is inside the options object
await detox.init({ config, launchApp: false })
it should be
await detox.init(config, {launchApp: false })
@misoares thank you!! that fixed this.
Most helpful comment
I'm pretty sure your issue is that the config is inside the options object
await detox.init({ config, launchApp: false })it should be
await detox.init(config, {launchApp: false })