-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
73 lines (69 loc) · 1.97 KB
/
cypress.config.ts
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
68
69
70
71
72
73
import { defineConfig } from "cypress";
import * as webpack from "@cypress/webpack-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
// This config to set cucumber as a preprocessor
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
webpack({
webpackOptions: {
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
use: [
{
loader: "ts-loader",
},
],
},
{
test: /\.feature$/,
use: [
{
loader: "@badeball/cypress-cucumber-preprocessor/webpack",
options: config,
},
],
},
],
},
},
})
);
// Make sure to return the config object as it might have been modified by the plugin.
return config;
}
export default defineConfig({
// This parameter to specify the project to report to on Cypress Dashboard
projectId:"6jwnmi",
// This parameter to override the timeout time of waiting for elements
defaultCommandTimeout:10000,
// This parameter to set the screen size of the browser
viewportWidth:1280,
viewportHeight:800,
// This parameter to set mochawesome as default reported
reporter: "mochawesome",
reporterOptions:{
"charts":true,
"overwrite":false,
"html":false,
"json":true,
"reportDir":"cypress/reports"
},
e2e: {
// This parameter allows navigating between different domains
chromeWebSecurity: false,
// This parameter specifies .feature files as files for test execution
specPattern: "**/*.feature",
setupNodeEvents,
},
});