detox 19.4.4 → 19.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4-javadoc.jar → 19.4.5/detox-19.4.5-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4-sources.jar → 19.4.5/detox-19.4.5-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.aar → 19.4.5/detox-19.4.5.aar} +0 -0
  12. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.aar.md5 → 19.4.5/detox-19.4.5.aar.md5} +0 -0
  13. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.aar.sha1 → 19.4.5/detox-19.4.5.aar.sha1} +0 -0
  14. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.aar.sha256 → 19.4.5/detox-19.4.5.aar.sha256} +0 -0
  15. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.aar.sha512 → 19.4.5/detox-19.4.5.aar.sha512} +0 -0
  16. package/Detox-android/com/wix/detox/{19.4.4/detox-19.4.4.pom → 19.4.5/detox-19.4.5.pom} +1 -1
  17. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/19.4.5/detox-19.4.5.pom.sha512 +1 -0
  21. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  22. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  26. package/Detox-ios-src.tbz +0 -0
  27. package/Detox-ios.tbz +0 -0
  28. package/package.json +3 -4
  29. package/src/Detox.js +7 -5
  30. package/src/configuration/composeSessionConfig.js +7 -1
  31. package/src/errors/DetoxConfigErrorComposer.js +12 -0
  32. package/src/server/DetoxServer.js +10 -2
  33. package/src/utils/dateUtils.js +15 -0
  34. package/src/utils/logger.js +6 -3
  35. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-javadoc.jar.md5 +0 -1
  36. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-javadoc.jar.sha1 +0 -1
  37. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-javadoc.jar.sha256 +0 -1
  38. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-javadoc.jar.sha512 +0 -1
  39. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-sources.jar.md5 +0 -1
  40. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-sources.jar.sha1 +0 -1
  41. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-sources.jar.sha256 +0 -1
  42. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4-sources.jar.sha512 +0 -1
  43. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4.pom.md5 +0 -1
  44. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4.pom.sha1 +0 -1
  45. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4.pom.sha256 +0 -1
  46. package/Detox-android/com/wix/detox/19.4.4/detox-19.4.4.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 3006a125457a42fcafa0b12505da848a
@@ -0,0 +1 @@
1
+ cd99dfe1e00c0c9f8a40160d318f8c0a1f5514aa
@@ -0,0 +1 @@
1
+ 18cbaa7490bcd201824de7a6b538cede80014bea359bb26e7fe17df6b809e448
@@ -0,0 +1 @@
1
+ b40d36268ce927380915d523ee6ca8be87a0ad0051193618ef0063eeef33cddf366611c5275ab6bf33b5f712ff1ab54501dc4ec8330c8512158057c12a07b512
@@ -0,0 +1 @@
1
+ b3de4fd80a120e9867596f83ac15843f
@@ -0,0 +1 @@
1
+ 2e3fdea6c708d59fb93be4a0d2a5b4a776bb0524
@@ -0,0 +1 @@
1
+ 99dfb5b789e8aa077eb13a059d65968d01bb05bb0044f416207d7aba2057c493
@@ -0,0 +1 @@
1
+ 01b0b78139fdf693f73675eff536d4c0ac96cea4d8a82d7477fceef7bdc75ccf0ddd14595c1adb84f609360ad9daf409b0daeb33b12936f0fcc6b2164e3670ea
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>19.4.4</version>
6
+ <version>19.4.5</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
+ 0a2392a2f87ab8285b4ac82422b35fba
@@ -0,0 +1 @@
1
+ 66d122a6ed7297929bf8bce0647a42da05a03c97
@@ -0,0 +1 @@
1
+ 8139d4471dfb41bd92db218fcbdeb779d3c51df4e2b6162e31eb8a61cff90d69
@@ -0,0 +1 @@
1
+ 6851d7f7059028807e3f229191d20d97ee39f28676aa5ea391775159c5454ad1fdf1c92e1d577755acc8dc084489f9f2aa0aebda4a5bb23f6af8ca2a0eadf600
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>19.4.4</latest>
7
- <release>19.4.4</release>
6
+ <latest>19.4.5</latest>
7
+ <release>19.4.5</release>
8
8
  <versions>
9
- <version>19.4.4</version>
9
+ <version>19.4.5</version>
10
10
  </versions>
