Skip to content

Commit

Permalink
cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
binrysearch committed Jul 6, 2024
1 parent 49b52d9 commit fe4c1d6
Show file tree
Hide file tree
Showing 6 changed files with 563 additions and 26 deletions.
8 changes: 4 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const { defineConfig } = require("cypress");
const getCompareSnapshotsPlugin = require("cypress-visual-regression/dist/plugin");
import { defineConfig } from "cypress";
import { configureVisualRegression } from "cypress-visual-regression";

module.exports = defineConfig({
screenshotsFolder: "./cypress/snapshots/actual",
trashAssetsBeforeRuns: true,
env: {
failSilently: false,
},
supportFile: "./cypress/support/index.ts",
e2e: {
supportFile: "./cypress/support/index.ts",
specPattern: "**/*.*cy.*",
setupNodeEvents(on, config) {
getCompareSnapshotsPlugin(on, config);
configureVisualRegression(on);
},
},
});
6 changes: 3 additions & 3 deletions cypress/setup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
crossorigin="anonymous"
/>

<link href="./dist/introjs.css" rel="stylesheet" />
<link href="http://localhost:10001/dist/introjs.css" rel="stylesheet" />

<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
Expand Down Expand Up @@ -156,7 +156,7 @@ <h2 data-intro="fourth header step" data-hint="secondary header">
class="pt-3 mt-4 text-muted border-top"
data-hint="this is the footer"
>
&copy; 2021
&copy; YEAR
</footer>
</div>
</main>
Expand All @@ -178,6 +178,6 @@ <h2 data-intro="fourth header step" data-hint="secondary header">
console.log(3);
};
</script>
<script type="text/javascript" src="./dist/intro.js"></script>
<script type="text/javascript" src="http://localhost:10001/dist/intro.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions cypress/support/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="./index.d.ts" />

import compareSnapshotCommand from "cypress-visual-regression/dist/command";
import { addCompareSnapshotCommand } from "cypress-visual-regression/dist/command";

compareSnapshotCommand({
addCompareSnapshotCommand({
capture: "fullPage",
});

Expand Down
Loading

0 comments on commit fe4c1d6

Please sign in to comment.