detox 20.1.0-next-is-hittable-check.0 → 20.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. package/.eslintrc.js +2 -7
  2. package/Detox-android/com/wix/detox/{20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar → 20.1.1/detox-20.1.1-javadoc.jar} +0 -0
  3. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.md5 +1 -0
  4. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha1 +1 -0
  5. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha256 +1 -0
  6. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha512 +1 -0
  7. package/Detox-android/com/wix/detox/{20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar → 20.1.1/detox-20.1.1-sources.jar} +0 -0
  8. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.md5 +1 -0
  9. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha1 +1 -0
  10. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha256 +1 -0
  11. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha512 +1 -0
  12. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar +0 -0
  13. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.md5 +1 -0
  14. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha1 +1 -0
  15. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha256 +1 -0
  16. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha512 +1 -0
  17. package/Detox-android/com/wix/detox/{20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom → 20.1.1/detox-20.1.1.pom} +1 -1
  18. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.md5 +1 -0
  19. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha1 +1 -0
  20. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha256 +1 -0
  21. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha512 +1 -0
  22. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  26. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  27. package/Detox-ios-src.tbz +0 -0
  28. package/Detox-ios.tbz +0 -0
  29. package/android/build.gradle +0 -1
  30. package/android/detox/src/full/java/com/wix/detox/TestEngineFacade.kt +3 -3
  31. package/android/detox/src/full/java/com/wix/detox/adapters/server/QueryStatusActionHandler.kt +12 -80
  32. package/android/detox/src/full/java/com/wix/detox/espresso/common/UiControllerImplReflected.kt +16 -0
  33. package/android/detox/src/full/java/com/wix/detox/espresso/idlingresources/DescriptiveIdlingResource.kt +8 -0
  34. package/android/detox/src/full/java/com/wix/detox/espresso/registry/BusyResourcesInquirer.kt +48 -0
  35. package/android/detox/src/full/java/com/wix/detox/inquiry/DetoxBusyResource.kt +92 -0
  36. package/android/detox/src/full/java/com/wix/detox/{reactnative/idlingresources/IdlingResourceDescription.kt → inquiry/DetoxBusyResourceDescription.kt} +6 -6
  37. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/AnimatedModuleIdlingResource.java +18 -7
  38. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResource.kt +3 -4
  39. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/BridgeIdlingResource.java +12 -6
  40. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DetoxBaseIdlingResource.java +2 -0
  41. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/NetworkIdlingResource.java +14 -8
  42. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResource.kt +2 -6
  43. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/UIManagerModuleReflected.kt +1 -1
  44. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/UIModuleIdlingResource.kt +4 -6
  45. package/android/detox/src/testFull/java/com/wix/detox/adapters/server/QueryStatusActionHandlerSpec.kt +35 -94
  46. package/android/detox/src/testFull/java/com/wix/detox/espresso/registry/{IRStatusInquirerTest.kt → BusyResourcesInquirerTest.kt} +46 -7
  47. package/android/detox/src/testFull/java/com/wix/detox/{reactnative/idlingresources/IdlingResourceDescriptionSpec.kt → inquiry/DetoxBusyResourceDescriptionSpec.kt} +6 -6
  48. package/android/detox/src/testFull/java/com/wix/detox/inquiry/DetoxBusyResourceSpec.kt +134 -0
  49. package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResourceSpec.kt +4 -5
  50. package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/NetworkIdlingResourcesTest.kt +5 -5
  51. package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResourceSpec.kt +4 -6
  52. package/index.d.ts +102 -18
  53. package/index.js +12 -1
  54. package/internals.d.ts +34 -9
  55. package/internals.js +10 -3
  56. package/local-cli/cli.js +6 -3
  57. package/local-cli/init.js +1 -1
  58. package/local-cli/test.js +6 -6
  59. package/local-cli/testCommand/TestRunnerCommand.js +97 -94
  60. package/local-cli/testCommand/TestRunnerError.js +17 -0
  61. package/local-cli/testCommand/builder.js +0 -1
  62. package/local-cli/testCommand/middlewares.js +4 -13
  63. package/local-cli/testCommand/warnings.js +0 -3
  64. package/package.json +31 -16
  65. package/runners/deprecation.js +42 -44
  66. package/runners/jest/index.d.ts +60 -0
  67. package/runners/jest/index.js +3 -8
  68. package/runners/jest/reporters/DetoxReporter.js +21 -10
  69. package/runners/jest/testEnvironment/index.js +57 -41
  70. package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +62 -35
  71. package/runners/jest/testEnvironment/listeners/SpecReporter.js +12 -14
  72. package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +1 -5
  73. package/runners/jest/testEnvironment/utils/assertJestCircus27.js +17 -3
  74. package/src/DetoxWorker.js +96 -50
  75. package/src/android/core/NativeMatcher.js +14 -10
  76. package/src/android/espressoapi/EspressoDetox.js +1 -1
  77. package/src/android/espressoapi/web/WebElement.js +1 -1
  78. package/src/android/interactions/native.js +3 -2
  79. package/src/android/matchers/native.js +1 -2
  80. package/src/artifacts/ArtifactsManager.js +6 -6
  81. package/src/artifacts/templates/plugin/ArtifactPlugin.js +1 -1
  82. package/src/artifacts/templates/plugin/TwoSnapshotsPerTestPlugin.js +2 -1
  83. package/src/artifacts/templates/plugin/WholeTestRecorderPlugin.js +3 -2
  84. package/src/artifacts/utils/temporaryPath.js +32 -2
  85. package/src/client/AsyncWebSocket.js +3 -2
  86. package/src/client/actions/SyncStatusSchema.json +21 -0
  87. package/src/client/actions/formatters/SyncStatusFormatter.js +2 -0
  88. package/src/client/actions/formatters/sync-resources/BgThreadFormatter.js +5 -0
  89. package/src/configuration/collectCliConfig.js +2 -13
  90. package/src/configuration/composeLoggerConfig.js +1 -0
  91. package/src/configuration/composeRunnerConfig.js +5 -4
  92. package/src/devices/allocation/drivers/AllocationDriverBase.js +4 -2
  93. package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +3 -3
  94. package/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js +3 -16
  95. package/src/devices/allocation/factories/base.js +1 -1
  96. package/src/devices/common/drivers/android/exec/ADB.js +4 -0
  97. package/src/devices/common/drivers/android/tools/AppInstallHelper.js +4 -4
  98. package/src/devices/common/drivers/android/tools/{FileXfer.js → FileTransfer.js} +2 -2
  99. package/src/devices/common/drivers/android/tools/TempFileTransfer.js +14 -0
  100. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +1 -1
  101. package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +2 -0
  102. package/src/devices/runtime/RuntimeDevice.js +3 -3
  103. package/src/devices/runtime/drivers/android/AndroidDriver.js +7 -6
  104. package/src/devices/runtime/factories/android.js +6 -5
  105. package/src/devices/runtime/factories/base.js +3 -2
  106. package/src/errors/DetoxConfigErrorComposer.js +6 -1
  107. package/src/errors/DetoxError.js +5 -1
  108. package/src/ios/expectTwo.js +22 -13
  109. package/src/ipc/IPCClient.js +26 -17
  110. package/src/ipc/IPCServer.js +11 -3
  111. package/src/ipc/SessionState.js +11 -11
  112. package/src/logger/DetoxLogger.js +67 -47
  113. package/src/logger/index.js +1 -0
  114. package/src/logger/utils/BunyanLogger.js +54 -10
  115. package/src/logger/utils/CategoryThreadDispatcher.js +8 -29
  116. package/src/logger/utils/DetoxLogFinalizer.js +166 -0
  117. package/src/logger/utils/MessageStack.js +17 -6
  118. package/src/logger/utils/ThreadDispatcher.js +5 -25
  119. package/src/logger/utils/customConsoleLogger.js +22 -5
  120. package/src/logger/utils/getMainCategory.js +5 -0
  121. package/src/logger/utils/sanitizeBunyanContext.js +3 -1
  122. package/src/logger/utils/streams/BunyanTransformer.js +72 -0
  123. package/src/logger/utils/streams/ChromeTraceTransformer.js +132 -0
  124. package/src/logger/utils/streams/DetoxJSONLParser.js +31 -0
  125. package/src/logger/utils/streams/JSONLStringer.js +55 -0
  126. package/src/logger/utils/streams/index.js +7 -0
  127. package/src/logger/utils/streams/transformers.js +39 -0
  128. package/src/logger/utils/tracerLegacy.js +14 -25
  129. package/src/realms/DetoxContext.js +16 -9
  130. package/src/realms/DetoxInternalsFacade.js +1 -7
  131. package/src/realms/DetoxPrimaryContext.js +42 -87
  132. package/src/realms/DetoxSecondaryContext.js +9 -13
  133. package/src/{symbols.js → realms/symbols.js} +0 -0
  134. package/src/servicelocator/android/index.js +2 -2
  135. package/src/utils/ExclusiveLockfile.js +1 -0
  136. package/src/utils/argparse.js +11 -27
  137. package/src/utils/logger.js +1 -1
  138. package/src/utils/pathUtils.js +11 -0
  139. package/src/utils/shellUtils.js +17 -0
  140. package/src/utils/traceInvocationCall.js +21 -0
  141. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.md5 +0 -1
  142. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha1 +0 -1
  143. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha256 +0 -1
  144. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha512 +0 -1
  145. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.md5 +0 -1
  146. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha1 +0 -1
  147. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha256 +0 -1
  148. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha512 +0 -1
  149. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar +0 -0
  150. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.md5 +0 -1
  151. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha1 +0 -1
  152. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha256 +0 -1
  153. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha512 +0 -1
  154. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.md5 +0 -1
  155. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha1 +0 -1
  156. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha256 +0 -1
  157. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha512 +0 -1
  158. package/android/detox/src/full/java/com/wix/detox/espresso/registry/IRStatusInquirer.kt +0 -24
  159. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DescriptiveIdlingResource.kt +0 -10
  160. package/local-cli/build.test.js +0 -104
  161. package/local-cli/run-server.test.js +0 -23
  162. package/local-cli/test.test.js +0 -569
  163. package/runners/jest/deprecation.js +0 -25
  164. package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +0 -23
  165. package/src/configuration/utils/warnings.js +0 -12
  166. package/src/devices/common/drivers/android/tools/TempFileXfer.js +0 -16
  167. package/src/logger/utils/streamUtils.js +0 -240
  168. package/src/realms/index.js +0 -10
  169. package/src/utils/trace.js +0 -3
