Skip to content

Commit

Permalink
chore: add visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Jan 23, 2025
1 parent fcde06c commit 63083f1
Show file tree
Hide file tree
Showing 7 changed files with 1,236 additions and 40 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Cypress run
- name: Run E2E tests
uses: cypress-io/github-action@v6
with:
install-command: pnpm install --frozen-lockfile
start: pnpm start
wait-on: 'http://[::1]:8080'

- name: Run Visual tests
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ package/

website/
dist/
/cypress/downloads/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Read in other languages: [English](packages/gerador-validador-cpf/README.en.md),
![Rollup](https://img.shields.io/badge/rollup-%231B1B1F?style=for-the-badge&logo=rollup.js)
![Jest](https://img.shields.io/badge/jest-%23C21325?style=for-the-badge&logo=jest)
![Cypress](https://img.shields.io/badge/cypress-%2369D3A7?style=for-the-badge&logo=cypress&logoColor=white)
![Chromatic](https://img.shields.io/badge/chromatic-%23FFF?style=for-the-badge&logo=chromatic)
![Stryker](https://img.shields.io/badge/stryker-%23E74C3C?style=for-the-badge&logo=stryker&logoColor=white)

![EditorConfig](https://img.shields.io/badge/EditorConfig-%23E0EFEF.svg?style=for-the-badge&logo=editorconfig&logoColor=black)
Expand Down
4 changes: 3 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { installPlugin } from '@chromatic-com/cypress'
import webpackPreprocessor from '@cypress/webpack-preprocessor'
import { defineConfig } from 'cypress'

Expand All @@ -6,8 +7,9 @@ import webpackConfig from './webpack.config.prod.mjs'

export default defineConfig({
e2e: {
setupNodeEvents(on) {
setupNodeEvents(on, config) {
// implement node event listeners here
installPlugin(on, config)

on(
'file:preprocessor',
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
// https://on.cypress.io/configuration
// ***********************************************************

// cypress/support/e2e.js
import '@chromatic-com/cypress/support'

// Import commands.js using ES2015 syntax:
import './commands'
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"react-toastify": "^11.0.2"
},
"devDependencies": {
"@chromatic-com/cypress": "^0.9.1",
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@cypress/webpack-preprocessor": "^6.0.2",
Expand All @@ -70,6 +71,7 @@
"@types/react-dom": "^19.0.2",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/webpack-env": "^1.18.5",
"chromatic": "^11.25.1",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.11.0",
"css-minimizer-webpack-plugin": "^7.0.0",
Expand Down
Loading

0 comments on commit 63083f1

Please sign in to comment.