Skip to main content

API overview

Locator

In a nutshell, locators represent a way to find element on a page or within a test element.

LocatorDescription
byAttribute(name, value)Locate element by attribute
byChecked(checked)Locate checkbox which is checked, usually it can be chained with checkbox locator
byCssClass(className)Locate by CSS class name. Locate by CSS class is not recommended because it is not reliable and can be changed easily.
byCssSelector(selector)Locate by CSS selector.
byDataTestId(dataTestId)Locate by data-testid attribute.
byInputType(type)Locate by input element by its type, such as text, radio, checkbox etc.
byLinkedElement()(Experimental) A complex locator where the element is located through matching another known element's attribute value
byName(name)Locate by the value of name attribute.
byRole(role)Locate by the value of role attribute.
byTagName(tagName)Locate by HTML tag name (not recommended).
byValue(value)Locate by the value of value attribute

Component Drivers

Raw HTML components

Package: @atomic-testing/component-driver-html

DriverDescription
HTMLAnchorDriverDriver for <a> elements
HTMLButtonDriverDriver for <button> or any clickable elements
HTMLCheckboxDriverDriver for <input type="checkbox"> elements
HTMLCheckboxGroupDriverDriver for a group of HTML checkboxes, ideal for multiselection
HTMLElementDriverDriver for any HTML element
HTMLHiddenInputDriverDriver for <input type="hidden"> elements
HTMLRadioButtonGroupDriverDriver for a group of HTML radio buttons
HTMLSelectDriverDriver for <select> element, support both single and multiple selection
HTMLTextInputDriverDriver for <input type="text"> elements
HTMLTextAreaDriverDriver for <textarea> elements

MUI V5 components

Package: @atomic-testing/component-driver-mui-v5

Test examples can be found in the example folder under component-driver-mui-v5-test package

DriverDescription
AccordionDriverDriver for Accordion component
AlertDriverDriver for Alert component
AutocompleteDriverDriver for Autocomplete component (single selection only, multiple selection planned)
BadgeDriverDriver for Badge component
DateRangePickerDriverDriver for DateRangePicker component
DesktopDatePickerDriverDriver for DesktopDatePicker component
MobileDatePickerDriverDriver for MobileDatePicker component
TimePickerDriverDriver for TimePicker component
DateTimePickerDriverDriver for DateTimePicker component
ButtonDriverDriver for Button or any clickable component
CheckboxDriverDriver for Checkbox component
ChipDriverDriver for Chip component
FabDriverDriver for Floating Action Button component
DataGridProDriver for DataGrid/DataGridPro component
DialogDriverDriver for Dialog component
MenuDriverDriver for Menu component
InputDriverDriver for Input component and its variants
RatingDriverDriver for Rating component
SelectDriverDriver for Select component
SliderDriverDriver for Slider component
SnackbarDriverDriver for Snackbar component
SwitchDriverDriver for Switch component
TextFieldDriverDriver for TextField component, supports single-line, multiline and selection TextField variants