@@ -1 +0,0 @@
1
- 5a16f5124aec001470b9a4f9458674a477f8e844866ed2858bf096f0e27936d52b5e31c41d317e83d06ee200d5e9c5a2c302488e0d37eb7264fc5a55ffb03bb7
@@ -1,24 +0,0 @@
1
- package com.wix.detox.espresso.registry
2
-
3
- import androidx.test.espresso.Espresso
4
- import androidx.test.espresso.IdlingResource
5
- import androidx.test.espresso.base.IdlingResourceRegistry
6
- import com.wix.detox.common.UIThread
7
- import org.joor.Reflect
8
- import java.util.concurrent.Callable
9
-
10
- class IRStatusInquirer(private val registry: IdlingResourceRegistry) {
11
- fun getAllBusyResources(): List<IdlingResource> {
12
- return UIThread.postFirstSync(Callable<List<IdlingResource>> {
13
- registry.resources.filter { resource ->
14
- !resource.isIdleNow
15
- }
16
- })
17
- }
18
-
19
- companion object {
20
- val INSTANCE = IRStatusInquirer(getRegistryDefault())
21
- }
22
- }
23
-
24
- private fun getRegistryDefault() = Reflect.on(Espresso::class.java).get<IdlingResourceRegistry>("baseRegistry")
@@ -1,10 +0,0 @@
1
- package com.wix.detox.reactnative.idlingresources
2
-
3
- import androidx.test.espresso.IdlingResource
4
-
5
- interface DescriptiveIdlingResource: IdlingResource {
6
- /**
7
- * Returns a descriptive representation of the resource.
8
- */
9
- fun getDescription(): IdlingResourceDescription
10
- }
@@ -1,104 +0,0 @@
1
- const tempfile = require('tempfile');
2
-
3
- describe('build', () => {
4
- let execSync, detox, callCli;
5
-
6
- beforeEach(() => {
7
- // @ts-ignore
8
- callCli = global.callCli;
9
- jest.mock('child_process');
10
- execSync = require('child_process').execSync;
11
-
12
- jest.mock('../src/utils/logger');
13
- jest.mock('../internals', () => {
14
- const DetoxConfigErrorComposer = require('../src/errors/DetoxConfigErrorComposer');
15
-
16
- const config = {
17
- apps: {},
18
- artifacts: {},
19
- behavior: {},
20
- errorComposer: new DetoxConfigErrorComposer(),
21
- device: {},
22
- session: {}
23
- };
24
-
25
- return ({
26
- config,
27
- resolveConfig: jest.fn().mockResolvedValue(config),
28
- log: require('../src/utils/logger')
29
- });
30
- });
31
-
32
- detox = require('../internals');
33
- });
34
-
35
- it('passes argv to resolveConfig', async () => {
36
- await callCli('./build', 'build -C /etc/.detoxrc.js -c myconf').catch(() => {});
37
-
38
- expect(detox.resolveConfig).toHaveBeenCalledWith({
39
- argv: expect.objectContaining({
40
- 'C': '/etc/.detoxrc.js',
41
- 'c': 'myconf',
42
- }),
43
- });
44
- });
45
-
46
- it('runs the build script from the composed device config', async () => {
47
- detox.config.apps.default = { build: 'yet another command' };
48
-
49
- await callCli('./build', 'build');
50
- expect(execSync).toHaveBeenCalledWith('yet another command', expect.anything());
51
- });
52
-
53
- it('skips building the app if the binary exists and --if-missing flag is set', async () => {
54
- detox.config.apps.default = { build: 'yet another command', binaryPath: __filename };
55
-
56
- await callCli('./build', 'build -i');
57
- expect(execSync).not.toHaveBeenCalled();
58
-
59
- await callCli('./build', 'build --if-missing');
60
- expect(execSync).not.toHaveBeenCalled();
61
-
62
- expect(detox.log.info).toHaveBeenCalledWith('Skipping build for "default" app...');
63
- });
64
-
65
- it('fails with an error if a build script has not been found', async () => {
66
- detox.config.apps.default = {};
67
- await expect(callCli('./build', 'build')).rejects.toThrowError(/Failed to build/);
68
- });
69
-
70
- it('should ignore missing build command with -s, --silent flag', async () => {
71
- detox.config.apps.default = {};
72
- await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
73
- expect(detox.log.warn).not.toHaveBeenCalled();
74
- });
75
-
76
- it('should print a warning upon user build script failure', async () => {
77
- detox.config.apps.default = { build: 'a command' };
78
- execSync.mockImplementation(() => { throw new Error('Build failure'); });
79
- await expect(callCli('./build', 'build')).rejects.toThrowError(/Build failure/);
80
- expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('You are responsible'));
81
- });
82
-
83
- it('should print a warning if app is not found at binary path', async () => {
84
- detox.config.apps.default = { binaryPath: tempfile() };
85
- await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
86
- expect(detox.log.warn).toHaveBeenCalledWith(expect.stringContaining('could not find your app at the given binary path'));
87
- });
88
-
89
- it('should print extra message with the app name before building (in a multi-app configuration)', async () => {
90
- detox.config.apps.app1 = { binaryPath: tempfile(), build: ':' };
91
- detox.config.apps.app2 = { binaryPath: tempfile(), build: ':' };
92
-
93
- await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
94
- expect(detox.log.info).toHaveBeenCalledWith(expect.stringContaining('app1'));
95
- expect(detox.log.info).toHaveBeenCalledWith(expect.stringContaining('app2'));
96
- });
97
-
98
- it('should not print that extra message when the app is single', async () => {
99
- detox.config.apps.default = { binaryPath: tempfile(), build: ':' };
100
-
101
- await expect(callCli('./build', 'build -s')).resolves.not.toThrowError();
102
- expect(detox.log.info).not.toHaveBeenCalledWith(expect.stringContaining('default'));
103
- });
104
- });
@@ -1,23 +0,0 @@
1
- // @ts-nocheck
2
- jest.mock('../src/utils/logger');
3
-
4
- describe('run-server', () => {
5
- it('starts the server', async () => {
6
- jest.mock('../src/server/DetoxServer');
7
- const DetoxServer = require('../src/server/DetoxServer');
8
- await callCli('./run-server', 'run-server');
9
-
10
- expect(DetoxServer).toHaveBeenCalledWith(expect.objectContaining({ port: 8099 }));
11
- });
12
-
13
- it('throws if the port number is out of range', async () => {
14
- jest.spyOn(process, 'exit'); // otherwise tests are aborted
15
- jest.mock('../src/server/DetoxServer');
16
- const DetoxServer = require('../src/server/DetoxServer');
17
-
18
- await expect(callCli('./run-server', 'run-server -p PORT')).rejects.toThrowErrorMatchingSnapshot();
19
- await expect(callCli('./run-server', 'run-server -p 0')).rejects.toThrowErrorMatchingSnapshot();
20
- await expect(callCli('./run-server', 'run-server -p 100000')).rejects.toThrowErrorMatchingSnapshot();
21
- expect(DetoxServer).not.toHaveBeenCalled();
22
- });
23
- });