-
I am using javascript-cucumber and had been using @shelex adapter until upgrading to latest cypress version. I have put this adapter as first import in e2e.js but the commands are still not being collapsed, any idea why this is happening? I'm attaching below a piece of the report so that you can see what i'm dealing with. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 7 replies
-
Hello, @rcapdefer It is |
Beta Was this translation helpful? Give feedback.
-
Hi, @mmisty thanks for your reply. I am using @badeball/cypress-cucumber-preprocessor and i've just updated to v 0.14.2 but no luck, my allure report still looks like a neverending list. Any other tips of what I could try? |
Beta Was this translation helpful? Give feedback.
-
package.json :
e2e.js :
cypress.config.js :
index.js :
|
Beta Was this translation helpful? Give feedback.
-
@mmisty I've edited my last comment, and trying again to attach screenshot. |
Beta Was this translation helpful? Give feedback.
-
@rcapdefer Thank you!
|
Beta Was this translation helpful? Give feedback.
-
@rcapdefer I see that plugin you use has been updated 2 years ago. So I suggest moving to https://www.npmjs.com/package/@badeball/cypress-cucumber-preprocessor - it has better support (and it is tested with allure adapter) |
Beta Was this translation helpful? Give feedback.
-
This is the test i'm running. Do you need the console output of it? I've tried moving to https://www.npmjs.com/package/@badeball/cypress-cucumber-preprocessor but i can't get the config right for my setup, always getting errors, like something is incompatible, and the documentation is for typescript and my setup is with javascript |
Beta Was this translation helpful? Give feedback.
-
Do you have an example with @badeball/cypress-cucumber-preprocessor using your adapter? |
Beta Was this translation helpful? Give feedback.
-
Hello @mmisty I've followed your example but my report still looks the same way. i'm attaching below my files. I can't find an explanation why the report is generated differently. Maybe you can spot something that is out of place, it would help me very much! Thanks in advance package.json
e2e.js:
cypress.config.js:
|
Beta Was this translation helpful? Give feedback.
-
You have incorrect config (you didn't add env variables correctly) - see below const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild").createEsbuildPlugin;
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const { defineConfig } = require("cypress");
const { configureAllureAdapterPlugins } = require("@mmisty/cypress-allure-adapter/plugins");
const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor");
const EventForwarder = require("./event-forwarder");
const CypressTerminalReport = require('cypress-terminal-report/src/installLogsPrinter')
const eventForwarder = new EventForwarder();
module.exports = defineConfig({
video: false,
viewportHeight: 1024,
viewportWidth: 1024,
defaultCommandTimeout: 40000,
chromeWebSecurity: false,
pageLoadTimeout: 70000,
redirectionLimit: 300,
watchForFileChanges: false,
allure: true, // << delete here, should be env variable
allureResultsPath: 'allure-results', // << delete here, should be env variable
allureClearSkippedTests: true, // << delete here (this is from shelex)
csvLogPath: 'allure-results',
projectId: 'tbym2j',
requestTimeout: 25000,
responseTimeout: 35000,
includeShadowDom: true,
experimentalMemoryManagement: true,
trashAssetsBeforeRuns: true,
env: {
// put your env variable here
}
e2e: {
testIsolation:true,
allure:true, // << delete here, should be env variable
allureSkipCommands: 'wrap', // << delete here, should be env variable
allureResults: '../../allure-results', // << delete here, should be env variable
baseUrl: 'http://localhost:8080/',
setupNodeEvents: async function (cyOn, config) {
const on = eventForwarder.on;
const reporter = configureAllureAdapterPlugins(on, config);
console.log(' === ENVIRONMENT:');
console.log(config.env);
console.log(' === ');
const cucumberBundler = createBundler({
define: { global: 'window' },
plugins: [createEsbuildPlugin(config)],
});
cyOn('file:preprocessor', cucumberBundler);
// this is to write categories and environment information
on('before:run', details => {
reporter?.writeEnvironmentInfo({
info: {
// any env info you want to see in report
os: details.system.osName,
osVersion: details.system.osVersion,
browser: details.browser?.displayName + ' ' + details.browser?.version,
},
});
reporter?.writeCategoriesDefinitions({ categories: './allure-error-categories.json' });
});
await addCucumberPreprocessorPlugin(on, config);
eventForwarder.forward(cyOn);
CypressTerminalReport(on)
on('task', {
log(message) {
console.log(message);
return null;
}
})
// important to return config
return config;
},
specPattern: 'cypress/e2e/features/**/*.feature',
supportFile: 'cypress/support/e2e.js',
downloadsFolder: 'cypress/downloads',
fixturesFolder: 'cypress/fixtures',
screenshotsFolder: 'cypress/screenshots',
excludeSpecPattern: '*.js'
},
}) |
Beta Was this translation helpful? Give feedback.
-
@mmisty Thanks for the help, i think i've finally managed to make it work. Commands seem to be nested now, at least for this short test. However i've noticed since im using you adapter some of the web elements are highlighted wrong when double-clicking on text, see screenshot below. Do you want me to open a separate thread for this? |
Beta Was this translation helpful? Give feedback.
Hello, @rcapdefer
I can't find
javascript-cucumber
plugin, though I have released new version of adapter recentlyIt is
0.14.1
versionSome docs are here https://github.com/mmisty/cypress-allure-adapter/blob/main/docs/gherkin.md
Let me know if you still have issues