spectron-typescript-starter
spectron-typescript-starter copied to clipboard
Spectron TypeScript Starter for e2e testing electron applications
spectron-typescript-starter
Spectron TypeScript Starter for e2e testing electron applications.
Supports:
- electron 3+
- Typescript 2.9.x
- Spectron 4.x (webdriverio under the hood)
Starter use:
-
async
/await
-
page objects
pattern
Project sctructure
src
-- folder for your project's electron source code (contains electron typescript starter: https://github.com/electron/electron-quick-start-typescript)
test
-- folder for tests
test/helpers
-- helpers
test/po
-- page objects
test/specs
-- your specs (tests)
mocha.opts
-- mocha config for test execution
mocha-allure.opts
-- mocha config for test execution with allure reporter
Preconditions
install dependencies
$ npm install
build electron project
$ npm run build
Run tests
run e2e tests with mocha reporter
$ npm run test:e2e
Allure
preconditions
your need to install allure-commandline
for using allure:
$ npm install -g allure-commandline
run tests with allure reporter
$ npm run test:e2e:allure
generate allure reports
$ npm run report:generate
generate allure reports and open in browser
$ npm run report:generate:open
clean allure reports (delete allure-report/allure-results)
$ npm run report:clean
Other
start electron project
$ npm start
run typescript in watch mode (recompile on file changes)
$ npm run watch
Decorators
@log
method decorator can be used for logging purposes
License
This project contains electron typescript starter application (index.html
/ src/*
)
https://github.com/electron/electron-quick-start-typescript under CC0 1.0 (Public Domain)
Other code under MIT license.