cypress.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const { defineConfig } = require("cypress");
  2. /*
  3. Cypress configuration for the Cine Studio suite.
  4. The app is served statically from src/web (node serve.js, or any static
  5. server pointed at that folder) and runs in standalone mode, i.e. without
  6. an ArozOS backend: media is generated in the page and imported as blob
  7. URLs, projects round-trip through JSON, exports download. Everything that
  8. needs the Go backend (server renders, proxies) is covered by Go tests in
  9. src/mod/media/render instead.
  10. Override the base URL with `--config baseUrl=http://host:port`.
  11. */
  12. module.exports = defineConfig({
  13. e2e: {
  14. baseUrl: process.env.CS_BASE_URL || "http://127.0.0.1:8123",
  15. specPattern: "cypress/e2e/**/*.cy.js",
  16. supportFile: "cypress/support/e2e.js",
  17. viewportWidth: 1400,
  18. viewportHeight: 900,
  19. defaultCommandTimeout: 10000,
  20. video: false,
  21. screenshotOnRunFailure: true,
  22. chromeWebSecurity: false,
  23. setupNodeEvents(on, config) {
  24. on("task", {
  25. log(message) {
  26. console.log(message);
  27. return null;
  28. }
  29. });
  30. on("before:browser:launch", (browser, launchOptions) => {
  31. // Media elements must play without a user gesture: the specs
  32. // drive playback programmatically
  33. if (browser.family === "chromium") {
  34. launchOptions.args.push("--autoplay-policy=no-user-gesture-required");
  35. launchOptions.preferences = launchOptions.preferences || {};
  36. }
  37. return launchOptions;
  38. });
  39. return config;
  40. }
  41. }
  42. });