在 Docker Container 跑 Visual Testing 之基本設定

Cypress + Docker + Chromatic ❤️

步驟

FROM cypress/base:16.13.0 # create cypress base image
RUN mkdir /app # create working directory for ducker build
WORKDIR /app # specify a path for a working directory
COPY . /app # copy cypress project code into the working directory
RUN npm install # install all dependencies
RUN $(npm bin)/cypress verify # verify cypress has been successfully installed and loaded, and make sure that cypress is ready
RUN ["npm", "run", "chromatic"] # run visual testing with chromatic
node_modules
docker build -t cypress . # create a docker image inside the root "." of the project.

在 Docker Container 跑 Visual Testing 的結果

查看 Chromatic 的結果

更多細節。

查看 Chromatic 的結果


visual testing Docker Chromatic Cypress 自動化測試 視覺測試 End-to-End Testing 端對端測試 閱讀筆記 Cypress 讀書會 cypress.io visual regression testing 讀書會

Summer Tang
Sponsored
Summer Tang 一對一諮詢
Summer|TSMC 主任工程師|擁有 15 年資深 Web 架構經驗,職涯歷經跨國頂尖企業與新創。專精於高流量企業級應用開發,核心技術涵蓋微前端、效能優化、測試自動化與 SEO。曾出版多本技術著作,並多次擔任 MOPCON、WebConf 等大型技術年會講者。
了解更多 →