AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    Administration interface basicsDevelopers and adminsBusiness usersChangelogGlossary
  • Guides
    Welcome to Xperience by KenticoAdministration interface basicsCustomer journeysDigital marketingConfigurationDevelopmentArchitectureUpgrade to Xperience by Kentico
  • Training
    For AdminsFor Business usersFor DevelopersFor Solution architects
  • API Examples
    ConfigurationContent managementDevelopmentDigital marketing
  • Changelog
    Documentation updatesSecurity advisories
  1. Home
  2. Developers and admins
  3. Customization
  4. Extend the administration interface
  5. Administration interface UI tests

Administration interface UI tests


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

UI tests, or user interface tests, are a type of software testing that checks whether the user interface of an application or system behaves as expected.

UI tests can be performed manually or automated. Manual testing involves a human tester going through individual scenarios in the application's user interface, and interacting with the controls and elements to verify their behavior. Automated testing, on the other hand, involves using software tools to automate the testing process.

This page focuses on the automated aspect of UI testing in Xperience, specifically in the administration interface. Writing UI tests is a good practice when introducing customizations or changes to the administration UI. Failing tests can help discover incorrect behavior early in development and mitigate regression in existing functionality.

UI test support in the admin UI

To facilitate the creation of UI tests, HTML elements in the admin UI have a data-testid attribute that contains a static identifier of the component. This identifier is identical for each instance of the same component on a page. For example:

As you can see, all of the application tile components have identical data-testid attribute values. This allows UI tests to select desired elements that could otherwise only be identified via a random string generated by React.

While the use of the data-testid attribute is supported in the admin UI for testing purposes, we do not guarantee its stability across releases. These attributes may change without notice based on internal development needs.

The data-testid attribute is generated via a dataTestId prop on Xperience components. Using the Input component from \@kentico/xperience\-admin\-components as an example:

JSPopulating data-testid
import { Input } from '@kentico/xperience-admin-components';

...

<Input markAsRequired={props.required}
                    invalid={props.invalid}
                    label={props.label}
                    value={name}
                    onChange={onNameChange}
                    disabled={props.disabled}
                    dataTestId="cool-input" />

The Input component when used as shown above, renders with data-testid="cool-input".

Supported testing flows

The admin UI currently supports only end-to-end (E2E) testing. Other testing strategies, such as Component testing, are not officially supported or documented at this time.

Recommended testing frameworks

We recommend using Cypress or Playwright to UI test the Xperience administration interface.

Cypress

Cypress is a modern, open-source, JavaScript-based testing framework designed for E2E testing of web applications. See the Cypress documentation⁠ (opens in a new tab) for a general introduction and overview of the framework.

You can find detailed instructions for installing Cypress⁠ (opens in a new tab) and writing your first E2E test⁠ (opens in a new tab) in their official guides.

Playwright

Playwright is a modern, open-source framework developed by Microsoft for E2E testing of web applications across multiple browsers. See the Playwright documentation⁠ (opens in a new tab) for a general introduction and overview of the framework.

You can find detailed instructions for installing Playwright⁠ (opens in a new tab) and writing your first E2E test⁠ (opens in a new tab) in the official documentation.