# Test runner for the PiCtory end-to-end tests, see test/compose.yaml.
FROM docker.io/testcafe/testcafe:3.7.6

# The tests restore PiCtory's data directories, which belong to the web server
# user, and write the custom catalog into the shared installation. Root avoids
# juggling UIDs between the two containers.
USER root
WORKDIR /opt/e2e

COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund

COPY tsconfig.json .testcaferc.cjs ./
COPY tests ./tests
RUN npx tsc

ENTRYPOINT ["node_modules/.bin/testcafe"]
