-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from JoanEsquivel/11.0.1
11.0.1
- Loading branch information
Showing
4 changed files
with
297 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
{ | ||
"json": { | ||
"enabled": false, | ||
"output": "jsonlogs/log.json", | ||
"formatter": "cucumber-json-formatter.exe" | ||
}, | ||
"messages": { | ||
"enabled": false, | ||
"output": "jsonlogs/messages.ndjson" | ||
}, | ||
"html": { | ||
"enabled": false | ||
}, | ||
"stepDefinitions": [ | ||
"[filepath]/**/*.{js,ts}", | ||
"[filepath].{js,ts}", | ||
"cypress/e2e/step_definitions/*.{js,ts}", | ||
"[filepath]\\***.{js,ts}", | ||
"[filepath].{js,ts}", | ||
"cypress\\e2e\\step_definitions\\*.{js,ts}" | ||
] | ||
"json": { | ||
"enabled": false, | ||
"output": "jsonlogs/log.json", | ||
"formatter": "cucumber-json-formatter.exe" | ||
}, | ||
"messages": { | ||
"enabled": false, | ||
"output": "jsonlogs/messages.ndjson" | ||
}, | ||
"html": { | ||
"enabled": false | ||
}, | ||
"stepDefinitions": [ | ||
"[filepath]/**/*.{js,ts}", | ||
"[filepath].{js,ts}", | ||
"cypress/e2e/step_definitions/*.{js,ts}", | ||
"[filepath]\\***.{js,ts}", | ||
"[filepath].{js,ts}", | ||
"cypress\\e2e\\step_definitions\\*.{js,ts}" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
const { defineConfig } = require("cypress"); | ||
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor"); | ||
const addCucumberPreprocessorPlugin = | ||
require("@badeball/cypress-cucumber-preprocessor").addCucumberPreprocessorPlugin; | ||
const createEsbuildPlugin = | ||
require("@badeball/cypress-cucumber-preprocessor/esbuild").createEsbuildPlugin; | ||
const preprocessor = require("@badeball/cypress-cucumber-preprocessor"); | ||
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild"); | ||
const allureWriter = require("@shelex/cypress-allure-plugin/writer"); | ||
|
||
//If using this approach, just call the key "setupNodeEvents" in the E2E configurations | ||
// async function setupNodeEvents(on, config) { | ||
// await addCucumberPreprocessorPlugin(on, config); | ||
// on( | ||
// "file:preprocessor", | ||
// createBundler({ | ||
// plugins: [createEsbuildPlugin(config)], | ||
// }) | ||
// ); | ||
// return config; | ||
// } | ||
async function setupNodeEvents(on, config) { | ||
// This is required for the preprocessor to be able to generate JSON reports after each run, and more, | ||
await preprocessor.addCucumberPreprocessorPlugin(on, config); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
async setupNodeEvents(on, config) { | ||
const bundler = createBundler({ | ||
plugins: [createEsbuildPlugin(config)], | ||
}); | ||
on( | ||
"file:preprocessor", | ||
createBundler({ | ||
plugins: [createEsbuildPlugin.default(config)], | ||
}) | ||
); | ||
allureWriter(on, config); | ||
|
||
on("file:preprocessor", bundler); | ||
await addCucumberPreprocessorPlugin(on, config); | ||
allureWriter(on, config); | ||
// Make sure to return the config object as it might have been modified by the plugin. | ||
return config; | ||
} | ||
|
||
return config; | ||
}, | ||
module.exports = defineConfig({ | ||
e2e: { | ||
setupNodeEvents, | ||
specPattern: "cypress/e2e/features/*.feature", | ||
baseUrl: "https://www.saucedemo.com", | ||
chromeWebSecurity: false, | ||
env: { | ||
allureReuseAfterSpec: true, | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.