Skip to content

Commit

Permalink
chore(react-native): add examples to react native and detox schema (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi authored and sidmonta committed Apr 2, 2022
1 parent 7e65405 commit d2667b9
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 34 deletions.
16 changes: 15 additions & 1 deletion docs/generated/api-detox/executors/test.md
Expand Up @@ -43,6 +43,8 @@ Target which builds the application

Type: `string`

Possible values: `enabled`, `disabled`

[iOS Only] Capture \*.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls.

### cleanup
Expand All @@ -63,7 +65,7 @@ Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js

Alias(es): d

Type: `string`
Type: `boolean`

Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.

Expand Down Expand Up @@ -117,6 +119,8 @@ Alias(es): l

Type: `string`

Possible values: `fatal`, `error`, `warn`, `info`, `verbose`, `trace`

Log level: fatal, error, warn, info, verbose, trace

### noColor
Expand All @@ -129,24 +133,32 @@ Disable colors in log output

Type: `string`

Possible values: `failing`, `all`, `none`

Save logs during each test to artifacts directory. Pass "failing" to save logs of failing tests only.

### recordPerformance

Type: `string`

Possible values: `all`, `none`

[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory.

### recordTimeline

Type: `string`

Possible values: `all`, `none`

[Jest Only] Record tests and events timeline, for visual display on the chrome://tracing tool.

### recordVideos

Type: `string`

Possible values: `failing`, `all`, `none`

Save screen recordings of each test to artifacts directory. Pass "failing" to save recordings of failing tests only.

### retries
Expand All @@ -173,6 +185,8 @@ Test runner config file, defaults to 'e2e/mocha.opts' for mocha and 'e2e/config.

Type: `string`

Possible values: `manual`, `failing`, `all`, `none`

Save screenshots before and after each test to artifacts directory. Pass "failing" to save screenshots of failing tests only.

### useCustomLogger
Expand Down
2 changes: 0 additions & 2 deletions docs/generated/api-react-native/executors/run-ios.md
Expand Up @@ -57,8 +57,6 @@ Explicitly set the Xcode scheme to use

### simulator

Default: `iPhone X`

Type: `string`

Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone X (12.1)"
Expand Down
52 changes: 26 additions & 26 deletions packages/detox/src/executors/test/schema.d.ts
@@ -1,31 +1,31 @@
// options from https://github.com/wix/Detox/blob/master/docs/APIRef.DetoxCLI.md#test
// detox test args: https://github.com/wix/Detox/blob/master/detox/local-cli/utils/testCommandArgs.js
export interface DetoxTestOptions {
configPath: string;
configPath?: string;
detoxConfiguration: string;
runnerConfig: string;
deviceName: string;
loglevel: string;
debugSynchronization: string;
artifactsLocation: string;
recordLogs: 'failing' | 'all' | 'none';
takeScreenshots: 'manual' | 'failing' | 'all' | 'none';
recordVideos: 'failing' | 'all' | 'none';
recordPerformance: 'all' | 'none';
recordTimeline: 'all' | 'none';
captureViewHierarchy: 'enabled' | 'disabled';
retries: number;
resuse: boolean;
cleanup: boolean;
workers: number;
jestReportSpecs: boolean;
headeless: boolean;
gpu: boolean;
deviceLauchArgs: string;
appLaunchArgs: string;
noColor: boolean;
useCutsomeLogger: boolean;
forceAdbInstall: boolean;
inspectBrk: boolean;
buildTarget: string;
runnerConfig?: string;
deviceName?: string;
loglevel?: string;
debugSynchronization?: boolean;
artifactsLocation?: string;
recordLogs?: 'failing' | 'all' | 'none';
takeScreenshots?: 'manual' | 'failing' | 'all' | 'none';
recordVideos?: 'failing' | 'all' | 'none';
recordPerformance?: 'all' | 'none';
recordTimeline?: 'all' | 'none';
captureViewHierarchy?: 'enabled' | 'disabled';
retries?: number;
resuse?: boolean;
cleanup?: boolean;
workers?: number;
jestReportSpecs?: boolean;
headeless?: boolean;
gpu?: boolean;
deviceLauchArgs?: string;
appLaunchArgs?: string;
noColor?: boolean;
useCutsomeLogger?: boolean;
forceAdbInstall?: boolean;
inspectBrk?: boolean;
buildTarget?: string;
}
17 changes: 15 additions & 2 deletions packages/detox/src/executors/test/schema.json
Expand Up @@ -7,7 +7,13 @@
"detoxConfiguration": {
"type": "string",
"description": "Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it",
"alias": "C"
"alias": "C",
"examples": [
"ios.sim.debug",
"ios.sim.release",
"android.emu.debug",
"android.emu.release"
]
},
"buildTarget": {
"type": "string",
Expand All @@ -30,11 +36,12 @@
},
"loglevel": {
"type": "string",
"enum": ["fatal", "error", "warn", "info", "verbose", "trace"],
"description": "Log level: fatal, error, warn, info, verbose, trace",
"alias": "l"
},
"debugSynchronization": {
"type": "string",
"type": "boolean",
"description": "Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.",
"alias": "d"
},
Expand All @@ -45,26 +52,32 @@
},
"recordLogs": {
"type": "string",
"enum": ["failing", "all", "none"],
"description": "Save logs during each test to artifacts directory. Pass \"failing\" to save logs of failing tests only."
},
"takeScreenshots": {
"type": "string",
"enum": ["manual", "failing", "all", "none"],
"description": "Save screenshots before and after each test to artifacts directory. Pass \"failing\" to save screenshots of failing tests only. "
},
"recordVideos": {
"type": "string",
"enum": ["failing", "all", "none"],
"description": "Save screen recordings of each test to artifacts directory. Pass \"failing\" to save recordings of failing tests only."
},
"recordPerformance": {
"type": "string",
"enum": ["all", "none"],
"description": "[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory."
},
"recordTimeline": {
"type": "string",
"enum": ["all", "none"],
"description": "[Jest Only] Record tests and events timeline, for visual display on the chrome://tracing tool."
},
"captureViewHierarchy": {
"type": "string",
"enum": ["enabled", "disabled"],
"description": "[iOS Only] Capture *.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls."
},
"retries": {
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/src/executors/run-android/schema.json
Expand Up @@ -9,7 +9,8 @@
"variant": {
"type": "string",
"description": "Specify your app's build variant (e.g. debug, release).",
"default": "debug"
"default": "debug",
"examples": ["debug", "release"]
},
"appId": {
"type": "string",
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/src/executors/run-ios/schema.json
Expand Up @@ -9,7 +9,8 @@
"xcodeConfiguration": {
"type": "string",
"description": "Explicitly set the Xcode configuration to use",
"default": "Debug"
"default": "Debug",
"examples": ["Debug", "Release"]
},
"scheme": {
"type": "string",
Expand All @@ -18,7 +19,7 @@
"simulator": {
"type": "string",
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone X (12.1)\"",
"default": "iPhone X"
"examples": ["iPhone X"]
},
"device": {
"type": "string",
Expand Down

0 comments on commit d2667b9

Please sign in to comment.