fix: refs #8583 cypressconf

This commit is contained in:
Carlos Satorres 2025-02-27 07:40:38 +01:00
parent c18dce46e0
commit 4e98a2fdcf
1 changed files with 8 additions and 33 deletions

View File

@ -1,7 +1,4 @@
import { defineConfig } from 'cypress'; import { defineConfig } from 'cypress';
// https://docs.cypress.io/app/tooling/reporters
// https://docs.cypress.io/app/references/configuration
// https://www.npmjs.com/package/cypress-mochawesome-reporter
let urlHost, reporter, reporterOptions; let urlHost, reporter, reporterOptions;
@ -28,51 +25,29 @@ if (process.env.CI) {
export default defineConfig({ export default defineConfig({
e2e: { e2e: {
baseUrl: `http://${urlHost}:9000`, baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false, // Desactivado para evitar tiempos de espera innecesarios experimentalStudio: false,
defaultCommandTimeout: 10000, defaultCommandTimeout: 10000,
trashAssetsBeforeRuns: false, trashAssetsBeforeRuns: false,
requestTimeout: 10000, requestTimeout: 10000,
responseTimeout: 30000, responseTimeout: 30000,
pageLoadTimeout: 60000, pageLoadTimeout: 60000,
defaultBrowser: 'chromium',
fixturesFolder: 'test/cypress/fixtures', fixturesFolder: 'test/cypress/fixtures',
screenshotsFolder: 'test/cypress/screenshots', screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js', supportFile: 'test/cypress/support/index.js',
videosFolder: 'test/cypress/videos', videosFolder: 'test/cypress/videos',
downloadsFolder: 'test/cypress/downloads', downloadsFolder: 'test/cypress/downloads',
video: false, video: false,
specPattern: 'test/cypress/integration/worker/*.spec.js', specPattern: 'test/cypress/integration/**/*.spec.js',
experimentalRunAllSpecs: false, experimentalRunAllSpecs: true,
watchForFileChanges: false, watchForFileChanges: true,
reporter: 'cypress-mochawesome-reporter', reporter,
reporterOptions: { reporterOptions,
charts: true,
reportPageTitle: 'Cypress Inline Reporter',
reportFilename: '[status]_[datetime]-report',
embeddedScreenshots: true,
reportDir: 'test/cypress/reports',
inlineAssets: true,
},
component: { component: {
componentFolder: 'src', componentFolder: 'src',
testFiles: '**/*.spec.js', testFiles: '**/*.spec.js',
supportFile: 'test/cypress/support/unit.js', supportFile: 'test/cypress/support/unit.js',
} /* },
setupNodeEvents: async (on, config) => {
const plugin = await import('cypress-mochawesome-reporter/plugin');
plugin.default(on);
const fs = await import('fs');
on('task', {
deleteFile(filePath) {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
return true;
}
return false;
},
});
return config;
},*/,
viewportWidth: 1280, viewportWidth: 1280,
viewportHeight: 720, viewportHeight: 720,
}, },