# Gameface E2E Released

> Coherent Labs solves complex problems to help designers, developers, and technical directors create easily stunning and high-performance game UI.

> Documentation index: https://coherent-labs.com/llms.txt lists every page of this documentation as Markdown; the full text is in https://coherent-labs.com/llms-full.txt.

Source: https://coherent-labs.com/blog/news/e2e-testing-framework/

## Gameface E2E Released

news

5/27/2025

Kaloyan Geshev

1. What is Gameface E2E?
2. Features of Gameface E2E
3. Getting Started with Gameface E2E
4. Writing Tests
5. Running the tests
6. Conclusion

We are excited to announce the release of our new end-to-end (E2E) testing framework for Gameface. This powerful tool is designed to streamline the testing process for your game UI, ensuring that everything works as expected before you launch.

## What is Gameface E2E?

Gameface E2E is a framework designed for creating and running end-to-end tests for your game UI within Gameface. It simplifies the automation of UI testing, ensuring your interface functions correctly in various scenarios.

Built on the `DevTools` protocol, Gameface E2E integrates seamlessly with Gameface, allowing you to incorporate it into your development workflow effortlessly and begin testing your UI immediately.

## Features of Gameface E2E

Gameface E2E offers a variety of features to help you efficiently test your game UI:

- **Automated Testing**: Simulate user interactions like clicking, typing, scrolling, and menu navigation to validate your UI’s behavior in different situations.
- **Parallel Test Execution**: Run multiple tests concurrently to accelerate the testing process, especially beneficial for projects with extensive UI components.
- **Intuitive API**: The framework provides a straightforward and developer-friendly API, enabling quick test creation without requiring deep technical expertise.
- **Customizable Configuration**: Easily set up and tailor the framework to meet your specific testing requirements.
- **Mock Data Testing**: Test your UI with mocked game data to ensure it performs correctly under various input scenarios.

## Getting Started with Gameface E2E

The Gameface E2E testing framework is available on [npm ](https://www.npmjs.com/package/gameface-e2e). You can install it using the following command:

```shell
npm install gameface-e2e --save-dev
```

Alternatively, you can install it globally:

```shell
npm install gameface-e2e -g
```

Once installed, you can begin creating tests using the framework’s API. Detailed documentation and API references are available [here ](https://frontend-tools.coherent-labs.com/e2e/getting-started/).

To help you get started, the package includes a collection of example tests located in the `examples` folder.

## Writing Tests

Tests are written in `.spec` files using the framework’s API and the [Mocha ](https://mochajs.org/)syntax.

Here is an example of a test file:

```javascript
describe("Test my UI", () => {
    it("Should display the correct text", async () => {
        const element = await gf.get('.my-element');
        const text = await element.text();
        assert.equal(text, 'Hello, World!');
    });

    it("Should update the text when clicked", async () => {
        const btn = await gf.get('.my-button');
        await btn.click();
        const element = await gf.get('.my-element');
        const text = await element.text();
        assert.equal(text, 'Hello, Gameface!');
    });
});
```

## Running the tests

To run your tests, you can use the following command:

```shell
npx gameface-e2e --gamefacePath=${PATH_TO_PLAYER_EXE} --tests=${PATH_TO_SPEC_FILES}
```

or if you have installed the framework globally:

```shell
gameface-e2e --gamefacePath=${PATH_TO_PLAYER_EXE} --tests=${PATH_TO_SPEC_FILES}
```

Where `${PATH_TO_PLAYER_EXE}` is the path to the Gameface player executable and `${PATH_TO_SPEC_FILES}` is the path to your test files.

To simplify the command, you can create a configuration file in the root directory of your project. Name the file `gameface-e2e.config.js` and include the following content:

```javascript
module.exports = {
    tests: "examples/**/*.spec.js",
    gamefacePath: "C:/Gameface/Player/Player.exe"
}
```

After setting up the configuration file, you can simply execute the following command to run your tests:

```shell
npx gameface-e2e
```

## Conclusion

The Gameface E2E testing framework is a powerful tool that can help you ensure the quality and reliability of your game UI. With its simple API, automated testing capabilities, and seamless integration with Gameface, you can easily write and run tests to verify that your UI behaves as expected.

You can find the full documentation of the framework and its API [here ](https://frontend-tools.coherent-labs.com/e2e/getting-started/).

## On this page