11
- <lastUpdated>20220209092756</lastUpdated>
11
+ <lastUpdated>20220211095036</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- ffa9c93bc55fea87eca5c984de89976d
1
+ c69c62cb33e4206c51857b1f9128eccc
@@ -1 +1 @@
1
- 58185e278e5ccad547006026f8b4153d30a56c1e
1
+ 300bcb788d42ee07a0348fba3e8d8e64fb017166
@@ -1 +1 @@
1
- dcc151022b758d1acd3a904b409af9284653eb8156ce6c4a6e339191b8df7e4d
1
+ 339f7fcb378d88fad31875f6d104af1facefeca8f9117bdd6fcf545d71c1a5cd
@@ -1 +1 @@
1
- 8f41391d6a538561551628070449815fccb5606b2df940303d0f643c92dcd1d6410b15e23fabe86e876328d9788627b2c130167667c041b3c1c37da13a061d65
1
+ 4c6262bca8f9f460d012d96b79cb8892e4a905868ad25a28711007005da9c930f9e5da93c8fb0672243edf4735c2e3b5ceb083c2f475274d8523d72aae911b9c
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
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": "19.4.4",
4
+ "version": "19.4.5",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -56,13 +56,12 @@
56
56
  "dependencies": {
57
57
  "ajv": "^8.6.3",
58
58
  "bunyan": "^1.8.12",
59
- "bunyan-debug-stream": "^1.1.0",
59
+ "bunyan-debug-stream": "^2.0.1",
60
60
  "chalk": "^2.4.2",
61
61
  "child-process-promise": "^2.2.0",
62
62
  "find-up": "^4.1.0",
63
63
  "fs-extra": "^4.0.2",
64
64
  "funpermaproxy": "^1.0.1",
65
- "get-port": "^2.1.0",
66
65
  "ini": "^1.3.4",
67
66
  "lodash": "^4.17.5",
68
67
  "minimist": "^1.2.0",
@@ -171,5 +170,5 @@
171
170
  }
172
171
  }
173
172
  },
174
- "gitHead": "4c4ab41d8a9f488e391a68bdd243abdac1106b65"
173
+ "gitHead": "9bbd321b706e112b418128e5214da6a0f4707cc2"
175
174
  }
package/src/Detox.js CHANGED
@@ -2,7 +2,6 @@
2
2
  const { URL } = require('url');
3
3
  const util = require('util');
4
4
 
5
- const getPort = require('get-port');
6
5
  const _ = require('lodash');
7
6
 
8
7
  const lifecycleSymbols = require('../runners/integration').lifecycle;
