react-native-windows/packages/@react-native-windows/automation-commands
Andrew 9e5b127ffb applying package updates ***NO_CI*** 2024-10-08 12:26:38 -07:00
..
src
.eslintrc.js
.gitignore
CHANGELOG.json
CHANGELOG.md
README.md
package.json
tsconfig.json

README.md

@react-native-windows/automation-commands

@react-native-windows/automation-commands provides built-in commands that may be used with @react-native-windows/automation-channel to make it easier to test your application.

This package is a work in progress

Adding to your application

TBD

Commands

dumpVisualTree

The dumpVisualTree command creates a JSON object corresponding to the XAML tree under a given testID. This can be used in conjunction with snapshot testing to validate that your native UI looks how you could expect.

import {dumpVisualTree} from '@react-native-windows/automation-commands';

test('Widget', async () => {
  const dump = await dumpVisualTree('widget-test-id');
  expect(dump).toMatchSnapshot();
});

Options

TBD