detox 19.9.0 → 21.0.0-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/{19.9.0/detox-19.9.0-javadoc.jar → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0-sources.jar → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0.pom → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom} +2 -2
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-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/android/build.gradle +2 -2
- package/android/detox/build.gradle +2 -2
- package/android/detox/publish-pom.gradle +1 -5
- package/android/detox/publishing.gradle +7 -9
- package/android/detox/src/full/java/com/wix/detox/Detox.java +2 -59
- package/android/detox/src/full/java/com/wix/detox/NotificationDataParser.kt +3 -3
- package/android/detox/src/full/java/com/wix/detox/adapters/server/WebSocketClient.java +1 -3
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +3 -1
- package/android/detox/src/full/java/com/wix/detox/espresso/UiAutomatorHelper.java +1 -1
- package/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt +23 -16
- package/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeLoadingMonitor.kt +8 -54
- package/android/detox/src/main/java/com/wix/detox/common/DetoxErrors.java +1 -4
- package/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt +1 -2
- package/android/detox/src/main/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +36 -0
- package/android/detox/src/{full → main}/java/com/wix/detox/espresso/action/GetAttributesAction.kt +1 -13
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/utils/UiControllerUtils.kt +1 -1
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/AdjustSliderToPositionActionTest.kt +59 -0
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/GetAttributesActionTest.kt +3 -15
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
- package/android/gradlew +107 -181
- package/index.d.ts +208 -186
- package/index.js +1 -0
- package/internals.d.ts +124 -0
- package/internals.js +4 -0
- package/local-cli/build-framework-cache.js +2 -2
- package/local-cli/build.js +7 -8
- package/local-cli/build.test.js +46 -40
- package/local-cli/clean-framework-cache.js +3 -3
- package/local-cli/cli.js +0 -1
- package/local-cli/init.js +20 -55
- package/local-cli/templates/jest.js +9 -34
- package/local-cli/test.js +18 -282
- package/local-cli/test.test.js +332 -673
- package/local-cli/testCommand/TestRunnerCommand.js +157 -0
- package/local-cli/{utils/testCommandArgs.js → testCommand/builder.js} +10 -35
- package/local-cli/testCommand/middlewares.js +75 -0
- package/local-cli/{utils → testCommand}/warnings.js +0 -10
- package/local-cli/utils/jestInternals.js +13 -2
- package/local-cli/utils/yargsUtils.js +67 -0
- package/package.json +28 -22
- package/runners/deprecation.js +47 -0
- package/runners/jest/JestCircusEnvironment.js +3 -38
- package/runners/jest/adapter.d.ts +4 -10
- package/runners/jest/adapter.js +3 -6
- package/runners/jest/assignReporter.d.ts +4 -1
- package/runners/jest/assignReporter.js +3 -6
- package/runners/jest/deprecation.js +25 -0
- package/runners/jest/globalSetup.js +1 -0
- package/runners/jest/globalTeardown.js +1 -0
- package/runners/jest/index.js +21 -0
- package/runners/jest/reporter.js +1 -0
- package/runners/jest/reporters/DetoxReporter.js +5 -0
- package/runners/jest/specReporter.d.ts +4 -9
- package/runners/jest/specReporter.js +3 -10
- package/runners/jest/streamlineReporter.js +3 -22
- package/runners/jest/testEnvironment/index.js +155 -0
- package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxCoreListener.js +35 -17
- package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxInitErrorListener.js +1 -1
- package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +27 -0
- package/runners/jest/{SpecReporterImpl.js → testEnvironment/listeners/SpecReporter.js} +61 -7
- package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +34 -0
- package/runners/jest/testEnvironment/listeners/index.js +13 -0
- package/runners/{jest-circus → jest/testEnvironment}/utils/assertExistingContext.js +2 -2
- package/runners/jest/testEnvironment/utils/assertJestCircus27.js +56 -0
- package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +23 -0
- package/runners/jest/{utils → testEnvironment/utils}/getFullTestName.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/hasTimedOut.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/index.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/stdout.js +0 -0
- package/runners/jest-circus/environment/index.js +6 -0
- package/runners/jest-circus/index.js +1 -10
- package/runners/jest-circus/reporter.js +1 -0
- package/runners/migration.js +37 -0
- package/runners/mocha/DetoxMochaAdapter.js +3 -35
- package/runners/mocha/adapter.d.ts +4 -7
- package/runners/mocha/adapter.js +3 -5
- package/src/{Detox.js → DetoxWorker.js} +131 -164
- package/src/artifacts/ArtifactsManager.js +51 -2
- package/src/artifacts/log/android/ADBLogcatRecording.js +28 -11
- package/src/artifacts/providers/index.js +0 -4
- package/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js +2 -4
- package/src/artifacts/utils/temporaryPath.js +2 -0
- package/src/client/AsyncWebSocket.js +1 -1
- package/src/client/actions/actions.js +2 -2
- package/src/configuration/collectCliConfig.js +2 -4
- package/src/configuration/composeAppsConfig.js +9 -67
- package/src/configuration/composeArtifactsConfig.js +6 -32
- package/src/configuration/composeBehaviorConfig.js +3 -13
- package/src/configuration/composeDeviceConfig.js +37 -62
- package/src/configuration/composeLoggerConfig.js +50 -0
- package/src/configuration/composeRunnerConfig.js +74 -14
- package/src/configuration/composeSessionConfig.js +1 -3
- package/src/configuration/index.js +24 -23
- package/src/configuration/utils/deviceAppTypes.js +0 -1
- package/src/devices/allocation/DeviceAllocator.js +3 -3
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +4 -3
- package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +2 -6
- package/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js +0 -1
- package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +1 -1
- package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +3 -3
- package/src/devices/allocation/factories/index.js +0 -1
- package/src/devices/common/drivers/DeviceLauncher.js +2 -2
- package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +1 -1
- package/src/devices/common/drivers/android/exec/ADB.js +0 -5
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +4 -9
- package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +34 -9
- package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +1 -1
- package/src/devices/runtime/RuntimeDevice.js +69 -81
- package/src/devices/runtime/drivers/index.js +0 -1
- package/src/devices/runtime/drivers/ios/SimulatorDriver.js +3 -2
- package/src/devices/runtime/factories/ios.js +1 -8
- package/src/devices/runtime/utils/LaunchArgsEditor.js +4 -59
- package/src/devices/runtime/utils/Storage.js +4 -0
- package/src/environmentFactory.js +0 -8
- package/src/errors/DetoxConfigErrorComposer.js +76 -29
- package/src/errors/DetoxError.js +4 -0
- package/src/errors/DetoxRuntimeError.js +5 -5
- package/src/errors/index.js +2 -0
- package/src/ipc/IPCClient.js +117 -0
- package/src/ipc/IPCServer.js +87 -0
- package/src/ipc/state.js +76 -0
- package/src/logger/DetoxLogger.js +244 -0
- package/src/logger/DetoxTraceEventBuilder.js +21 -0
- package/src/logger/DetoxTracer.js +133 -0
- package/src/logger/TraceThreadDispatcher.js +52 -0
- package/src/{utils → logger}/customConsoleLogger.js +1 -1
- package/src/realms/DetoxConstants.js +13 -0
- package/src/realms/DetoxContext.js +170 -0
- package/src/realms/DetoxInternalsFacade.js +35 -0
- package/src/realms/DetoxPrimaryContext.js +229 -0
- package/src/realms/DetoxSecondaryContext.js +94 -0
- package/src/realms/index.js +10 -0
- package/src/realms/primary.js +3 -0
- package/src/realms/secondary.js +3 -0
- package/src/server/DetoxConnection.js +1 -1
- package/src/symbols.js +56 -0
- package/src/utils/ChromeTracingExporter.js +5 -6
- package/src/utils/Timer.js +14 -6
- package/{local-cli/utils/misc.js → src/utils/envUtils.js} +0 -9
- package/src/utils/logger.js +2 -162
- package/src/utils/shellUtils.js +18 -0
- package/src/utils/streamUtils.js +214 -0
- package/src/utils/trace.js +9 -44
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar +0 -0
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha512 +0 -1
- package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +0 -22
- package/android/detox/src/full/java/com/wix/detox/espresso/common/SliderHelper.kt +0 -75
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/ReflectUtils.kt +0 -10
- package/android/detox/src/testFull/java/com/wix/detox/espresso/common/SliderHelperTest.kt +0 -39
- package/local-cli/templates/mocha.js +0 -32
- package/local-cli/utils/splitArgv.js +0 -107
- package/runners/integration.js +0 -16
- package/runners/jest/DetoxAdapterCircus.js +0 -60
- package/runners/jest/DetoxAdapterImpl.js +0 -81
- package/runners/jest/DetoxAdapterJasmine.js +0 -67
- package/runners/jest/DetoxStreamlineJestReporter.js +0 -98
- package/runners/jest/FailingTestsReporter.js +0 -16
- package/runners/jest/SpecReporterCircus.js +0 -51
- package/runners/jest/SpecReporterJasmine.js +0 -39
- package/runners/jest/WorkerAssignReporterCircus.js +0 -17
- package/runners/jest/WorkerAssignReporterImpl.js +0 -21
- package/runners/jest/WorkerAssignReporterJasmine.js +0 -15
- package/runners/jest/runnerInfo.js +0 -9
- package/runners/jest-circus/environment.js +0 -206
- package/runners/jest-circus/utils/assertJestCircus26.js +0 -39
- package/runners/jest-circus/utils/wrapErrorWithNoopLifecycle.js +0 -14
- package/src/DetoxConstants.js +0 -13
- package/src/DetoxExportWrapper.js +0 -140
- package/src/artifacts/timeline/TimelineArtifactPlugin.js +0 -95
- package/src/devices/allocation/drivers/NoneAllocDriver.js +0 -10
- package/src/devices/allocation/factories/none.js +0 -11
- package/src/index.js +0 -6
- package/src/utils/MissingDetox.js +0 -78
- package/src/utils/fakeTimestampsProvider.js +0 -9
- package/src/utils/getWorkerId.js +0 -5
- package/src/utils/lastFailedTests.js +0 -38
- package/src/utils/sh.js +0 -18
package/index.d.ts
CHANGED
@@ -8,6 +8,9 @@
|
|
8
8
|
// * Max Komarychev <https://github.com/maxkomarychev>
|
9
9
|
// * Dor Ben Baruch <https://github.com/Dor256>
|
10
10
|
|
11
|
+
import { BunyanDebugStreamOptions } from 'bunyan-debug-stream';
|
12
|
+
import { EndHandle } from 'trace-event-lib';
|
13
|
+
|
11
14
|
declare global {
|
12
15
|
const device: Detox.DetoxExportWrapper['device'];
|
13
16
|
const element: Detox.DetoxExportWrapper['element'];
|
@@ -15,7 +18,6 @@ declare global {
|
|
15
18
|
const expect: Detox.DetoxExportWrapper['expect'];
|
16
19
|
const by: Detox.DetoxExportWrapper['by'];
|
17
20
|
const web: Detox.DetoxExportWrapper['web'];
|
18
|
-
const detoxCircus: Detox.DetoxCircus;
|
19
21
|
|
20
22
|
namespace NodeJS {
|
21
23
|
interface Global {
|
@@ -25,49 +27,33 @@ declare global {
|
|
25
27
|
expect: Detox.DetoxExportWrapper['expect'];
|
26
28
|
by: Detox.DetoxExportWrapper['by'];
|
27
29
|
web: Detox.DetoxExportWrapper['web'];
|
28
|
-
detoxCircus: Detox.DetoxCircus;
|
29
30
|
}
|
30
31
|
}
|
31
32
|
|
32
33
|
namespace Detox {
|
33
34
|
// region DetoxConfig
|
34
35
|
|
35
|
-
interface DetoxConfig {
|
36
|
+
interface DetoxConfig extends DetoxConfigurationCommon {
|
36
37
|
/**
|
37
38
|
* @example extends: './relative/detox.config'
|
38
39
|
* @example extends: '@my-org/detox-preset'
|
39
40
|
*/
|
40
41
|
extends?: string;
|
41
|
-
|
42
|
-
* @example testRunner: 'jest'
|
43
|
-
* @example testRunner: 'mocha'
|
44
|
-
*/
|
45
|
-
testRunner?: string;
|
46
|
-
/**
|
47
|
-
* Stops passing default `--maxWorkers 1` to the test runner,
|
48
|
-
* presuming that from now on you have that already configured
|
49
|
-
* in your test runner config as a default.
|
50
|
-
*/
|
51
|
-
skipLegacyWorkersInjection?: boolean;
|
52
|
-
/**
|
53
|
-
* @example runnerConfig: 'e2e/config.js'
|
54
|
-
*/
|
55
|
-
runnerConfig?: string;
|
56
|
-
/**
|
57
|
-
* Optional. A default glob pattern for a test runner to use when no test files are specified.
|
58
|
-
*
|
59
|
-
* @example specs: 'detoxE2E'
|
60
|
-
*/
|
61
|
-
specs?: string;
|
62
|
-
artifacts?: DetoxArtifactsConfig;
|
63
|
-
behavior?: DetoxBehaviorConfig;
|
64
|
-
session?: DetoxSessionConfig;
|
42
|
+
|
65
43
|
apps?: Record<string, DetoxAppConfig>;
|
66
44
|
devices?: Record<string, DetoxDeviceConfig>;
|
67
45
|
selectedConfiguration?: string;
|
68
46
|
configurations: Record<string, DetoxConfiguration>;
|
69
47
|
}
|
70
48
|
|
49
|
+
type DetoxConfigurationCommon = {
|
50
|
+
artifacts?: false | DetoxArtifactsConfig;
|
51
|
+
behavior?: DetoxBehaviorConfig;
|
52
|
+
logger?: DetoxLoggerConfig;
|
53
|
+
session?: DetoxSessionConfig;
|
54
|
+
testRunner?: DetoxTestRunnerConfig;
|
55
|
+
};
|
56
|
+
|
71
57
|
interface DetoxArtifactsConfig {
|
72
58
|
rootDir?: string;
|
73
59
|
pathBuilder?: string;
|
@@ -76,7 +62,6 @@ declare global {
|
|
76
62
|
screenshot?: 'none' | 'manual' | 'failing' | 'all' | DetoxScreenshotArtifactsPluginConfig;
|
77
63
|
video?: 'none' | 'failing' | 'all' | DetoxVideoArtifactsPluginConfig;
|
78
64
|
instruments?: 'none' | 'all' | DetoxInstrumentsArtifactsPluginConfig;
|
79
|
-
timeline?: 'none' | 'all' | DetoxTimelineArtifactsPluginConfig;
|
80
65
|
uiHierarchy?: 'disabled' | 'enabled' | DetoxUIHierarchyArtifactsPluginConfig;
|
81
66
|
|
82
67
|
[pluginId: string]: unknown;
|
@@ -96,11 +81,19 @@ declare global {
|
|
96
81
|
*/
|
97
82
|
exposeGlobals?: boolean;
|
98
83
|
/**
|
99
|
-
* By default,
|
84
|
+
* By default, Detox will uninstall and install the app upon the initialization.
|
100
85
|
* If you wish to reuse the existing app for a faster run, set the property to
|
101
86
|
* `false`.
|
102
87
|
*/
|
103
88
|
reinstallApp?: boolean;
|
89
|
+
/**
|
90
|
+
* If you wish to run multiple "detox test" commands in parallel,
|
91
|
+
* make sure they don't delete the shared lock file – only the
|
92
|
+
* first command should reset the lock file.
|
93
|
+
*
|
94
|
+
* @default false
|
95
|
+
*/
|
96
|
+
keepLockFile?: boolean;
|
104
97
|
};
|
105
98
|
launchApp?: 'auto' | 'manual';
|
106
99
|
cleanup?: {
|
@@ -108,6 +101,15 @@ declare global {
|
|
108
101
|
};
|
109
102
|
}
|
110
103
|
|
104
|
+
interface DetoxLoggerConfig {
|
105
|
+
level?: DetoxLogLevel;
|
106
|
+
/**
|
107
|
+
* @default 'sandbox'
|
108
|
+
*/
|
109
|
+
overrideConsole?: 'all' | 'sandbox' | 'none';
|
110
|
+
options?: BunyanDebugStreamOptions;
|
111
|
+
}
|
112
|
+
|
111
113
|
interface DetoxSessionConfig {
|
112
114
|
autoStart?: boolean;
|
113
115
|
debugSynchronization?: number;
|
@@ -115,7 +117,45 @@ declare global {
|
|
115
117
|
sessionId?: string;
|
116
118
|
}
|
117
119
|
|
118
|
-
|
120
|
+
interface DetoxTestRunnerConfig {
|
121
|
+
args?: {
|
122
|
+
/**
|
123
|
+
* The command to use for runner: 'jest', 'nyc jest',
|
124
|
+
*/
|
125
|
+
$0: string;
|
126
|
+
/**
|
127
|
+
* The positional arguments to pass to the runner.
|
128
|
+
*/
|
129
|
+
_?: string[];
|
130
|
+
/**
|
131
|
+
* Any other properties recognized by test runner
|
132
|
+
*/
|
133
|
+
[prop: string]: unknown;
|
134
|
+
};
|
135
|
+
/**
|
136
|
+
* Configuration of custom integration features
|
137
|
+
* between Detox and Jest
|
138
|
+
*/
|
139
|
+
jest?: {
|
140
|
+
/**
|
141
|
+
* Device init timeout
|
142
|
+
*/
|
143
|
+
initTimeout?: number | undefined;
|
144
|
+
reportSpecs?: boolean | undefined;
|
145
|
+
reportWorkerAssign?: boolean | undefined;
|
146
|
+
};
|
147
|
+
/**
|
148
|
+
* Retries count. Zero means a single attempt to run tests.
|
149
|
+
*/
|
150
|
+
retries?: number;
|
151
|
+
/**
|
152
|
+
* Custom handler to process --inspect-brk CLI flag.
|
153
|
+
* Use it when you rely on another test runner than Jest.
|
154
|
+
*/
|
155
|
+
inspectBrk?: boolean | ((config: DetoxTestRunnerConfig) => void);
|
156
|
+
}
|
157
|
+
|
158
|
+
type DetoxAppConfig = (DetoxBuiltInAppConfig | DetoxCustomAppConfig) & {
|
119
159
|
/**
|
120
160
|
* App name to use with device.selectApp(appName) calls.
|
121
161
|
* Can be omitted if you have a single app under the test.
|
@@ -127,8 +167,6 @@ declare global {
|
|
127
167
|
|
128
168
|
type DetoxDeviceConfig = DetoxBuiltInDeviceConfig | DetoxCustomDriverConfig;
|
129
169
|
|
130
|
-
type DetoxConfiguration = DetoxPlainConfiguration | DetoxAliasedConfiguration;
|
131
|
-
|
132
170
|
interface DetoxLogArtifactsPluginConfig {
|
133
171
|
enabled?: boolean;
|
134
172
|
keepOnlyFailedTestsArtifacts?: boolean;
|
@@ -168,9 +206,7 @@ declare global {
|
|
168
206
|
enabled?: boolean;
|
169
207
|
}
|
170
208
|
|
171
|
-
|
172
|
-
enabled?: boolean;
|
173
|
-
}
|
209
|
+
type DetoxBuiltInAppConfig = (DetoxIosAppConfig | DetoxAndroidAppConfig);
|
174
210
|
|
175
211
|
interface DetoxIosAppConfig {
|
176
212
|
type: 'ios.app';
|
@@ -189,29 +225,17 @@ declare global {
|
|
189
225
|
launchArgs?: Record<string, any>;
|
190
226
|
}
|
191
227
|
|
192
|
-
interface
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
testBinaryPath?: string;
|
197
|
-
launchArgs?: Record<string, any>;
|
228
|
+
interface DetoxCustomAppConfig {
|
229
|
+
type: string;
|
230
|
+
|
231
|
+
[prop: string]: unknown;
|
198
232
|
}
|
199
233
|
|
200
234
|
type DetoxBuiltInDeviceConfig =
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
| DetoxGenymotionCloudDriverConfig;
|
206
|
-
|
207
|
-
type DetoxPlainConfiguration = DetoxConfigurationOverrides & (
|
208
|
-
| (DetoxIosSimulatorDriverConfig & _DetoxAppConfigFragment)
|
209
|
-
| (DetoxIosNoneDriverConfig & _DetoxAppConfigFragment)
|
210
|
-
| (DetoxAttachedAndroidDriverConfig & _DetoxAppConfigFragment)
|
211
|
-
| (DetoxAndroidEmulatorDriverConfig & _DetoxAppConfigFragment)
|
212
|
-
| (DetoxGenymotionCloudDriverConfig & _DetoxAppConfigFragment)
|
213
|
-
| (DetoxCustomDriverConfig)
|
214
|
-
);
|
235
|
+
| DetoxIosSimulatorDriverConfig
|
236
|
+
| DetoxAttachedAndroidDriverConfig
|
237
|
+
| DetoxAndroidEmulatorDriverConfig
|
238
|
+
| DetoxGenymotionCloudDriverConfig;
|
215
239
|
|
216
240
|
interface DetoxIosSimulatorDriverConfig {
|
217
241
|
type: 'ios.simulator';
|
@@ -219,12 +243,6 @@ declare global {
|
|
219
243
|
bootArgs?: string;
|
220
244
|
}
|
221
245
|
|
222
|
-
interface DetoxIosNoneDriverConfig {
|
223
|
-
type: 'ios.none';
|
224
|
-
// TODO: check if we need it at all?
|
225
|
-
device?: string | Partial<IosSimulatorQuery>;
|
226
|
-
}
|
227
|
-
|
228
246
|
interface DetoxSharedAndroidDriverConfig {
|
229
247
|
forceAdbInstall?: boolean;
|
230
248
|
utilBinaryPaths?: string[];
|
@@ -239,8 +257,11 @@ declare global {
|
|
239
257
|
type: 'android.emulator';
|
240
258
|
device: string | { avdName: string };
|
241
259
|
bootArgs?: string;
|
242
|
-
gpuMode?: 'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest';
|
260
|
+
gpuMode?: 'auto' | 'host' | 'swiftshader_indirect' | 'angle_indirect' | 'guest' | 'off';
|
243
261
|
headless?: boolean;
|
262
|
+
/**
|
263
|
+
* @default true
|
264
|
+
*/
|
244
265
|
readonly?: boolean;
|
245
266
|
}
|
246
267
|
|
@@ -264,109 +285,127 @@ declare global {
|
|
264
285
|
|
265
286
|
type DetoxKnownDeviceType = DetoxBuiltInDeviceConfig['type'];
|
266
287
|
|
267
|
-
type
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
};
|
272
|
-
|
273
|
-
type DetoxAliasedConfiguration =
|
274
|
-
| DetoxAliasedConfigurationSingleApp
|
275
|
-
| DetoxAliasedConfigurationMultiApps;
|
288
|
+
type DetoxConfiguration = DetoxConfigurationCommon & (
|
289
|
+
| DetoxConfigurationSingleApp
|
290
|
+
| DetoxConfigurationMultiApps
|
291
|
+
);
|
276
292
|
|
277
|
-
interface
|
278
|
-
type?: never;
|
293
|
+
interface DetoxConfigurationSingleApp {
|
279
294
|
device: DetoxAliasedDevice;
|
280
|
-
app:
|
295
|
+
app: DetoxAliasedApp;
|
281
296
|
}
|
282
297
|
|
283
|
-
interface
|
284
|
-
type?: never;
|
298
|
+
interface DetoxConfigurationMultiApps {
|
285
299
|
device: DetoxAliasedDevice;
|
286
|
-
apps:
|
300
|
+
apps: DetoxAliasedApp[];
|
287
301
|
}
|
288
302
|
|
289
303
|
type DetoxAliasedDevice = string | DetoxDeviceConfig;
|
290
304
|
|
305
|
+
type DetoxAliasedApp = string | DetoxAppConfig;
|
306
|
+
|
291
307
|
// endregion DetoxConfig
|
292
308
|
|
293
|
-
|
294
|
-
|
295
|
-
device: Device;
|
296
|
-
element: ElementFacade;
|
297
|
-
waitFor: WaitForFacade;
|
298
|
-
expect: ExpectFacade;
|
299
|
-
by: ByFacade;
|
300
|
-
web: WebFacade;
|
301
|
-
}
|
309
|
+
interface DetoxExportWrapper {
|
310
|
+
readonly device: Device;
|
302
311
|
|
303
|
-
|
304
|
-
/**
|
305
|
-
* The setup phase happens inside detox.init(). This is the phase where detox reads its configuration, starts a server, loads its expection library and starts a simulator
|
306
|
-
*
|
307
|
-
* @param configOverride - this object is deep-merged with the selected Detox configuration from .detoxrc
|
308
|
-
* @example
|
309
|
-
* beforeAll(async () => {
|
310
|
-
* await detox.init();
|
311
|
-
* });
|
312
|
-
*/
|
313
|
-
init(configOverride?: Partial<DetoxConfig>, options?: DetoxInitOptions): Promise<void>;
|
312
|
+
readonly element: ElementFacade;
|
314
313
|
|
315
|
-
|
314
|
+
readonly waitFor: WaitForFacade;
|
316
315
|
|
317
|
-
|
316
|
+
readonly expect: ExpectFacade;
|
318
317
|
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
318
|
+
readonly by: ByFacade;
|
319
|
+
|
320
|
+
readonly web: WebFacade;
|
321
|
+
|
322
|
+
readonly DetoxConstants: {
|
323
|
+
userNotificationTriggers: {
|
324
|
+
push: 'push';
|
325
|
+
calendar: 'calendar';
|
326
|
+
timeInterval: 'timeInterval';
|
327
|
+
location: 'location';
|
328
|
+
};
|
329
|
+
userActivityTypes: {
|
330
|
+
searchableItem: string;
|
331
|
+
browsingWeb: string;
|
332
|
+
},
|
333
|
+
searchableItemActivityIdentifier: string;
|
334
|
+
};
|
329
335
|
|
330
336
|
/**
|
331
|
-
*
|
332
|
-
* or detox.init(). Use it only if you don't have another option.
|
333
|
-
* @internal
|
337
|
+
* Detox logger instance. Can be used for saving user logs to the general log file.
|
334
338
|
*/
|
335
|
-
|
336
|
-
}
|
339
|
+
readonly log: Logger;
|
337
340
|
|
338
|
-
interface DetoxInitOptions {
|
339
341
|
/**
|
340
|
-
*
|
341
|
-
* as global variables. If you want to control their initialization manually,
|
342
|
-
* set this property to `false`.
|
343
|
-
*
|
344
|
-
* This is useful when during E2E tests you also need to run regular expectations
|
345
|
-
* in Node.js. Jest's `expect` for instance, will not be overridden by Detox when
|
346
|
-
* this option is used.
|
342
|
+
* Detox tracer instance. Can be used for building timelines in Google Event Tracing format.
|
347
343
|
*/
|
348
|
-
|
344
|
+
readonly trace: Tracer;
|
345
|
+
|
349
346
|
/**
|
350
|
-
*
|
351
|
-
* If you wish to reuse the existing app for a faster run, set the property to
|
352
|
-
* `false`.
|
347
|
+
* @deprecated
|
353
348
|
*/
|
354
|
-
|
349
|
+
readonly traceCall: _TraceCallSignature;
|
350
|
+
}
|
351
|
+
|
352
|
+
/** @internal */
|
353
|
+
type _TraceEventArgs = Record<string, unknown>;
|
354
|
+
|
355
|
+
type TraceEvent = {
|
356
|
+
name?: string;
|
357
|
+
cat?: string;
|
358
|
+
cname?: string;
|
359
|
+
id?: number;
|
360
|
+
args?: _TraceEventArgs;
|
361
|
+
};
|
362
|
+
|
363
|
+
/**
|
364
|
+
* Trace a duration event before and after executing the action function
|
365
|
+
*
|
366
|
+
* @internal
|
367
|
+
*/
|
368
|
+
interface _TraceCallSignature {
|
369
|
+
<T>(event: string | TraceEvent, action: () => T): T;
|
370
|
+
<T>(event: string | TraceEvent, action: () => Promise<T>): Promise<T>;
|
371
|
+
}
|
372
|
+
|
373
|
+
/** @internal */
|
374
|
+
interface _TraceSectionSignature<T> {
|
375
|
+
(event?: string, args?: _TraceEventArgs): T;
|
376
|
+
(event: TraceEvent): T;
|
355
377
|
}
|
356
378
|
|
379
|
+
interface Tracer extends _TraceCallSignature {
|
380
|
+
readonly begin: _TraceSectionSignature<EndHandle<{ cname: string; args: _TraceEventArgs; }>>;
|
381
|
+
readonly end: _TraceSectionSignature<void>;
|
382
|
+
|
383
|
+
/** @deprecated */
|
384
|
+
readonly startSection: _TraceSectionSignature<void>;
|
385
|
+
/** @deprecated */
|
386
|
+
readonly endSection: _TraceSectionSignature<void>;
|
387
|
+
}
|
388
|
+
|
389
|
+
type Logger = {
|
390
|
+
readonly level: DetoxLogLevel;
|
391
|
+
|
392
|
+
fatal(context?: unknown, ...args: any[]): void;
|
393
|
+
error(context?: unknown, ...args: any[]): void;
|
394
|
+
warn(context?: unknown, ...args: any[]): void;
|
395
|
+
info(context?: unknown, ...args: any[]): void;
|
396
|
+
debug(context?: unknown, ...args: any[]): void;
|
397
|
+
trace(context?: unknown, ...args: any[]): void;
|
398
|
+
|
399
|
+
child(context?: Record<string, unknown>): Logger;
|
400
|
+
};
|
401
|
+
|
402
|
+
type DetoxLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
403
|
+
|
357
404
|
type Point2D = {
|
358
405
|
x: number,
|
359
406
|
y: number,
|
360
407
|
}
|
361
408
|
|
362
|
-
/**
|
363
|
-
* @deprecated
|
364
|
-
*/
|
365
|
-
type AppLaunchArgsOperationOptions = Partial<{
|
366
|
-
/** Changes the scope of the operation: transient or permanent app launch args */
|
367
|
-
permanent: boolean;
|
368
|
-
}>;
|
369
|
-
|
370
409
|
/**
|
371
410
|
* A construct allowing for the querying and modification of user arguments passed to an app upon launch by Detox.
|
372
411
|
*
|
@@ -414,20 +453,12 @@ declare global {
|
|
414
453
|
* // }
|
415
454
|
*/
|
416
455
|
modify(modifier: object): this;
|
417
|
-
/**
|
418
|
-
* @deprecated Use {@link AppLaunchArgs#shared} instead.
|
419
|
-
*/
|
420
|
-
modify(modifier: object, options: AppLaunchArgsOperationOptions): this;
|
421
456
|
|
422
457
|
/**
|
423
458
|
* Reset all app-specific launch arguments (back to an empty object).
|
424
459
|
* If you need to reset the shared launch args, use {@link AppLaunchArgs#shared}.
|
425
460
|
*/
|
426
461
|
reset(): this;
|
427
|
-
/**
|
428
|
-
* @deprecated Use {@link AppLaunchArgs#shared} instead.
|
429
|
-
*/
|
430
|
-
reset(options: AppLaunchArgsOperationOptions): this;
|
431
462
|
|
432
463
|
/**
|
433
464
|
* Get all currently set launch arguments (including shared ones).
|
@@ -435,10 +466,6 @@ declare global {
|
|
435
466
|
* Note: mutating the values inside the result object is pointless, as it is immutable.
|
436
467
|
*/
|
437
468
|
get(): object;
|
438
|
-
/**
|
439
|
-
* @deprecated Use {@link AppLaunchArgs#shared} instead.
|
440
|
-
*/
|
441
|
-
get(options: AppLaunchArgsOperationOptions): object;
|
442
469
|
}
|
443
470
|
|
444
471
|
/**
|
@@ -460,12 +487,10 @@ declare global {
|
|
460
487
|
* Holds the environment-unique ID of the device - namely, the adb ID on Android (e.g. emulator-5554) and the Mac-global simulator UDID on iOS,
|
461
488
|
* as used by simctl (e.g. AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE).
|
462
489
|
*
|
463
|
-
* The value will be undefined until the device is properly prepared (i.e. in detox.init())
|
464
490
|
*/
|
465
491
|
id: string;
|
466
492
|
/**
|
467
493
|
* Holds a descriptive name of the device. Example: emulator-5554 (Pixel_API_29)
|
468
|
-
* The value will be undefined until the device is properly prepared (i.e. in detox.init()).
|
469
494
|
*/
|
470
495
|
name: string;
|
471
496
|
|
@@ -510,6 +535,15 @@ declare global {
|
|
510
535
|
*/
|
511
536
|
launchApp(config?: DeviceLaunchAppConfig): Promise<void>;
|
512
537
|
|
538
|
+
/**
|
539
|
+
* Relaunch the app. Convenience method that calls {@link Device#launchApp}
|
540
|
+
* with { newInstance: true } override.
|
541
|
+
*
|
542
|
+
* @param config
|
543
|
+
* @see Device#launchApp
|
544
|
+
*/
|
545
|
+
relaunchApp(config?: Omit<DeviceLaunchAppConfig, 'newInstance'>): Promise<void>;
|
546
|
+
|
513
547
|
/**
|
514
548
|
* Access the user-defined launch-arguments predefined through static scopes such as the Detox configuration file and
|
515
549
|
* command-line arguments. This access allows - through dedicated methods, for both value-querying and
|
@@ -535,6 +569,7 @@ declare global {
|
|
535
569
|
* @see AppLaunchArgs
|
536
570
|
*/
|
537
571
|
appLaunchArgs: AppLaunchArgs;
|
572
|
+
|
538
573
|
/**
|
539
574
|
* Terminate the app.
|
540
575
|
*
|
@@ -899,11 +934,13 @@ declare global {
|
|
899
934
|
* @example await element(by.text('Product').and(by.id('product_name'));
|
900
935
|
*/
|
901
936
|
and(by: NativeMatcher): NativeMatcher;
|
937
|
+
|
902
938
|
/**
|
903
939
|
* Find an element by a matcher with a parent matcher
|
904
940
|
* @example await element(by.id('Grandson883').withAncestor(by.id('Son883')));
|
905
941
|
*/
|
906
942
|
withAncestor(parentBy: NativeMatcher): NativeMatcher;
|
943
|
+
|
907
944
|
/**
|
908
945
|
* Find an element by a matcher with a child matcher
|
909
946
|
* @example await element(by.id('Son883').withDescendant(by.id('Grandson883')));
|
@@ -917,6 +954,7 @@ declare global {
|
|
917
954
|
|
918
955
|
interface ExpectFacade {
|
919
956
|
(element: NativeElement): Expect;
|
957
|
+
|
920
958
|
(webElement: WebElement): WebExpect;
|
921
959
|
}
|
922
960
|
|
@@ -1011,6 +1049,7 @@ declare global {
|
|
1011
1049
|
* @example await expect(element(by.id('switch'))).toHaveToggleValue(true);
|
1012
1050
|
*/
|
1013
1051
|
toHaveToggleValue(value: boolean): R;
|
1052
|
+
|
1014
1053
|
/**
|
1015
1054
|
* Expect components like a Switch to have a value ('0' for off, '1' for on).
|
1016
1055
|
* @example await expect(element(by.id('UniqueId533'))).toHaveValue('0');
|
@@ -1047,6 +1086,7 @@ declare global {
|
|
1047
1086
|
* @example await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down');
|
1048
1087
|
*/
|
1049
1088
|
whileElement(by: NativeMatcher): NativeElement & WaitFor;
|
1089
|
+
|
1050
1090
|
// TODO: not sure about & WaitFor - check if we can chain whileElement multiple times
|
1051
1091
|
}
|
1052
1092
|
|
@@ -1072,6 +1112,7 @@ declare global {
|
|
1072
1112
|
*/
|
1073
1113
|
longPressAndDrag(duration: number, normalizedPositionX: number, normalizedPositionY: number, targetElement: NativeElement,
|
1074
1114
|
normalizedTargetPositionX: number, normalizedTargetPositionY: number, speed: Speed, holdDuration: number): Promise<void>;
|
1115
|
+
|
1075
1116
|
/**
|
1076
1117
|
* Simulate multiple taps on an element.
|
1077
1118
|
* @param times number of times to tap
|
@@ -1127,10 +1168,10 @@ declare global {
|
|
1127
1168
|
* @example await element(by.id('scrollView')).scroll(100, 'up');
|
1128
1169
|
*/
|
1129
1170
|
scroll(
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1171
|
+
pixels: number,
|
1172
|
+
direction: Direction,
|
1173
|
+
startPositionX?: number,
|
1174
|
+
startPositionY?: number
|
1134
1175
|
): Promise<void>;
|
1135
1176
|
|
1136
1177
|
/**
|
@@ -1138,7 +1179,7 @@ declare global {
|
|
1138
1179
|
* @example await element(by.id('scrollView')).scrollToIndex(10);
|
1139
1180
|
*/
|
1140
1181
|
scrollToIndex(
|
1141
|
-
|
1182
|
+
index: Number
|
1142
1183
|
): Promise<void>;
|
1143
1184
|
|
1144
1185
|
/**
|
@@ -1227,7 +1268,7 @@ declare global {
|
|
1227
1268
|
* // * on failure, to: <artifacts-location>/✗ Menu items should have Logout/tap on menu.png
|
1228
1269
|
* });
|
1229
1270
|
*/
|
1230
|
-
|
1271
|
+
takeScreenshot(name: string): Promise<string>;
|
1231
1272
|
|
1232
1273
|
/**
|
1233
1274
|
* Gets the native (OS-dependent) attributes of the element.
|
@@ -1245,7 +1286,7 @@ declare global {
|
|
1245
1286
|
* jestExpect(attributes.width).toHaveValue(100);
|
1246
1287
|
* })
|
1247
1288
|
*/
|
1248
|
-
|
1289
|
+
getAttributes(): Promise<IosElementAttributes | AndroidElementAttributes | { elements: IosElementAttributes[]; }>;
|
1249
1290
|
}
|
1250
1291
|
|
1251
1292
|
interface WebExpect<R = Promise<void>> {
|
@@ -1261,7 +1302,7 @@ declare global {
|
|
1261
1302
|
* @example
|
1262
1303
|
* await expect(web.element(by.web.id('UniqueId205'))).toHaveText('ExactText');
|
1263
1304
|
*/
|
1264
|
-
toHaveText(text: string): R
|
1305
|
+
toHaveText(text: string): R;
|
1265
1306
|
|
1266
1307
|
/**
|
1267
1308
|
* Expect the view to exist in the webview DOM tree.
|
@@ -1282,56 +1323,56 @@ declare global {
|
|
1282
1323
|
}
|
1283
1324
|
|
1284
1325
|
interface WebElementActions {
|
1285
|
-
tap(): Promise<void
|
1326
|
+
tap(): Promise<void>;
|
1286
1327
|
|
1287
1328
|
/**
|
1288
1329
|
* @param text to type
|
1289
1330
|
* @param isContentEditable whether its a ContentEditable element, default is false.
|
1290
1331
|
*/
|
1291
|
-
typeText(text: string, isContentEditable: boolean): Promise<void
|
1332
|
+
typeText(text: string, isContentEditable: boolean): Promise<void>;
|
1292
1333
|
|
1293
1334
|
/**
|
1294
1335
|
* At the moment not working on content-editable
|
1295
1336
|
* @param text to replace with the old content.
|
1296
1337
|
*/
|
1297
|
-
replaceText(text: string): Promise<void
|
1338
|
+
replaceText(text: string): Promise<void>;
|
1298
1339
|
|
1299
1340
|
/**
|
1300
1341
|
* At the moment not working on content-editable
|
1301
1342
|
*/
|
1302
|
-
clearText(): Promise<void
|
1343
|
+
clearText(): Promise<void>;
|
1303
1344
|
|
1304
1345
|
/**
|
1305
1346
|
* scrolling to the view, the element top position will be at the top of the screen.
|
1306
1347
|
*/
|
1307
|
-
scrollToView(): Promise<void
|
1348
|
+
scrollToView(): Promise<void>;
|
1308
1349
|
|
1309
1350
|
/**
|
1310
1351
|
* Gets the input content
|
1311
1352
|
*/
|
1312
|
-
getText(): Promise<string
|
1353
|
+
getText(): Promise<string>;
|
1313
1354
|
|
1314
1355
|
/**
|
1315
1356
|
* Calls the focus function on the element
|
1316
1357
|
*/
|
1317
|
-
focus(): Promise<void
|
1358
|
+
focus(): Promise<void>;
|
1318
1359
|
|
1319
1360
|
/**
|
1320
1361
|
* Selects all the input content, works on ContentEditable at the moment.
|
1321
1362
|
*/
|
1322
|
-
selectAllText(): Promise<void
|
1363
|
+
selectAllText(): Promise<void>;
|
1323
1364
|
|
1324
1365
|
/**
|
1325
1366
|
* Moves the input cursor / caret to the end of the content, works on ContentEditable at the moment.
|
1326
1367
|
*/
|
1327
|
-
moveCursorToEnd(): Promise<void
|
1368
|
+
moveCursorToEnd(): Promise<void>;
|
1328
1369
|
|
1329
1370
|
/**
|
1330
1371
|
* Running a script on the element
|
1331
1372
|
* @param script a method that accept the element as its first arg
|
1332
1373
|
* @example function foo(element) { console.log(element); }
|
1333
1374
|
*/
|
1334
|
-
runScript(script: string): Promise<any
|
1375
|
+
runScript(script: string): Promise<any>;
|
1335
1376
|
|
1336
1377
|
/**
|
1337
1378
|
* Running a script on the element that accept args
|
@@ -1445,25 +1486,6 @@ declare global {
|
|
1445
1486
|
languageAndLocale?: LanguageAndLocale;
|
1446
1487
|
}
|
1447
1488
|
|
1448
|
-
interface CircusTestEventListenerBase {
|
1449
|
-
handleTestEvent(event: any, state: any): Promise<void>;
|
1450
|
-
}
|
1451
|
-
|
1452
|
-
interface DetoxCircus {
|
1453
|
-
/**
|
1454
|
-
* A get function that Enables access to this instance (single in each worker's scope)
|
1455
|
-
*/
|
1456
|
-
getEnv(): {
|
1457
|
-
/**
|
1458
|
-
* Registers a listener such as an adapter or reporter
|
1459
|
-
* @example
|
1460
|
-
* detoxCircus.getEnv().addEventsListener(adapter)
|
1461
|
-
* detoxCircus.getEnv().addEventsListener(assignReporter)
|
1462
|
-
*/
|
1463
|
-
addEventsListener(listener: CircusTestEventListenerBase): void
|
1464
|
-
};
|
1465
|
-
}
|
1466
|
-
|
1467
1489
|
// Element Attributes Shared Among iOS and Android
|
1468
1490
|
interface ElementAttributes {
|
1469
1491
|
/**
|