Closed nurullahsahin44 closed 1 year ago
The checklist isn’t optional but serve a purpose.
Sorry for checklist,I couldn't pay attention, actually I tried so much times and I checked so much projects, but i could not resolve the problem, I using @badeball/cypress-cucumber-preprocessor 18.0.4 and everythink is ok, when I add to AllureReport as meen allureWriter function, it is not working , When I using the below configuration.json actually test is running but allure report was not create, when create the allure report test cases could not run. :(
const { defineConfig } = require("cypress"); const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor"); const createBundler = require("@bahmutov/cypress-esbuild-preprocessor"); const { createEsbuildPlugin } = require("@badeball/cypress-cucumber-preprocessor/esbuild"); const allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ chromeWebSecurity: false, e2e: { specPattern: "*/.feature", async setupNodeEvents(on, config) { allureWriter(on, config); // implement node event listeners here on("file:preprocessor", createBundler({ plugins: [createEsbuildPlugin(config)], }));
await addCucumberPreprocessorPlugin(on, config);
return config;
},
env: {
allureReuseAfterSpec: true
}
}, });
What points on the checklist have you gone through?
That's not the checklist I'm referring to. What checklist did the issue template comprise of?
cypress.config.js
That’s not at all the right answer. The issue template can be seen when opening a new issue or otherwise here: https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/.github/ISSUE_TEMPLATE.md
I checked all of list. I have read, Also using v18.0.4 , I want to remind again,
When I using to below configuration, test running but allure report could not occur, I wrote to allure report side for this problem,
const { defineConfig } = require("cypress"); const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor"); const createBundler = require("@bahmutov/cypress-esbuild-preprocessor"); const { createEsbuildPlugin } = require("@badeball/cypress-cucumber-preprocessor/esbuild"); const allureWriter = require('@shelex/cypress-allure-plugin/writer');
module.exports = defineConfig({ chromeWebSecurity: false, e2e: { specPattern: "*/.feature", async setupNodeEvents(on, config) { allureWriter(on, config); // implement node event listeners here on("file:preprocessor", createBundler({ plugins: [createEsbuildPlugin(config)], }));
await addCucumberPreprocessorPlugin(on, config);
return config;
},
env: {
allureReuseAfterSpec: true
}
}, });
**When I using to below configuration, test not running but allure-result created *** also added test results
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 allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { const bundler = createBundler({ plugins: [createEsbuildPlugin(config)], });
on("file:preprocessor", bundler);
addCucumberPreprocessorPlugin(on, config);
allureWriter(on, config);
return config;
},
specPattern: "cypress/e2e/*.feature",
chromeWebSecurity: false,
},
});
and fail results
CypressError: cy.task('cypress-cucumber-preprocessor:spec-envelopes')
failed with the following error:
Unexpected state in specEnvelopesHandler: initial (this might be a bug, please report at https://github.com/badeball/cypress-cucumber-preprocessor)
https://on.cypress.io/api/task
Because this error occurred during a null
hook we are skipping the remaining tests in the current suite: Test Login
at
From Node.js Internals:
Error: Unexpected state in specEnvelopesHandler: initial (this might be a bug, please report at https://github.com/badeball/cypress-cucumber-preprocessor)
at createError (/Users/nurullah.sahin/Desktop/Automation Projects/iyzipay-checkout-automation/node_modules/@badeball/cypress-cucumber-preprocessor/dist/helpers/error.js:9:12)
at specEnvelopesHandler (/Users/nurullah.sahin/Desktop/Automation Projects/iyzipay-checkout-automation/node_modules/@badeball/cypress-cucumber-preprocessor/dist/plugin-event-handlers.js:300:43)
at invoke (/Users/nurullah.sahin/Library/Caches/Cypress/12.17.4/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:246:16)
at
Did you read the FAQ though? And thoroughly?
Closing as not my problem. You need to figure out this stuff yourself.
Current behavior
CypressError:
cy.task('cypress-cucumber-preprocessor:spec-envelopes')
failed with the following error:https://on.cypress.io/api/task
Because this error occurred during a
null
hook we are skipping the remaining tests in the current suite:Test Login
Desired behavior
Don't want to get any error and Allure report
Test code to reproduce
Versions
node = 18.16.1
Checklist
cypress.config.js file
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 allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { const bundler = createBundler({ plugins: [createEsbuildPlugin(config)], });
},
});