Skip to content

Commit

Permalink
docs(automated-test.md): improve automated test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Oct 22, 2021
1 parent 2efdbf1 commit 9fc8483
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions docs/automated-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ The automated test for this applications are focused on integration tests.

The tests were implemented harmonizing:

- load webpack context before running the tests (support for import, alias, custom extensions, test env)
- debugging the test specs and the source code
- work on browserS without GUI (headless)
- able of testing DOM elements
- Load webpack context before running the tests (support for import, alias, custom extensions, test env)
- Debugging the test specs and the source code
- Work on browserS without GUI (headless)
- Able of testing DOM elements
- Work with project's Vue.js version
- Uses Jasmine as testing tool
- Use karma tester.
- `Jasmine` as testing framework
- `Vue Test Utils` for manipulating vue components
- `@vue/server-test-utils` for rendering vue components
- `Karma` as tester runner
- `Mocha` for reporting test results
- `Selenium` and `nightwatch` for e2e tests (not yet fully used)

## Running tests locally

Expand All @@ -20,17 +24,42 @@ To run the tets, use npm commands, as follows:

```sh
# To run tests
npm run integration
npm run test
```

- Run tests in watch/debug mode

```sh
# To run tests in debug mode
npm run integration-debug
npm run test:debug
# After the test starts, open the browser on localhost:<port-specified in karma.debug.conf.js>
```

## Automated CI tests

The application includes a github action workflow, stored in `.github/workflows/test.yml`, that triggers the test run when it is pushed to the github repository. In order to run the testes, a custom github action was created and published to github market place and is referenced in the `test.yml` file. More details can be seen on [https://github.com/amoncaldas/github-action-webapp-front-end-test](https://github.com/amoncaldas/github-action-webapp-front-end-test)
The application includes a github action workflow, stored in `.github/workflows/test.yml`, that triggers the test run when it is pushed to the github repository. In order to run the testes, a custom github action was created and published to github market place and is referenced in the `test.yml` file. More details can be seen on [https://github.com/amoncaldas/github-action-webapp-front-end-test](https://github.com/amoncaldas/github-action-webapp-front-end-test)

## Testing dedicated packages

The following packages are used for the testing solution:

- @vue/server-test-utils
- @vue/test-utils
- cross-env
- jasmine
- mocha
- karma
- karma-chrome-launcher
- karma-coverage
- karma-firefox-launcher
- karma-jasmine-html-reporter
- karma-mocha
- karma-phantomjs-launcher
- karma-sourcemap-loader
- karma-spec-reporter
- karma-webpack
- nightwatch
- selenium-server
- vue-server-renderer
- vue-template-compiler
- phantomjs-prebuilt

0 comments on commit 9fc8483

Please sign in to comment.