Debian Codegraph @

node/@patternfly/react-core/src/helpers/OUIA/OUIA.md

raw
1 ---
2 id: Open UI Automation
3 section: developer-guides
4 ---
5 import { Fragment } from 'react';
6
7 ## About Open UI Automation
8
9 Open UI Automation (OUIA) is a specification of certain key guidelines to follow when creating a new
10 web framework or application. The goal is to ease the burden of creating and maintaining automated
11 testing environments. OUIA standardizes some HTML attributes and web page
12 behavior. It helps to create trivial and unambiguous locators of the elements in the DOM for
13 various automated test suites.
14
15 ### Why not use `id` or `ARIA`?
16
17 `ARIA` is designed as an accessibility specification, and it doesn't account for aspects that are crucial
18 for automation such as a component type. The `id` attribute might be reserved by some front-end code, and
19 there might be restrictions on changing it. Having a separate id attribute makes it application and
20 framework independent. Developers and testers have a contract that these attributes are designed for
21 UI automation.
22
23 ### Specification parts
24
25 The following blocks exist in the specification:
26
27 * `OUIA:Component` - components and component frameworks
28 * `OUIA:Page` - page identification
29 * `OUIA:PageSafe` - interaction safety
30
31 You can find the complete description on the [OUIA website](https://ouia.readthedocs.io).
32
33 ### Usage
34
35 PatternFly generates a `data-ouia-component-type` attribute for selected components automatically
36 based on the name. For example, the `data-ouia-component-type` attribute for the
37 [button component](/components/button) is `PF6/Button`. The id of the `data-ouia-component-id`
38 attribute is random by default. To specify the concrete id, add an `ouiaId` prop to the
39 component.
40
41 ### Example
42
43 ```ts file="examples/OuiaExample.tsx"
44
45 ```
46
47 ## OUIA-compliant PatternFly 5 components
48
49 ### react-core package
50
51 * [Alert](/components/alert)
52 * [Breadcrumb](/components/breadcrumb)
53 * [Button](/components/button)
54 * [Card](/components/card)
55 * [Checkbox](/components/forms/checkbox)
56 * [Chip](/components/chip)
57 * [Content](/components/content)
58 * [Dropdown](/components/menus/dropdown)
59 * [DropdownItem](/components/menus/dropdown)
60 * [FormSelect](/components/forms/form-select)
61 * [Menu](/components/menus/menu)
62 * [Modal](/components/modal)
63 * [Navigation](/components/navigation)
64 * [NavExpandable](/components/navigation)
65 * [NavItem](/components/navigation)
66 * [Pagination](/components/pagination)
67 * [Radio](/components/forms/radio)
68 * [Select](/components/menus/select)
69 * [Switch](/components/switch)
70 * [TabContent](/components/tabs)
71 * [Tabs](/components/tabs)
72 * [TextInput](/components/forms/text-input)
73 * [Title](/components/title)
74 * [Toolbar](/components/toolbar)
75
76 ### react-table package
77
78 * [Table](/components/table)
79 * [Tr](/components/table)