detox 20.0.2-breaking.new-global-lifecycle.0 → 20.0.3-breaking.new-global-lifecycle.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.aar} +0 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.md5 → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.aar.md5} +0 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha1 → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.aar.sha1} +0 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha256 → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.aar.sha256} +0 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha512 → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.aar.sha512} +0 -0
- package/Detox-android/com/wix/detox/{20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom → 20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.pom} +1 -1
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.3-breaking.new-global-lifecycle.0/detox-20.0.3-breaking.new-global-lifecycle.0.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/internals.d.ts +13 -8
- package/local-cli/build.js +1 -1
- package/local-cli/build.test.js +14 -14
- package/local-cli/test.js +3 -3
- package/local-cli/test.test.js +1 -1
- package/package.json +2 -2
- package/runners/jest/testEnvironment/index.js +1 -1
- package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +2 -2
- package/runners/jest/testEnvironment/listeners/SpecReporter.js +1 -1
- package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +1 -1
- package/src/DetoxWorker.js +7 -1
- package/src/configuration/composeRunnerConfig.js +48 -1
- package/src/configuration/index.js +9 -8
- package/src/errors/DetoxConfigErrorComposer.js +4 -2
- package/src/realms/DetoxContext.js +1 -1
- package/src/realms/DetoxPrimaryContext.js +8 -3
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.sha512 +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
c6493b7e10e165c7c6e7f0b4cf9d100c
|
@@ -0,0 +1 @@
|
|
1
|
+
6afd03fe5e86a8a04e4caf452772e710d2943deb
|
@@ -0,0 +1 @@
|
|
1
|
+
1fd68b232ab5d4668575c8d666cacb5c8ab02e50f7aed50d8d53d36d2c669eee
|
@@ -0,0 +1 @@
|
|
1
|
+
3b59f3522d88982355734b5a6d74add724fdd37b569bfc4fb07a8a1f954aab82e054bb5348833b9c156479af8440af6aabb4c2f0f684ff10afe7ca330d2a17a1
|
@@ -0,0 +1 @@
|
|
1
|
+
692bae402dc4d4f29b815943905eb9e7
|
@@ -0,0 +1 @@
|
|
1
|
+
130eba535610edf748a958abcddf5b2551b371a6
|
@@ -0,0 +1 @@
|
|
1
|
+
3ab48363cf0d353f3013e0a1157a8f1781e3ef91f86929c321c885aba8f0af52
|
@@ -0,0 +1 @@
|
|
1
|
+
b5034dce6f23e5356cc635d35c511314c074f1a4b01ae5cf15663f00d9b27711add721b3a9e9b318bacae16209e8474ccf3fd29533f4e591353169da7ad6c2c5
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<modelVersion>4.0.0</modelVersion>
|
4
4
|
<groupId>com.wix</groupId>
|
5
5
|
<artifactId>detox</artifactId>
|
6
|
-
<version>20.0.
|
6
|
+
<version>20.0.3-breaking.new-global-lifecycle.0</version>
|
7
7
|
<packaging>aar</packaging>
|
8
8
|
<name>Detox</name>
|
9
9
|
<description>Gray box end-to-end testing and automation library for mobile apps</description>
|
@@ -0,0 +1 @@
|
|
1
|
+
1576eed74ead432e6108c03493a6873c
|
@@ -0,0 +1 @@
|
|
1
|
+
092446317977f5dc4261d559e9608932254f5e3b
|
@@ -0,0 +1 @@
|
|
1
|
+
f05c7aab6a3e42433c2934f4b7617441cce2d9c1879319cd5999b765cce8d968
|
@@ -0,0 +1 @@
|
|
1
|
+
1c0756ed5dd13915de4625248beffb25c78fdf56635b54b65df36c61116ae860a66bc421e14641630d165b1cc630f51a225221dbd8789214d108bc531eb51ef7
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<groupId>com.wix</groupId>
|
4
4
|
<artifactId>detox</artifactId>
|
5
5
|
<versioning>
|
6
|
-
<latest>20.0.
|
7
|
-
<release>20.0.
|
6
|
+
<latest>20.0.3-breaking.new-global-lifecycle.0</latest>
|
7
|
+
<release>20.0.3-breaking.new-global-lifecycle.0</release>
|
8
8
|
<versions>
|
9
|
-
<version>20.0.
|
9
|
+
<version>20.0.3-breaking.new-global-lifecycle.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20220815091331</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2ef77b80bf45d2428c511a0c5723661e
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
a0dbdca1e65a0410798600e9b701a189b1831aac
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ef9c05cfe345d3f50b63c73a2207a80d0a417bb2288059f987285188457c41eb
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
495f7993e651cf04a0cc907638214236249c2944faec87b77795d0eb923a602b414c550dbe0d82ad3555d1b7f55a62671bcdf81e5169f1f23a8fecd53f1f5cca
|
package/Detox-ios-src.tbz
CHANGED
Binary file
|
package/Detox-ios.tbz
CHANGED
Binary file
|
package/internals.d.ts
CHANGED
@@ -87,14 +87,19 @@ declare global {
|
|
87
87
|
type RuntimeConfig = Readonly<{
|
88
88
|
configurationName: string;
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
/**
|
91
|
+
* Dictionary of app configurations,
|
92
|
+
* where the keys are defined by {@link Detox.DetoxAppConfig#name}
|
93
|
+
* or equal to "default" if the name is not configured.
|
94
|
+
*/
|
95
|
+
apps: Record<string, Readonly<Detox.DetoxAppConfig>>;
|
96
|
+
artifacts: Readonly<Detox.DetoxArtifactsConfig>;
|
97
|
+
behavior: Readonly<Detox.DetoxBehaviorConfig>;
|
98
|
+
cli: Readonly<DetoxCLIConfig>;
|
99
|
+
device: Readonly<Detox.DetoxDeviceConfig>;
|
100
|
+
logger: Readonly<Detox.DetoxLoggerConfig>;
|
101
|
+
testRunner: Readonly<Detox.DetoxTestRunnerConfig>;
|
102
|
+
session: Readonly<Detox.DetoxSessionConfig>;
|
98
103
|
}>;
|
99
104
|
|
100
105
|
type DetoxCLIConfig = Readonly<Partial<{
|
package/local-cli/build.js
CHANGED
@@ -37,7 +37,7 @@ module.exports.builder = {
|
|
37
37
|
};
|
38
38
|
|
39
39
|
module.exports.handler = async function build(argv) {
|
40
|
-
const { appsConfig, errorComposer } = await detox.resolveConfig({ argv });
|
40
|
+
const { apps: appsConfig, errorComposer } = await detox.resolveConfig({ argv });
|
41
41
|
const apps = _.entries(appsConfig);
|
42
42
|
|
43
43
|
for (const [appName, app] of apps) {
|
package/local-cli/build.test.js
CHANGED
@@ -14,12 +14,12 @@ describe('build', () => {
|
|
14
14
|
const DetoxConfigErrorComposer = require('../src/errors/DetoxConfigErrorComposer');
|
15
15
|
|
16
16
|
const config = {
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
apps: {},
|
18
|
+
artifacts: {},
|
19
|
+
behavior: {},
|
20
20
|
errorComposer: new DetoxConfigErrorComposer(),
|
21
|
-
|
22
|
-
|
21
|
+
device: {},
|
22
|
+
session: {}
|
23
23
|
};
|
24
24
|
|
25
25
|
return ({
|
@@ -44,14 +44,14 @@ describe('build', () => {
|
|
44
44
|
});
|
45
45
|
|
46
46
|
it('runs the build script from the composed device config', async () => {
|
47
|
-
detox.config.
|
47
|
+
detox.config.apps.default = { build: 'yet another command' };
|
48
48
|
|
49
49
|
await callCli('./build', 'build');
|
50
50
|
expect(execSync).toHaveBeenCalledWith('yet another command', expect.anything());
|
51
51
|
});
|
52
52
|
|
53
53
|
it('skips building the app if the binary exists and --if-missing flag is set', async () => {
|
54
|
-
detox.config.
|
54
|
+
detox.config.apps.default = { build: 'yet another command', binaryPath: __filename };
|
55
55
|
|
56
56
|
await callCli('./build', 'build -i');
|
57
57
|
expect(execSync).not.toHaveBeenCalled();
|
@@ -63,32 +63,32 @@ describe('build', () => {
|
|
63
63
|
});
|
64
64
|
|
65
65
|
it('fails with an error if a build script has not been found', async () => {
|
66
|
-
detox.config.
|
66
|
+
detox.config.apps.default = {};
|
67
67
|
await expect(callCli('./build', 'build')).rejects.toThrowError(/Failed to build/);
|
68
68
|
});
|
69
69
|
|
70
70
|
it('should ignore missing build command with -s, --silent flag', async () => {
|
71
|
-
detox.config.
|
71
|
+
detox.config.apps.default = {};
|
72
72
|
await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
|
73
73
|
expect(detox.log.warn).not.toHaveBeenCalled();
|
74
74
|
});
|
75
75
|
|
76
76
|
it('should print a warning upon user build script failure', async () => {
|
77
|
-
detox.config.
|
77
|
+
detox.config.apps.default = { build: 'a command' };
|
78
78
|
execSync.mockImplementation(() => { throw new Error('Build failure'); });
|
79
79
|
await expect(callCli('./build', 'build')).rejects.toThrowError(/Build failure/);
|
80
80
|
expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('You are responsible'));
|
81
81
|
});
|
82
82
|
|
83
83
|
it('should print a warning if app is not found at binary path', async () => {
|
84
|
-
detox.config.
|
84
|
+
detox.config.apps.default = { binaryPath: tempfile() };
|
85
85
|
await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
|
86
86
|
expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('could not find your app at the given binary path'));
|
87
87
|
});
|
88
88
|
|
89
89
|
it('should print extra message with the app name before building (in a multi-app configuration)', async () => {
|
90
|
-
detox.config.
|
91
|
-
detox.config.
|
90
|
+
detox.config.apps.app1 = { binaryPath: tempfile(), build: ':' };
|
91
|
+
detox.config.apps.app2 = { binaryPath: tempfile(), build: ':' };
|
92
92
|
|
93
93
|
await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
|
94
94
|
expect(detox.log.info).toHaveBeenCalledWith(expect.stringContaining('app1'));
|
@@ -96,7 +96,7 @@ describe('build', () => {
|
|
96
96
|
});
|
97
97
|
|
98
98
|
it('should not print that extra message when the app is single', async () => {
|
99
|
-
detox.config.
|
99
|
+
detox.config.apps.default = { binaryPath: tempfile(), build: ':' };
|
100
100
|
|
101
101
|
await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
|
102
102
|
expect(detox.log.info).not.toHaveBeenCalledWith(expect.stringContaining('default'));
|
package/local-cli/test.js
CHANGED
@@ -15,9 +15,9 @@ module.exports.handler = async function test({ detoxArgs, runnerArgs }) {
|
|
15
15
|
});
|
16
16
|
|
17
17
|
const runnerCommand = new TestRunnerCommand()
|
18
|
-
.setRunnerConfig(detox.config.
|
19
|
-
.setDeviceConfig(detox.config.
|
20
|
-
.replicateCLIConfig(detox.config.
|
18
|
+
.setRunnerConfig(detox.config.testRunner)
|
19
|
+
.setDeviceConfig(detox.config.device)
|
20
|
+
.replicateCLIConfig(detox.config.cli);
|
21
21
|
|
22
22
|
await runnerCommand.execute();
|
23
23
|
} finally {
|
package/local-cli/test.test.js
CHANGED
@@ -116,7 +116,7 @@ describe('CLI', () => {
|
|
116
116
|
});
|
117
117
|
});
|
118
118
|
|
119
|
-
test('should use
|
119
|
+
test('should use testRunner.args._ as default specs', async () => {
|
120
120
|
detoxConfig.testRunner.args._ = ['e2e/sanity'];
|
121
121
|
await run();
|
122
122
|
expect(_.last(cliCall().argv)).toEqual('e2e/sanity');
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "detox",
|
3
3
|
"description": "E2E tests and automation for mobile",
|
4
|
-
"version": "20.0.
|
4
|
+
"version": "20.0.3-breaking.new-global-lifecycle.0",
|
5
5
|
"bin": {
|
6
6
|
"detox": "local-cli/cli.js"
|
7
7
|
},
|
@@ -183,5 +183,5 @@
|
|
183
183
|
}
|
184
184
|
}
|
185
185
|
},
|
186
|
-
"gitHead": "
|
186
|
+
"gitHead": "1e9a8a54aa4c8d73cf106770522723d0f6f1f10e"
|
187
187
|
}
|
@@ -46,7 +46,7 @@ class DetoxCircusEnvironment extends NodeEnvironment {
|
|
46
46
|
/** @protected */
|
47
47
|
this.testEventListeners = [];
|
48
48
|
/** @protected */
|
49
|
-
this.initTimeout = detox.config.
|
49
|
+
this.initTimeout = detox.config.testRunner.jest.initTimeout;
|
50
50
|
}
|
51
51
|
|
52
52
|
/** @override */
|
@@ -22,7 +22,7 @@ class DetoxCoreListener {
|
|
22
22
|
|
23
23
|
async setup() {
|
24
24
|
// Workaround to override Jest's expect
|
25
|
-
if (detoxInternals.config.
|
25
|
+
if (detoxInternals.config.behavior.init.exposeGlobals) {
|
26
26
|
this._env.global.expect = detox.expect;
|
27
27
|
}
|
28
28
|
}
|
@@ -98,7 +98,7 @@ class DetoxCoreListener {
|
|
98
98
|
|
99
99
|
async run_finish(_event, state) {
|
100
100
|
if (this._hasFailedTests(state.rootDescribeBlock)) {
|
101
|
-
const handledByJestCircus = this._testRunTimes > 1 && !detoxInternals.config.
|
101
|
+
const handledByJestCircus = this._testRunTimes > 1 && !detoxInternals.config.testRunner.jest.retryAfterCircusRetries;
|
102
102
|
await detoxInternals.reportFailedTests([this._env.testPath], handledByJestCircus);
|
103
103
|
}
|
104
104
|
}
|
@@ -16,7 +16,7 @@ class SpecReporter {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
get enabled() {
|
19
|
-
const jestSection = config.
|
19
|
+
const jestSection = config.testRunner.jest;
|
20
20
|
const reportSpecs = jestSection && jestSection.reportSpecs;
|
21
21
|
|
22
22
|
return reportSpecs !== undefined ? reportSpecs : session.workersCount === 1;
|
@@ -12,7 +12,7 @@ class WorkerAssignReporter {
|
|
12
12
|
}
|
13
13
|
|
14
14
|
run_start() {
|
15
|
-
if (config.
|
15
|
+
if (config.testRunner.jest.reportWorkerAssign) {
|
16
16
|
log.info({ event: 'WORKER_ASSIGN' }, `${this._formatTestName()} is assigned to ${this._formatDeviceName()}`);
|
17
17
|
}
|
18
18
|
}
|
package/src/DetoxWorker.js
CHANGED
@@ -56,7 +56,13 @@ class DetoxWorker {
|
|
56
56
|
async init() {
|
57
57
|
if (this._isCleaningUp) return;
|
58
58
|
|
59
|
-
const {
|
59
|
+
const {
|
60
|
+
apps: appsConfig,
|
61
|
+
artifacts: artifactsConfig,
|
62
|
+
behavior: behaviorConfig,
|
63
|
+
device: deviceConfig,
|
64
|
+
session: sessionConfig
|
65
|
+
} = this._config;
|
60
66
|
this._appsConfig = appsConfig;
|
61
67
|
this._artifactsConfig = artifactsConfig;
|
62
68
|
this._behaviorConfig = behaviorConfig;
|
@@ -2,6 +2,8 @@ const os = require('os');
|
|
2
2
|
|
3
3
|
const _ = require('lodash');
|
4
4
|
|
5
|
+
const log = require('../utils/logger');
|
6
|
+
|
5
7
|
/**
|
6
8
|
* @param {object} opts
|
7
9
|
* @param {Detox.DetoxConfig} opts.globalConfig
|
@@ -12,7 +14,7 @@ const _ = require('lodash');
|
|
12
14
|
* @returns {Detox.DetoxTestRunnerConfig} opts.testRunnerArgv
|
13
15
|
*/
|
14
16
|
function composeRunnerConfig(opts) {
|
15
|
-
const globalConfig = opts.globalConfig
|
17
|
+
const globalConfig = adaptLegacyRunnerConfig(opts.globalConfig);
|
16
18
|
if (globalConfig != null && typeof globalConfig !== 'object') {
|
17
19
|
throw opts.errorComposer.invalidTestRunnerProperty(true);
|
18
20
|
}
|
@@ -61,6 +63,51 @@ function composeRunnerConfig(opts) {
|
|
61
63
|
return merged;
|
62
64
|
}
|
63
65
|
|
66
|
+
function adaptLegacyRunnerConfig(globalConfig) {
|
67
|
+
let isLegacy = false;
|
68
|
+
|
69
|
+
const runnerConfigKey = 'runnerConfig' in globalConfig ? 'runnerConfig' : 'runner-config';
|
70
|
+
if (_.isString(globalConfig[runnerConfigKey])) {
|
71
|
+
isLegacy = true;
|
72
|
+
log.warn(`Detected a deprecated "${runnerConfigKey}" property (string).`);
|
73
|
+
}
|
74
|
+
|
75
|
+
const testRunnerKey = 'testRunner' in globalConfig ? 'testRunner' : 'test-runner';
|
76
|
+
if (_.isString(globalConfig[testRunnerKey])) {
|
77
|
+
isLegacy = true;
|
78
|
+
log.warn(`Detected a deprecated "${testRunnerKey}" property (string).`);
|
79
|
+
}
|
80
|
+
|
81
|
+
if (globalConfig.specs != null) {
|
82
|
+
isLegacy = true;
|
83
|
+
log.warn(`Detected a deprecated "specs" property.`);
|
84
|
+
}
|
85
|
+
|
86
|
+
if (!isLegacy) {
|
87
|
+
return globalConfig.testRunner;
|
88
|
+
}
|
89
|
+
|
90
|
+
log.warn(`Please migrate your Detox config according to the guide: [TODO: insert the migration guilde link]`);
|
91
|
+
const testRunner = globalConfig[testRunnerKey];
|
92
|
+
const runnerConfig = globalConfig[runnerConfigKey];
|
93
|
+
const specs = globalConfig.specs != null ? String(globalConfig.specs) : undefined;
|
94
|
+
|
95
|
+
const args = {};
|
96
|
+
if (_.isString(testRunner)) {
|
97
|
+
args.$0 = testRunner;
|
98
|
+
}
|
99
|
+
|
100
|
+
if (_.isString(runnerConfig)) {
|
101
|
+
args.config = runnerConfig;
|
102
|
+
}
|
103
|
+
|
104
|
+
if (specs) {
|
105
|
+
args._ = [specs];
|
106
|
+
}
|
107
|
+
|
108
|
+
return { args };
|
109
|
+
}
|
110
|
+
|
64
111
|
function hasEmptyPositionalArgs(value, key) {
|
65
112
|
return key === '_' ? _.isEmpty(value) : false;
|
66
113
|
}
|
@@ -105,16 +105,17 @@ async function composeDetoxConfig({
|
|
105
105
|
});
|
106
106
|
|
107
107
|
const result = {
|
108
|
-
appsConfig,
|
109
|
-
artifactsConfig,
|
110
|
-
behaviorConfig,
|
111
|
-
cliConfig,
|
112
108
|
configurationName,
|
113
|
-
deviceConfig,
|
114
109
|
errorComposer,
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
|
111
|
+
apps: appsConfig,
|
112
|
+
artifacts: artifactsConfig,
|
113
|
+
behavior: behaviorConfig,
|
114
|
+
cli: cliConfig,
|
115
|
+
device: deviceConfig,
|
116
|
+
logger: loggerConfig,
|
117
|
+
testRunner: runnerConfig,
|
118
|
+
session: sessionConfig,
|
118
119
|
};
|
119
120
|
|
120
121
|
return result;
|
@@ -656,12 +656,14 @@ Examine your Detox config${this._atPath()}`,
|
|
656
656
|
}
|
657
657
|
|
658
658
|
invalidTestRunnerProperty(isGlobal) {
|
659
|
+
const testRunner = _.get(this.contents, ['testRunner']);
|
660
|
+
|
659
661
|
return new DetoxConfigError({
|
660
|
-
message: `testRunner should be an object, not a
|
662
|
+
message: `testRunner should be an object, not a ${typeof testRunner}`,
|
661
663
|
hint: `Check that in your Detox config${this._atPath()}`,
|
662
664
|
inspectOptions: { depth: isGlobal ? 0 : 3 },
|
663
665
|
debugInfo: isGlobal ? {
|
664
|
-
testRunner
|
666
|
+
testRunner,
|
665
667
|
...this.contents,
|
666
668
|
} : {
|
667
669
|
...this._focusOnConfiguration(c => _.pick(c, ['testRunner'])),
|
@@ -65,7 +65,12 @@ class DetoxPrimaryContext extends DetoxContext {
|
|
65
65
|
this[_dirty] = true;
|
66
66
|
const detoxConfig = await this[symbols.resolveConfig](opts);
|
67
67
|
|
68
|
-
const {
|
68
|
+
const {
|
69
|
+
behavior: behaviorConfig,
|
70
|
+
device: deviceConfig,
|
71
|
+
logger: loggerConfig,
|
72
|
+
session: sessionConfig
|
73
|
+
} = detoxConfig;
|
69
74
|
await this[$logger].setConfig(loggerConfig);
|
70
75
|
|
71
76
|
this.trace.begin({
|
@@ -177,7 +182,7 @@ class DetoxPrimaryContext extends DetoxContext {
|
|
177
182
|
}
|
178
183
|
|
179
184
|
const streamUtils = require('../utils/streamUtils');
|
180
|
-
const { rootDir, plugins } = this[symbols.config].
|
185
|
+
const { rootDir, plugins } = this[symbols.config].artifacts || {};
|
181
186
|
const logConfig = plugins && plugins.log || 'none';
|
182
187
|
const enabled = rootDir && (typeof logConfig === 'string' ? logConfig !== 'none' : logConfig.enabled);
|
183
188
|
|
@@ -204,7 +209,7 @@ class DetoxPrimaryContext extends DetoxContext {
|
|
204
209
|
async[_resetLockFile]() {
|
205
210
|
const DeviceRegistry = require('../devices/DeviceRegistry');
|
206
211
|
|
207
|
-
const deviceType = this[symbols.config].
|
212
|
+
const deviceType = this[symbols.config].device.type;
|
208
213
|
|
209
214
|
switch (deviceType) {
|
210
215
|
case 'ios.none':
|
@@ -1 +0,0 @@
|
|
1
|
-
91f1e6b3345b09b266fc6b1f4387d693
|
@@ -1 +0,0 @@
|
|
1
|
-
a2d07ea0b1bd401ae5cd41fc9f07bbbfb4fee96f
|
@@ -1 +0,0 @@
|
|
1
|
-
269c444435ef2d7f7267d243b84beefc38508b035df782e1a60eb25b3882a30d
|
@@ -1 +0,0 @@
|
|
1
|
-
f6d54f916e9b35f686f67a63fe072ffc0781ae7da27daf39a0dce5145fa75de5a240402f10d48df88710730fe40d847e87f7194d999359322e97f483f815496e
|
@@ -1 +0,0 @@
|
|
1
|
-
613e288168a5ebe791c1b253a0aac51c
|
@@ -1 +0,0 @@
|
|
1
|
-
112918ac48c1f2763d5f0fddfa8aba44a35a0c57
|
@@ -1 +0,0 @@
|
|
1
|
-
b21e2858bc218ca7402b48d759c6277fce832c73915c874b36d319fe4be2c2d7
|
@@ -1 +0,0 @@
|
|
1
|
-
ccbe51ebb24ad5b665f2d4a9d212701096e77f14d9cf04ac8ff6b2b9a452f8fdcf4b2319060bbdc6512b1cbc11846995af3955ac63bd6ea6b75f64c9dd399c24
|
@@ -1 +0,0 @@
|
|
1
|
-
e68998c30e0c3aefe7cdc34b641fd5e2
|
@@ -1 +0,0 @@
|
|
1
|
-
4afd3a2fcdb10c26d6a56a9b8f5c64a05b0152b5
|
@@ -1 +0,0 @@
|
|
1
|
-
23b6942ae16e58bb84494f4080b72ef018817833f5a3af6971844ca7d35854ba
|
@@ -1 +0,0 @@
|
|
1
|
-
461b3793c3c8fe77b4d7c1494716ae1ce17bf133c99b637f639f176e52c72fdfcf1a2621ce18136f151aa50798007cc68e0eee46a87674a0a22e68534b5f43f6
|