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.
- package/.eslintrc.js +2 -7
- 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
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha512 +1 -0
- 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
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar +0 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha512 +1 -0
- 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
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.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/android/build.gradle +0 -1
- package/android/detox/src/full/java/com/wix/detox/TestEngineFacade.kt +3 -3
- package/android/detox/src/full/java/com/wix/detox/adapters/server/QueryStatusActionHandler.kt +12 -80
- package/android/detox/src/full/java/com/wix/detox/espresso/common/UiControllerImplReflected.kt +16 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/idlingresources/DescriptiveIdlingResource.kt +8 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/registry/BusyResourcesInquirer.kt +48 -0
- package/android/detox/src/full/java/com/wix/detox/inquiry/DetoxBusyResource.kt +92 -0
- package/android/detox/src/full/java/com/wix/detox/{reactnative/idlingresources/IdlingResourceDescription.kt → inquiry/DetoxBusyResourceDescription.kt} +6 -6
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/AnimatedModuleIdlingResource.java +18 -7
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResource.kt +3 -4
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/BridgeIdlingResource.java +12 -6
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DetoxBaseIdlingResource.java +2 -0
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/NetworkIdlingResource.java +14 -8
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResource.kt +2 -6
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/UIManagerModuleReflected.kt +1 -1
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/UIModuleIdlingResource.kt +4 -6
- package/android/detox/src/testFull/java/com/wix/detox/adapters/server/QueryStatusActionHandlerSpec.kt +35 -94
- package/android/detox/src/testFull/java/com/wix/detox/espresso/registry/{IRStatusInquirerTest.kt → BusyResourcesInquirerTest.kt} +46 -7
- package/android/detox/src/testFull/java/com/wix/detox/{reactnative/idlingresources/IdlingResourceDescriptionSpec.kt → inquiry/DetoxBusyResourceDescriptionSpec.kt} +6 -6
- package/android/detox/src/testFull/java/com/wix/detox/inquiry/DetoxBusyResourceSpec.kt +134 -0
- package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResourceSpec.kt +4 -5
- package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/NetworkIdlingResourcesTest.kt +5 -5
- package/android/detox/src/testFull/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResourceSpec.kt +4 -6
- package/index.d.ts +102 -18
- package/index.js +12 -1
- package/internals.d.ts +34 -9
- package/internals.js +10 -3
- package/local-cli/cli.js +6 -3
- package/local-cli/init.js +1 -1
- package/local-cli/test.js +6 -6
- package/local-cli/testCommand/TestRunnerCommand.js +97 -94
- package/local-cli/testCommand/TestRunnerError.js +17 -0
- package/local-cli/testCommand/builder.js +0 -1
- package/local-cli/testCommand/middlewares.js +4 -13
- package/local-cli/testCommand/warnings.js +0 -3
- package/package.json +31 -16
- package/runners/deprecation.js +42 -44
- package/runners/jest/index.d.ts +60 -0
- package/runners/jest/index.js +3 -8
- package/runners/jest/reporters/DetoxReporter.js +21 -10
- package/runners/jest/testEnvironment/index.js +57 -41
- package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +62 -35
- package/runners/jest/testEnvironment/listeners/SpecReporter.js +12 -14
- package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +1 -5
- package/runners/jest/testEnvironment/utils/assertJestCircus27.js +17 -3
- package/src/DetoxWorker.js +96 -50
- package/src/android/core/NativeMatcher.js +14 -10
- package/src/android/espressoapi/EspressoDetox.js +1 -1
- package/src/android/espressoapi/web/WebElement.js +1 -1
- package/src/android/interactions/native.js +3 -2
- package/src/android/matchers/native.js +1 -2
- package/src/artifacts/ArtifactsManager.js +6 -6
- package/src/artifacts/templates/plugin/ArtifactPlugin.js +1 -1
- package/src/artifacts/templates/plugin/TwoSnapshotsPerTestPlugin.js +2 -1
- package/src/artifacts/templates/plugin/WholeTestRecorderPlugin.js +3 -2
- package/src/artifacts/utils/temporaryPath.js +32 -2
- package/src/client/AsyncWebSocket.js +3 -2
- package/src/client/actions/SyncStatusSchema.json +21 -0
- package/src/client/actions/formatters/SyncStatusFormatter.js +2 -0
- package/src/client/actions/formatters/sync-resources/BgThreadFormatter.js +5 -0
- package/src/configuration/collectCliConfig.js +2 -13
- package/src/configuration/composeLoggerConfig.js +1 -0
- package/src/configuration/composeRunnerConfig.js +5 -4
- package/src/devices/allocation/drivers/AllocationDriverBase.js +4 -2
- package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +3 -3
- package/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js +3 -16
- package/src/devices/allocation/factories/base.js +1 -1
- package/src/devices/common/drivers/android/exec/ADB.js +4 -0
- package/src/devices/common/drivers/android/tools/AppInstallHelper.js +4 -4
- package/src/devices/common/drivers/android/tools/{FileXfer.js → FileTransfer.js} +2 -2
- package/src/devices/common/drivers/android/tools/TempFileTransfer.js +14 -0
- package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +1 -1
- package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +2 -0
- package/src/devices/runtime/RuntimeDevice.js +3 -3
- package/src/devices/runtime/drivers/android/AndroidDriver.js +7 -6
- package/src/devices/runtime/factories/android.js +6 -5
- package/src/devices/runtime/factories/base.js +3 -2
- package/src/errors/DetoxConfigErrorComposer.js +6 -1
- package/src/errors/DetoxError.js +5 -1
- package/src/ios/expectTwo.js +22 -13
- package/src/ipc/IPCClient.js +26 -17
- package/src/ipc/IPCServer.js +11 -3
- package/src/ipc/SessionState.js +11 -11
- package/src/logger/DetoxLogger.js +67 -47
- package/src/logger/index.js +1 -0
- package/src/logger/utils/BunyanLogger.js +54 -10
- package/src/logger/utils/CategoryThreadDispatcher.js +8 -29
- package/src/logger/utils/DetoxLogFinalizer.js +166 -0
- package/src/logger/utils/MessageStack.js +17 -6
- package/src/logger/utils/ThreadDispatcher.js +5 -25
- package/src/logger/utils/customConsoleLogger.js +22 -5
- package/src/logger/utils/getMainCategory.js +5 -0
- package/src/logger/utils/sanitizeBunyanContext.js +3 -1
- package/src/logger/utils/streams/BunyanTransformer.js +72 -0
- package/src/logger/utils/streams/ChromeTraceTransformer.js +132 -0
- package/src/logger/utils/streams/DetoxJSONLParser.js +31 -0
- package/src/logger/utils/streams/JSONLStringer.js +55 -0
- package/src/logger/utils/streams/index.js +7 -0
- package/src/logger/utils/streams/transformers.js +39 -0
- package/src/logger/utils/tracerLegacy.js +14 -25
- package/src/realms/DetoxContext.js +16 -9
- package/src/realms/DetoxInternalsFacade.js +1 -7
- package/src/realms/DetoxPrimaryContext.js +42 -87
- package/src/realms/DetoxSecondaryContext.js +9 -13
- package/src/{symbols.js → realms/symbols.js} +0 -0
- package/src/servicelocator/android/index.js +2 -2
- package/src/utils/ExclusiveLockfile.js +1 -0
- package/src/utils/argparse.js +11 -27
- package/src/utils/logger.js +1 -1
- package/src/utils/pathUtils.js +11 -0
- package/src/utils/shellUtils.js +17 -0
- package/src/utils/traceInvocationCall.js +21 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/android/detox/src/full/java/com/wix/detox/espresso/registry/IRStatusInquirer.kt +0 -24
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DescriptiveIdlingResource.kt +0 -10
- package/local-cli/build.test.js +0 -104
- package/local-cli/run-server.test.js +0 -23
- package/local-cli/test.test.js +0 -569
- package/runners/jest/deprecation.js +0 -25
- package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +0 -23
- package/src/configuration/utils/warnings.js +0 -12
- package/src/devices/common/drivers/android/tools/TempFileXfer.js +0 -16
- package/src/logger/utils/streamUtils.js +0 -240
- package/src/realms/index.js +0 -10
- 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
|
-
}
|
package/local-cli/build.test.js
DELETED
@@ -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
|
-
});
|