Skip to content

Commit

Permalink
docs: update how to run tests section
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Jan 28, 2023
1 parent 53a870f commit ace1ee1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,23 @@ IDEs from this link before raising a pull request: https://www.sonarlint.org/
* `npm run release:dev`, `npm run release:staging`, `npm run release:prod`
* The release artifacts to host will be in `dist` folder.

## Running tests
## Running and debugging tests in browser
This is the easiest and preferred way to run Phoenix tests.
* run `npm run zipTestFiles` in the terminal.
* NB: this will setup all the required files for test
* Use chrome/edge browser to navigate to Phoenix[http://localhost:8000/src/index.html](http://localhost:8000/src/index.html)
* In Phoenix Menu, select `Debug > run Tests` To open the test runner.
* Run tests as required.
* NB: To reset test data files, click on `reset and reload tests` option in the test runner.
* You can use the browser dev tools to debug.

## Running and debugging tests in headless mode or in GitHub Actions
We use [Playwright](https://playwright.dev/) to run the headless version of our tests.
Please note that we do not use Playwright as our actual test framework, but as a headless browser(chrome and firefox)
to run our tests written in Jasmine/Mocha.
* run `npm run test` in the terminal to run the tests run in GitHub actions.
* To debug the tests, `npm run testDebug`. However, we recommend using the
above `Running tests in browser` section to actually fix/debug tests that are failing in the pipeline.

### Running tests in dev staging and prod stacks
* To run tests against these stacks go to the following url:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"serveTest": "http-server . -p 5000 -c-1",
"zipTestFiles": "gulp zipTestFiles",
"test": "npx playwright test",
"testDebug": "npx playwright test --debug",
"testChromium": "npx playwright test --project=chromium",
"testFirefox": "npx playwright test --project=firefox",
"buildonly": "gulp build",
Expand Down

0 comments on commit ace1ee1

Please sign in to comment.