@atomic-testing/core
v0.98.0
Published
Core library for atomic-testing
Readme
@atomic-testing/core
Core utilities that power the entire Atomic Testing ecosystem. The package defines the primitives used to model scenes, locate elements and interact with components across different test environments.
Fastest start: run
npm create atomic-testing@latestto scaffold a working test setup — runner config, an example component, itsScenePartand a passing test — into an existing project.
Atomic Testing is designed to offer a consistent way to interact with third-party or first-party components across DOM and end-to-end tests. The core focuses on reusability, composability, and adaptability so the same tests can run in React, Vue, Playwright, Cypress and more.
Key Features
- Component Drivers – programmatically interact with UI components. Drivers expose high level actions like clicking a button or reading a value.
- Locators – find elements using helpers such as
byDataTestIdorbyRole. - Scene Parts – describe the pieces of a page or widget as a map of drivers.
- Test Engine – renders a scene and provides access to all defined parts so tests can remain agnostic to the underlying framework.
Example
import { TextFieldDriver, ButtonDriver } from '@atomic-testing/component-driver-mui-v6';
import { byDataTestId, ScenePart } from '@atomic-testing/core';
import { createTestEngine } from '@atomic-testing/react-19';
import { Login } from './Login';
const loginScenePart = {
username: { locator: byDataTestId('username'), driver: TextFieldDriver },
password: { locator: byDataTestId('password'), driver: TextFieldDriver },
submit: { locator: byDataTestId('submit'), driver: ButtonDriver },
} satisfies ScenePart;
const engine = createTestEngine(<Login />, loginScenePart);
await engine.parts.username.setValue('alice');
await engine.parts.password.setValue('secret');
await engine.parts.submit.click();
await engine.cleanUp();Refer to the documentation for detailed guides
and more examples. A complete signup form example can be found under
examples/example-mui-signup-form.
Public API & stability
The stable surface of this package is its . barrel exports, frozen under
SemVer and machine-checked by the committed API Extractor
report at etc/core.api.md. Exports tagged @internal are
not part of that guarantee. See the 1.0 API freeze & evolution policy.
