This project is a simple project to demonstrate how we can develop tests using Spectron for Electron apps.
- node >= 12.x
- npm >= 6.x
- 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();
}Install the dependencies:
npm installCompile the TS code:
npm run buildRun tests:
npm run testsAfter running the tests we can see the results using Allure report or Mochawesome.
Using Allure:
npm run report:generate
npm run report:openTo use Mochawesome you can open ./reports/mochawesome/mochawesome.html
Check code's format after some changes in the code:
npm run format