Skip to main content
Version: 9.0.0

Universal API in Test Maker

Test Maker introduces the concept of a Universal API, providing a standardized and adaptable interface for writing tests. This innovative approach allows you to follow Test Maker conventions and craft your tests using a universal set of methods and properties. The power of the Universal API lies in its adapter-independent nature, offering seamless transitions between different adapters without requiring code changes.

What is the Universal API?

The Universal API in Test Maker ensures that its methods and properties are adapter-independent. Whether you switch between adapters like Playwright or utilize different adapters for web and mobile, your test code remains consistent, provided the action is supported by the chosen adapter. For instance, you can write code for a web adapter and effortlessly use it with a mobile web adapter, maintaining the same logic and structure.

Accessing Test Maker Methods

Discovering and utilizing Test Maker methods is intuitive, especially when using TypeScript. Simply type "I." (controller) to access the Universal API. TypeScript's IntelliSense functionality will display the available Test Maker methods, making it easy to explore and choose the right actions for your tests.

Universal API

The Universal API is categorized into three main groups:

1. Selector API

Selector("#id").visible

Empower your tests with the Selector API, enabling you to locate and interact with elements based on various criteria such as IDs, classes, or visibility.

2. Controller API

await I.click("#id")

Execute actions on elements using the Controller API. This category covers interactions like clicking, typing, or other user interactions to navigate through your application.

3. Assertion API

await I.expect().toEqual().or.toBeVisible()

Leverage the Assertion API to validate expected outcomes, ensuring your tests deliver accurate and reliable results. Perform assertions like checking equality or verifying visibility.

Keywords for Local Configuration

In addition to the main API categories, Test Maker introduces keywords that enable local configuration within your feature specifications:

Feature("Example Feature").timeout(Infinity)

Tailor your tests with keywords like timeout to define local configurations specific to each feature, offering flexibility and control.

The Universal API in Test Maker empowers developers to write tests with consistency, adaptability, and ease of maintenance, making it a valuable asset in any testing workflow.