Skip to content

Commit

Permalink
Apply Replay Cypress config
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jun 24, 2024
1 parent 3cc9336 commit f2552ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import codeCoverageTask from "@cypress/code-coverage/task";
import { devServer } from "@cypress/vite-dev-server";
import { defineConfig } from "cypress";
import { mergeConfig, loadEnv } from "vite";
import { plugin as replayPlugin, wrapOn } from "@replayio/cypress";

dotenv.config({ path: ".env.local" });
dotenv.config();
Expand Down Expand Up @@ -97,9 +98,17 @@ module.exports = defineConfig({
viewportHeight: 1000,
viewportWidth: 1280,
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
setupNodeEvents(cyOn, config) {
const testDataApiEndpoint = `${config.env.apiUrl}/testData`;

const on = wrapOn(cyOn);

replayPlugin(on, config, {
upload: true, // automatically upload your replays to DevTools

apiKey: process.env.REPLAY_API_KEY,
});

const queryDatabase = ({ entity, query }, callback) => {
const fetchData = async (attrs) => {
const { data } = await axios.get(`${testDataApiEndpoint}/${entity}`);
Expand Down
1 change: 1 addition & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check
import "@cypress/code-coverage/support";
import "@replayio/cypress/support";
import "./commands";
import { isMobile } from "./utils";

Expand Down

0 comments on commit f2552ee

Please sign in to comment.