Cypress module conversion and updated chalk

This commit is contained in:
Jamie Curnow
2026-01-27 08:45:23 +10:00
parent df06eb6c2f
commit 4af0a968f0
8 changed files with 62 additions and 52 deletions

View File

@@ -1,22 +0,0 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
requestTimeout: 30000,
defaultCommandTimeout: 20000,
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'multi-reporter.json'
},
video: true,
videosFolder: 'results/videos',
screenshotsFolder: 'results/screenshots',
e2e: {
setupNodeEvents(on, config) {
return require("../plugins/index.js")(on, config);
},
env: {
swaggerBase: '{{baseUrl}}/api/schema?ts=' + Date.now(),
},
baseUrl: 'http://fullstack:81',
}
});

View File

@@ -0,0 +1,23 @@
import { defineConfig } from 'cypress';
import pluginSetup from '../plugins/index.mjs';
export default defineConfig({
requestTimeout: 30000,
defaultCommandTimeout: 20000,
reporter: "cypress-multi-reporters",
reporterOptions: {
configFile: "multi-reporter.json"
},
video: true,
videosFolder: "results/videos",
screenshotsFolder: "results/screenshots",
e2e: {
setupNodeEvents(on, config) {
return pluginSetup(on, config);
},
env: {
swaggerBase: `{{baseUrl}}/api/schema?ts=${Date.now()}`,
},
baseUrl: "http://fullstack:81",
}
});

View File

@@ -1,22 +0,0 @@
const { defineConfig } = require('cypress');
module.exports = defineConfig({
requestTimeout: 30000,
defaultCommandTimeout: 20000,
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'multi-reporter.json'
},
video: true,
videosFolder: 'results/videos',
screenshotsFolder: 'results/screenshots',
e2e: {
setupNodeEvents(on, config) {
return require("../plugins/index.js")(on, config);
},
env: {
swaggerBase: '{{baseUrl}}/api/schema?ts=' + Date.now(),
},
baseUrl: 'http://127.0.0.1:3081',
}
});

View File

@@ -0,0 +1,23 @@
import { defineConfig } from 'cypress';
import pluginSetup from '../plugins/index.mjs';
export default defineConfig({
requestTimeout: 30000,
defaultCommandTimeout: 20000,
reporter: "cypress-multi-reporters",
reporterOptions: {
configFile: "multi-reporter.json"
},
video: true,
videosFolder: "results/videos",
screenshotsFolder: "results/screenshots",
e2e: {
setupNodeEvents(on, config) {
return pluginSetup(on, config);
},
env: {
swaggerBase: `{{baseUrl}}/api/schema?ts=${Date.now()}`,
},
baseUrl: "http://127.0.0.1:3081",
}
});

View File

@@ -1,7 +1,7 @@
const { SwaggerValidation } = require('@jc21/cypress-swagger-validation');
const chalk = require('chalk');
import { SwaggerValidation } from '@jc21/cypress-swagger-validation';
import chalk from 'chalk';
module.exports = (on, config) => {
export default (on, config) => {
// Replace swaggerBase config var wildcard
if (typeof config.env.swaggerBase !== 'undefined') {
config.env.swaggerBase = config.env.swaggerBase.replace('{{baseUrl}}', config.baseUrl);