Skip to content

Commit a6a203b

Browse files
committed
chore: update docs
1 parent 6ad70ec commit a6a203b

3 files changed

Lines changed: 25 additions & 19 deletions

File tree

packages/ui/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ Queries for all elements by accessibility label without throwing. Returns an emp
101101
Captures a screenshot of the entire app window, a specific element, or a custom region.
102102
Returns a ScreenshotResult with PNG data, or null if capture fails.
103103

104+
> **Warning**: If you are capturing screenshots of elements that extend beyond the screen boundaries (e.g., large scroll views or absolutely positioned views that are partially off-screen), you must disable view flattening in your configuration by setting `disableViewFlattening: true` in your `rn-harness.config.mjs` file.
105+
104106
### `userEvent`
105107

106108
Provides methods to simulate user interactions.

website/src/docs/getting-started/configuration.mdx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ For Expo projects, the `entryPoint` should be set to the path specified in the `
7878

7979
## All Configuration Options
8080

81-
| Option | Description |
82-
| :--- | :--- |
83-
| `entryPoint` | **Required.** Path to your React Native app's entry point file. |
84-
| `appRegistryComponentName` | **Required.** Name of the component registered with AppRegistry. |
85-
| `runners` | **Required.** Array of test runners (at least one required). |
86-
| `defaultRunner` | Default runner to use when none specified. |
87-
| `bridgeTimeout` | Bridge timeout in milliseconds (default: `60000`). |
88-
| `bundleStartTimeout` | Bundle start timeout in milliseconds (default: `15000`). |
89-
| `maxAppRestarts` | Maximum number of app restarts when app fails to report ready (default: `2`). |
90-
| `resetEnvironmentBetweenTestFiles` | Reset environment between test files (default: `true`). |
91-
| `webSocketPort` | Web socket port for bridge communication (default: `3001`). |
92-
| `detectNativeCrashes` | Detect native app crashes during test execution (default: `true`). |
93-
| `crashDetectionInterval` | Interval in milliseconds to check for native crashes (default: `500`). |
94-
| `coverage` | Coverage configuration object. |
95-
| `coverage.root` | Root directory for coverage instrumentation (default: `process.cwd()`). |
96-
| `forwardClientLogs` | Forward console logs from the app to the terminal (default: `false`). |
97-
81+
| Option | Description |
82+
| :--------------------------------- | :---------------------------------------------------------------------------- |
83+
| `entryPoint` | **Required.** Path to your React Native app's entry point file. |
84+
| `appRegistryComponentName` | **Required.** Name of the component registered with AppRegistry. |
85+
| `runners` | **Required.** Array of test runners (at least one required). |
86+
| `defaultRunner` | Default runner to use when none specified. |
87+
| `bridgeTimeout` | Bridge timeout in milliseconds (default: `60000`). |
88+
| `bundleStartTimeout` | Bundle start timeout in milliseconds (default: `15000`). |
89+
| `maxAppRestarts` | Maximum number of app restarts when app fails to report ready (default: `2`). |
90+
| `resetEnvironmentBetweenTestFiles` | Reset environment between test files (default: `true`). |
91+
| `webSocketPort` | Web socket port for bridge communication (default: `3001`). |
92+
| `detectNativeCrashes` | Detect native app crashes during test execution (default: `true`). |
93+
| `crashDetectionInterval` | Interval in milliseconds to check for native crashes (default: `500`). |
94+
| `disableViewFlattening` | Disable view flattening in React Native (default: `false`). |
95+
| `coverage` | Coverage configuration object. |
96+
| `coverage.root` | Root directory for coverage instrumentation (default: `process.cwd()`). |
97+
| `forwardClientLogs` | Forward console logs from the app to the terminal (default: `false`). |
9898

9999
## Test Runners
100100

@@ -276,5 +276,3 @@ Without specifying `coverageRoot`, babel-plugin-istanbul may skip instrumenting
276276
:::tip When to use coverageRoot
277277
Set `coverageRoot` when you notice 0% coverage in your reports or when source files are not being instrumented for coverage. This commonly occurs in create-react-native-library projects and other monorepo setups.
278278
:::
279-
280-

website/src/docs/guides/ui-testing.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ test('screenshot with custom options', async () => {
150150

151151
You can capture screenshots of specific elements instead of the entire screen:
152152

153+
:::warning
154+
If you are capturing screenshots of elements that extend beyond the screen boundaries, you must disable view flattening in your configuration to ensure the entire element can be rendered.
155+
156+
This can be done by setting `disableViewFlattening: true` in your `rn-harness.config.mjs` file.
157+
:::
158+
153159
```typescript
154160
test('capture specific element', async () => {
155161
await render(

0 commit comments

Comments
 (0)