2022-09-12 14:51:33 +00:00
|
|
|
import detox from 'detox';
|
|
|
|
import adapter from 'detox/runners/mocha/adapter';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
2022-09-12 14:51:33 +00:00
|
|
|
import { detox as config } from '../../package.json';
|
|
|
|
import { setup } from '../helpers/data_setup';
|
|
|
|
import { prepareAndroid } from '../helpers/app';
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2022-09-12 14:51:33 +00:00
|
|
|
// @ts-ignore
|
2021-07-02 17:39:39 +00:00
|
|
|
await Promise.all([setup(), detox.init(config, { launchApp: false })]);
|
2021-12-02 13:19:15 +00:00
|
|
|
await prepareAndroid(); // Make Android less flaky
|
2021-07-02 17:39:39 +00:00
|
|
|
// await dataSetup()
|
|
|
|
// await detox.init(config, { launchApp: false });
|
|
|
|
// await device.launchApp({ permissions: { notifications: 'YES' } });
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
beforeEach(async function () {
|
2022-09-12 14:51:33 +00:00
|
|
|
// @ts-ignore
|
2020-07-22 16:32:21 +00:00
|
|
|
await adapter.beforeEach(this);
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
afterEach(async function () {
|
2022-09-12 14:51:33 +00:00
|
|
|
// @ts-ignore
|
2020-07-22 16:32:21 +00:00
|
|
|
await adapter.afterEach(this);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
after(async () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
await detox.cleanup();
|
|
|
|
});
|