diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dd15d3162..32d1fe6fd 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -17,8 +17,8 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm install + - run: npm ci - run: npm run build - - run: npm test + - run: npm run test env: CI: true diff --git a/.gitignore b/.gitignore index 5047bfc61..6a4420618 100644 --- a/.gitignore +++ b/.gitignore @@ -37,7 +37,7 @@ dist/ .changelog # Tests -tests/cypress/setup/dist -tests/cypress/videos/ -tests/cypress/snapshots/actual -tests/cypress/snapshots/diff +cypress/setup/dist +cypress/videos/ +cypress/snapshots/actual +cypress/snapshots/diff diff --git a/cypress.config.ts b/cypress.config.ts new file mode 100644 index 000000000..a365f0dac --- /dev/null +++ b/cypress.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from "cypress"; +import { configureVisualRegression } from "cypress-visual-regression"; + +module.exports = defineConfig({ + trashAssetsBeforeRuns: true, + env: { + failSilently: false, + }, + e2e: { + screenshotsFolder: "./cypress/snapshots/actual", + supportFile: "./cypress/support/index.ts", + specPattern: "**/*.*cy.*", + setupNodeEvents(on, config) { + configureVisualRegression(on); + + return config; + }, + }, +}); diff --git a/cypress/plugins/index.ts b/cypress/plugins/index.ts new file mode 100644 index 000000000..eb7e40298 --- /dev/null +++ b/cypress/plugins/index.ts @@ -0,0 +1,4 @@ +module.exports = (on, config) => { + const getCompareSnapshotsPlugin = require("cypress-visual-regression/dist/plugin"); + getCompareSnapshotsPlugin(on, config); +}; diff --git a/tests/cypress/setup/index.html b/cypress/setup/index.html similarity index 94% rename from tests/cypress/setup/index.html rename to cypress/setup/index.html index a05a22b0b..c2a6e9cbb 100644 --- a/tests/cypress/setup/index.html +++ b/cypress/setup/index.html @@ -14,7 +14,8 @@ crossorigin="anonymous" /> - + + class="pt-3 mt-4 text-muted border-top" data-hint="this is the footer" > - © 2021 + © YEAR @@ -178,6 +179,7 @@