82 lines
1.9 KiB
JavaScript
82 lines
1.9 KiB
JavaScript
![]() |
const { defineConfig } = require('cypress');
|
||
|
|
||
|
module.exports = defineConfig({
|
||
|
e2e: {
|
||
|
baseUrl: 'http://localhost:3000',
|
||
|
supportFile: 'cypress/support/e2e.ts',
|
||
|
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
|
||
|
videosFolder: 'cypress/videos',
|
||
|
screenshotsFolder: 'cypress/screenshots',
|
||
|
fixturesFolder: 'cypress/fixtures',
|
||
|
video: true,
|
||
|
screenshot: true,
|
||
|
viewportWidth: 1280,
|
||
|
viewportHeight: 720,
|
||
|
defaultCommandTimeout: 10000,
|
||
|
requestTimeout: 10000,
|
||
|
responseTimeout: 10000,
|
||
|
pageLoadTimeout: 30000,
|
||
|
|
||
|
env: {
|
||
|
API_URL: 'http://localhost:3001',
|
||
|
TEST_USER_EMAIL: 'test@example.com',
|
||
|
TEST_USER_PASSWORD: 'TestPassword123!',
|
||
|
},
|
||
|
|
||
|
setupNodeEvents(on, config) {
|
||
|
// implement node event listeners here
|
||
|
on('task', {
|
||
|
// Custom tasks for database setup/teardown
|
||
|
clearDatabase() {
|
||
|
// Clear test database
|
||
|
return null;
|
||
|
},
|
||
|
|
||
|
seedDatabase() {
|
||
|
// Seed test database with fixtures
|
||
|
return null;
|
||
|
},
|
||
|
|
||
|
log(message) {
|
||
|
console.log(message);
|
||
|
return null;
|
||
|
},
|
||
|
});
|
||
|
|
||
|
// Code coverage plugin
|
||
|
require('@cypress/code-coverage/task')(on, config);
|
||
|
|
||
|
return config;
|
||
|
},
|
||
|
},
|
||
|
|
||
|
component: {
|
||
|
devServer: {
|
||
|
framework: 'react',
|
||
|
bundler: 'webpack',
|
||
|
},
|
||
|
specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}',
|
||
|
supportFile: 'cypress/support/component.ts',
|
||
|
},
|
||
|
|
||
|
// Global configuration
|
||
|
chromeWebSecurity: false,
|
||
|
modifyObstructiveCode: false,
|
||
|
experimentalStudio: true,
|
||
|
experimentalWebKitSupport: true,
|
||
|
|
||
|
// Retry configuration
|
||
|
retries: {
|
||
|
runMode: 2,
|
||
|
openMode: 0,
|
||
|
},
|
||
|
|
||
|
// Reporter configuration
|
||
|
reporter: 'mochawesome',
|
||
|
reporterOptions: {
|
||
|
reportDir: 'cypress/reports',
|
||
|
overwrite: false,
|
||
|
html: false,
|
||
|
json: true,
|
||
|
},
|
||
|
});
|