@@ -146,17 +145,20 @@ class Detox {
146
145
  async _doInit() {
147
146
  const behaviorConfig = this._behaviorConfig.init;
148
147
  const sessionConfig = this._sessionConfig;
149
- if (!sessionConfig.server) {
150
- sessionConfig.server = `ws://localhost:${await getPort()}`;
151
- }
152
148
 
153
149
  if (sessionConfig.autoStart) {
154
150
  this._server = new DetoxServer({
155
- port: new URL(sessionConfig.server).port,
151
+ port: sessionConfig.server
152
+ ? new URL(sessionConfig.server).port
153
+ : 0,
156
154
  standalone: false,
157
155
  });
158
156
 
159
157
  await this._server.open();
158
+
159
+ if (!sessionConfig.server) {
160
+ sessionConfig.server = `ws://localhost:${this._server.port}`;
161
+ }
160
162
  }
161
163
 
162
164
  this._client = new Client(sessionConfig);
@@ -42,13 +42,19 @@ async function composeSessionConfig(options) {
42
42
  session.debugSynchronization = +cliConfig.debugSynchronization;
43
43
  }
44
44
 
45
- return {
45
+ const result = {
46
46
  autoStart: !session.server,
47
47
  sessionId: uuid.UUID(),
48
48
  debugSynchronization: 10000,
49
49
 
50
50
  ...session,
51
51
  };
52
+
53
+ if (!result.server && !result.autoStart) {
54
+ throw errorComposer.cannotSkipAutostartWithMissingServer();
55
+ }
56
+
57
+ return result;
52
58
  }
53
59
 
54
60
  module.exports = composeSessionConfig;
@@ -622,6 +622,18 @@ Examine your Detox config${this._atPath()}`,
622
622
  });
623
623
  }
624
624
 
625
+ cannotSkipAutostartWithMissingServer() {
626
+ return new DetoxConfigError({
627
+ message: `Cannot have both an undefined session.server URL and session.autoStart set to false`,
628
+ hint: `Check that in your Detox config${this._atPath()}`,
629
+ inspectOptions: { depth: 3 },
630
+ debugInfo: _.omitBy({
631
+ session: _.get(this.contents, ['session']),
632
+ ...this._focusOnConfiguration(c => _.pick(c, ['session'])),
633
+ }, _.isEmpty),
634
+ });
635
+ }
636
+
625
637
  // endregion
626
638
 
627
639
  missingBuildScript(appConfig) {
@@ -2,7 +2,7 @@
2
2
  const _ = require('lodash');
3
3
  const WebSocket = require('ws');
4
4
 
5
- const DetoxRuntimeError = require('../errors/DetoxRuntimeError');
5
+ const { DetoxInternalError, DetoxRuntimeError } = require('../errors');
6
6
  const Deferred = require('../utils/Deferred');
7
7
  const log = require('../utils/logger').child({ __filename });
8
8
 
@@ -28,11 +28,19 @@ class DetoxServer {
28
28
  this._closing = null;
29
29
  }
30
30
 
31
+ get port() {
32
+ if (!this._wss) {
33
+ throw new DetoxInternalError('Cannot get a port of a closed WebSocket server');
34
+ }
35
+
36
+ return this._wss.address().port;
37
+ }
38
+
31
39
  async open() {
32
40
  await this._startListening();
33
41
 
34
42
  const level = this._options.standalone ? 'info' : 'debug';
35
- log[level]({ event: 'WSS_CREATE' }, `Detox server listening on localhost:${this._options.port}...`);
43
+ log[level]({ event: 'WSS_CREATE' }, `Detox server listening on localhost:${this.port}...`);
36
44
  }
37
45
 
38
46
  async close() {
@@ -0,0 +1,15 @@
1
+ // This is technically a super-lightweight lib to format date/time (which
2
+ // seems to be an issue in JS...). In case more advanced techniques are ever
3
+ // needed, dateFormat v4.5.1 may come in handy as a drop-in replacement.
4
+
5
+ function shortFormat(date) {
6
+ const HH = date.getHours().toString().padStart(2, '0');
7
+ const MM = date.getMinutes().toString().padStart(2, '0');
8
+ const ss = date.getSeconds().toString().padStart(2, '0');
9
+ const milli = date.getMilliseconds().toString().padStart(3, '0');
10
+ return `${HH}:${MM}:${ss}.${milli}`;
11
+ }
12
+
13
+ module.exports = {
14
+ shortFormat,
15
+ };
@@ -1,4 +1,5 @@
1
1
  // @ts-nocheck
2
+
2
3
  const path = require('path');
3
4
 
4
5
  const bunyan = require('bunyan');
@@ -10,6 +11,7 @@ const temporaryPath = require('../artifacts/utils/temporaryPath');
10
11
 
11
12
  const argparse = require('./argparse');
12
13
  const customConsoleLogger = require('./customConsoleLogger');
14
+ const { shortFormat: shortDateFormat } = require('./dateUtils');
13
15
 
14
16
  function adaptLogLevelName(level) {
15
17
  switch (level) {
@@ -36,9 +38,9 @@ function tryOverrideConsole(logger, global) {
36
38
  }
37
39
  }
38
40
 
39
- function createPlainBunyanStream({ logPath, level }) {
41
+ function createPlainBunyanStream({ logPath, level, showDate = true }) {
40
42
  const options = {
41
- showDate: false,
43
+ showDate: showDate,
42
44
  showLoggerName: true,
43
45
  showPid: true,
44
46
  showMetadata: false,
@@ -85,7 +87,8 @@ function createPlainBunyanStream({ logPath, level }) {
85
87
  function init() {
86
88
  const levelFromArg = argparse.getArgValue('loglevel', 'l');
87
89
  const level = adaptLogLevelName(levelFromArg);
88
- const bunyanStreams = [createPlainBunyanStream({ level })];
90
+ const debugStream = createPlainBunyanStream({ level, showDate: shortDateFormat });
91
+ const bunyanStreams = [debugStream];
89
92
 
90
93
  let jsonFileStreamPath, plainFileStreamPath;
91
94
  if (!global.DETOX_CLI && !global.IS_RUNNING_DETOX_UNIT_TESTS) {
@@ -1 +0,0 @@
1
- 884cc0c3254020e90cb57ff4a72c8c87
@@ -1 +0,0 @@
1
- 67a7bdd01e82aaffc28d146f3356f2da77dd7ac6
@@ -1 +0,0 @@
1
- f790abb09e4ab5c585ba2bb1c1bfb6c7ac34601221a292d0bab28ccefe7838a7
@@ -1 +0,0 @@
1
- b734e0839fc1995b291239940bc61c8603b0019847aa781645524b15e2b975a9bb83fe73c33b1cbd268045260911471e380281f8f45d3c2b1ef80fdd642d90d8
@@ -1 +0,0 @@
1
- d95241a2ef9979d9996c8976a5793dac
@@ -1 +0,0 @@
1
- b0c9c01ee0be4adbdad3e31840f7c7bd6a1df4c5
@@ -1 +0,0 @@
1
- 937f6beeabbc0c42318c8e06d952be1f7f71485d942dfbb5108771dbd3c48d88
@@ -1 +0,0 @@
1
- b036f54d29fb19a0521e28130e82861229f6d7d7a9beea05ec3eba973d8feadded321b214026776de6bae35344b3f2364526413fe075609b29b42680eade8731
@@ -1 +0,0 @@
1
- 26576eb45a73ffbf7a59dd2a2f02f338
@@ -1 +0,0 @@
1
- 27b6bcdcb59fa922ee36d5f6e6e6f4445b61bb0b
@@ -1 +0,0 @@
1
- 5e5f59e8d319903e35a703a92c501efcede4131dad0849a5265a774d9445f05d
@@ -1 +0,0 @@
1
- 2a8dca7050f5ea45df8850307464f19a3b2c7f72c96fbeb9da26020b1345820f462e84a56da9dbd0bbca72db64bd59d8abcfd38a0034e8d7c4c68210574d3ab2