Envs:
APP
- app folder name
SERVE
- folder inside app folder with a bundles
Run tests for development purposes:
APP=react18 SERVE=build npx playwright test --config ./src/playwright.config.ts
Run tests for specific browser
APP=react18 SERVE=build npx playwright test --config ./src/playwright.config.ts --project=chromium
Update snapshots
rete-kit test -u
Run in Docker
docker run -it --rm -v /usr/share/fonts:/usr/share/fonts -v $(pwd):/data mcr.microsoft.com/playwright:v1.37.1-jammy /bin/bash
cd /data
Alternative
FROM ubuntu:20.04
RUN apt update
ENV NODE_VERSION=16.13.0
RUN apt install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version
RUN npx [email protected] install
RUN npx [email protected] install --with-deps
Note! The recommended OS is Ubuntu 20.04 because the actual version of Playwright supports a minimum of 20.04, but the Ubuntu 22.04 version has issues rendering fonts in Firefox and WebKit.