Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.48 KB

README.md

File metadata and controls

62 lines (41 loc) · 1.48 KB

Smoke tests

How to run smoke tests with docker

  1. Build the docker image:
docker build -t smoke-tests .
  1. Replace the necessary values in the command below and run the tests:
docker run -it --net=host smoke-tests <URL> <username> <password>

If you want to mount the tests directory to the container, you can use the following command:

docker run -it --net=host -v "$(pwd)/tests":/code/tests smoke-tests <URL> <username> <password>

If you want to get the test results and the failure screenshot, you can use the following one:

docker run -it --net=host -v "$(pwd)/test-results:/code/test-results" smoke-tests <URL> <username> <password>

You can look at the traces with the online Playwright trace viewer.

How to run smoke tests without docker

You have to have node.js installed on your machine. The minimum version required is 20.

  1. Install the dependencies:
npm install
npx playwright install # Install Playwright configured browsers & deps
  1. Configure the environment variables:
cp .env.dist .env
  1. Run the tests with a visual interface:
npm run test:ui # With a visual interface
npm run test # Without a visual interface

How to write smoke tests

  1. Create a new test file in the tests directory.
  2. Write your test using the Playwright API.

You can also use the code generator to help you write tests using npm run test:codegen