cypress: Allure libraries are not working with cypress 12.15.0
Current behavior
Currently, when you are using the library “@shelex/cypress-allure-plugin” and configurating cypress with the property “allure = true”, at the end of cypress execution, the folder allure-results is not created. In the previous versions, the folder was created with all the data
Desired behavior
In this situacion, cypress has to create a folder “allure-results” with all the data to can be used for other tools to create the real report.
Test code to reproduce
cypress.config.ts:
import setupNodeEvents from './setupNodeEvents';
const dotenv = require('dotenv');
const env = process.env.NODE_ENV?.trim() ?? 'docker';
dotenv.config({ path: `./environment/.env.${env}` });
export default defineConfig({
e2e: {
retries: {
runMode: 0,
openMode: 0,
},
env: {
api_baseEndpoint: process.env.API_BASE_ENDPOINT,
web_baseUrl: process.env.WEB_BASE_URL,
api_password: process.env.API_PASSWORD,
api_client_secret: process.env.API_CLIENT_SECRET,
platform_environment: process.env.PLATFORM_ENVIRONMENT,
db: {
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
host: process.env.DB_HOST,
server: process.env.DB_SERVER,
database: process.env.DB_DATABASE,
port: process.env.DB_PORT,
ssl: process.env.DB_SSL
},
allure: true,
allureResultsPath: "allure-results",
allureReuseAfterSpec: true,
allureAttachRequests: true,
allureClearSkippedTests: false,
allureAddVideoOnPass: false,
ServiceKey: '#my*S3cr3t'
},
specPattern: '**/*.feature',
chromeWebSecurity: false,
video: false,
screenshotOnRunFailure: true,
defaultCommandTimeout: 8000,
viewportWidth: 1920,
viewportHeight: 1080,
setupNodeEvents
}
});
Cypress Version
12.15.0
Node version
v18.15.0
Operating System
windows
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 17
- Comments: 129 (10 by maintainers)
Hi, The ones who struggles - I think you can try reporting an issue in shelex/cypress-allure-plugin repo. It can be fixed/workarounded faster in the plugin repo. Or you can use mmisty/cypress-allure-adapter (I’m the author). it should be almost backward compatible with shelex’s plugin. Cypress-allure-adapter has improvements for before/after/before all/after all hooks and steps improvements (can be controlled by env vars) Plugin continuously improves.
Do you have any news on this issue? We’re still on v12.14.0 for now.
@BarbaraGodayol @JessefSpecialisterren @samixchoumi I have replicated your problem in the latest version of Cypress and will forward this ticket to the appropriate team. They will soon evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!
We are excited to announce the official integration of Allure with Cypress! You can find the Allure-Cypress package at npm; detailed documentation is available on the Allure website.
We encourage everyone to try out this new integration. Should you encounter any issues or have feedback, please don’t hesitate to share your thoughts in the discussions section on our GitHub organisation.
For those interested in the source code, it resides in the allure-js monorepo.
@mike-plummer, you can proceed to close the issue at your convenience.
Having the same issue, latest working version is 12.14.0. Checked with 12.17.2 and it’s not working for me as well.
He @baev great news indeed! will there be a support for cypress with cucumber preprocessor?
@nenadbjelica hello, could you please check this out and apply what is suggested there
If the issue still persist could you please open issue here and add details like
This worked! You’re a genius, I’m immensely grateful! All the best! I might come back again in the future)))
Thanks for the plugin. Had to make a small change for JS style imports ( Used
const {configureAllureAdapterPlugins} = require("@mmisty/cypress-allure-adapter/plugins");
instead ofimport { configureAllureAdapterPlugins } from '@mmisty/cypress-allure-adapter/plugins';
, but pretty much straightforward change to replace the shellex plugin with allure adapter and confirming that the allure adapter works with latest version of cypressWe are using cypress@12.14.0 but we are facing a lot of errors with the new chrome. We are trying to use the new plugin https://github.com/mmisty/cypress-allure-adapter. I’ll tell you if it is correct for us.
@samixchoumi Unfortunately we are a very small team and can’t address every issue immediately. We are always happy to receive contributions from the community if someone is interested in investigating and resolving this issue - see the Contributing Guide for info on setup and process.
The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!
@mike-plummer Sadly, Cypress 12.16.0 does not seem to fix this issue. Still no folder
allure-results
after a test run. Downgrading to Cypress 12.14.0 while otherwise keeping the exact same configuration and environment makes things work as expected again@baev Fabulous, thanks for the awesome integration!
Anyone landing on this issue in the future is encouraged to upgrade to the latest version of Cypress and consider using the official integration provided by Allure (above).
I could fully restore functionality with v0.15.1 https://github.com/mmisty/cypress-allure-adapter Thx @mmisty !
with this plugin (replaces Shelex plugin) you need to adjust your cypress.config.ts env variable “allureResultsPath” -> “allureResults” and make the other adjustments, that have been mentioned multiple times in older comments from this thread.
UPDATE: Firefox test-execution does not work with mmisty’s version 0.15.2. But as Chrome is our leading browser, we can currently live with that.
@AhmadfBaker yes, right Should work like that (it works with Allure TestOps), I didn’t check with Jenkins Allure plugin, but it should work 😃
hi @mmisty posted, looking forward to prompt support
@mmisty I tested the plugin with all versions of Cypress with 12.15.0 - 13.3.0, it seems to work fine for me, although the only change I needed to make to the project example you have updated was to remove the allure-commandline from my package.json, for some reason it keeps resulting in error for not being able to find Java Run time, I have got allure installed on the system directly, so i suppose that might have caused some issue.
Anyways, the plugin seems to work fine for all kinds of things, i.e cy.request/cy.api logging and attachments for the request and response jsons, video on pass, etc.
Thanks a ton for getting this fixed… Nice Patch…
Even tested the Single HTML File generation using both options:
allure-combine -> got the ‘comlplete.html’ generated successfully.
Allure’s unofficial option of ‘–single-file’, i.e. allure generate --single-file {output-folder} -> got the ‘index.html’ generated successfully.
AllureReportArtifacts.zip
It workedd !! thank you @mmisty This is an amazing contribution, wish you all the best!
One more question i have regarding the customization. How can we add environment details, browser version and customise titles in this?
@mmisty i have reran the script again with allure generate command and now allure results folder is generated successfully and index.html report is also generating properly…thanks for your input
@vallme2003, it can be either typescript or javascript
Done quick test on Cypress version
13.0.0
and @shelex/cypress-allure-plugin:2.40.0
, Still it is broken@amaanbs This has not yet been prioritized to be worked by the Cypress team - we would welcome anyone from the community who is interested in taking a look. Information to get started is available in our Contributing Guide.
We ask that everyone please refrain from asking for updates - this GitHub issue will reflect status whenever there are updates to share.
@mike-plummer Any updates on a fix here? I created a plugin for one of our internal projects & that has been failing since 12.15 (it was working up until version 12.14). I implemented certain event listeners in my support file to listen to cypress command executions wherein I would execute
cy.now('task', 'xyz')
& I would then listen to thisxyz
event inside my plugin undersetupNodeEvents
. This flow doesn’t work with Cypress >= v12.15. Posting this here since both Allure & ReportPortal plugins have similar implementations & both seem to be broken since Cypress v12.15. Would appreciate a response. Thanks!Okay, this isn’t the exact solution, but it’s a workaround.Downgrade your Cypress to version “cypress”: “^11.0.0” or “cypress”: “^12.14.0” by executing
'npm install cypress@11.0.0'
ORnpm install cypress@^12.14.0
along with the “@shelex/cypress-allure-plugin”: “^2.40.0”.I am experiencing the same issue. I downgraded Cypress to
11.0.0
to get Allure reports generating again. I am running2.40.0
ofcypress-allure-plugin
.Hi, I had the same problem with the latest Cypress version 12.15.0. The same project works well with version 12.14.0 and Cypress doesn’t report any errors. It seems the latest version has a problem with the Allure report and also doesn’t seem to be able to create screenshots and videos automatically.