-
Notifications
You must be signed in to change notification settings - Fork 1
/
cypress.config.js
67 lines (61 loc) · 1.93 KB
/
cypress.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const { defineConfig } = require('cypress');
//const vitePreprocessor = require('cypress-vite');
// tests/cypress/plugins/seeder.js
const path = require('path');
const { Seeder } = require('mongo-seeding');
const config = {
database: 'mongodb://localhost:3001/meteor',
dropDatabase: true
};
const seeder = new Seeder(config);
const collections = seeder.readCollectionsFromPath(
path.resolve('./tests/cypress/data')
);
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
pageLoadTimeout: 120000,
video: true,
fixturesFolder: 'tests/cypress/fixtures',
//
//pluginsFile: "tests/cypress/plugins/index.js",
screenshotsFolder: 'tests/cypress/screenshots',
//,
videosFolder: 'tests/cypress/videos',
//experimentalComponentTesting: true,
env: {
baseUrl: 'http://localhost:3000',
codeCoverage: {
url: 'http://localhost:3000/__coverage__'
}
},
e2e: {
supportFile: 'tests/cypress/support/index.js',
specPattern: 'tests/cypress/integration/*.spec.js',
setupNodeEvents(on, config) {
require('@cypress/code-coverage/task')(on, config);
on('task', {
async 'seed:database'() {
await seeder.import(collections);
// > If you do not need to return a value, explicitly return null to
// > signal that the given event has been handled.
return null;
}
});
// on('file:preprocessor', vitePreprocessor());
// on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
// `on` is used to hook into various events Cypress emits.
// `config` is the resolved Cypress config.
// require('./seeder')(on, config);
return config;
}
},
component: {
supportFile: 'tests/cypress/support/component.js',
indexHtmlFile: 'tests/cypress/support/component-index.html',
devServer: {
framework: 'vue',
bundler: 'vite'
}
}
});