Skip to content

WarleyGabriel/e2e-tests-spectron-example

Repository files navigation

Action Status

E2E tests with Spectron and Mocha

This project is a simple project to demonstrate how we can develop tests using Spectron for Electron apps.

Requirements

  1. node >= 12.x
  2. npm >= 6.x
  3. Todolist == 0.28.1

Make sure that you have already installed Todolist on your machine.

If you use MacOS, after installing the app you have to open it, otherwise, MacOS will block the test execution.
After this step, you can set the app's path on ./test/hooks.ts line 6;

async startApp() {
    const app = await new Application({
        // On my machine TodoList is in this path
        path: '/Applications/Todolist.app/Contents/MacOS/Todolist',
    });
    return app.start();
}

Getting started

Install the dependencies:

npm install

Compile the TS code:

npm run build

Run tests:

npm run tests

Reports

After running the tests we can see the results using Allure report or Mochawesome.

Using Allure:

npm run report:generate
npm run report:open

To use Mochawesome you can open ./reports/mochawesome/mochawesome.html

Contributing

Check code's format after some changes in the code:

npm run format

About

E2E Tests with Spectron and Mocha

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published