cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Allure libraries are not working with cypress 12.15.0

Open BarbaraGodayol opened this issue 1 year ago • 12 comments

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: '#myS3cr3t' }, 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

BarbaraGodayol avatar Jun 22 '23 10:06 BarbaraGodayol

Hi @BarbaraGodayol , sorry that you're having trouble. We'll need more information in order to help with this issue:

  1. Are you saying your project using @shelex/cypress-allure-plugin worked on an older version of Cypress and no longer works on upgrading to v12.15.0? Or are you having trouble getting the addon working on a new project using 12.15.0?
  2. Are there any errors reported in the Cypress runner or terminal window? We will need the Debug Logs from your run to diagnose the issue.
  3. Can you provide a reproducible example we can use to troubleshoot? A git repo we can clone and run is preferred over copy-pasted code.

mike-plummer avatar Jun 22 '23 13:06 mike-plummer

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.

sl-tawfiknouri avatar Jun 22 '23 13:06 sl-tawfiknouri

Thanks for the context @sl-tawfiknouri ! There is a known issue with 12.15.0 that we're looking into that may be causing issues under the covers, so it sounds like a temporary workaround for this is to downgrade to 12.14.0

mike-plummer avatar Jun 22 '23 13:06 mike-plummer

Hello @mike-plummer, Like sl-tawfiknouri said, cypress is working well in 12.14.0 and about logs, I don' see any error log related with allure

BarbaraGodayol avatar Jun 22 '23 14:06 BarbaraGodayol

@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

JessefSpecialisterren avatar Jun 27 '23 08:06 JessefSpecialisterren

Hi @JessefSpecialisterren , sorry you're still having issues. We addressed an issue that was causing this error in 12.16.0 but it appears you've identified one or more edge cases we missed. Are you able to share a reproduction case we can use to troubleshoot?

mike-plummer avatar Jun 27 '23 13:06 mike-plummer

Hello @mike-plummer just use "@shelex/cypress-allure-plugin": "2.40.0" and "cypress": "12.15.0" or "cypress": "12.16.0" on your package.json project.

The allure-result folder will not be created. Reproduced on a lot of our project (using API testing or UI testing) / (typescript or javascript).

You can see below one of our project failing after upgrading cypress to 12.15/16 version :

"devDependencies": {
    "@badeball/cypress-cucumber-preprocessor": "^18.0.1",
    "@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
    "@faker-js/faker": "^8.0.2",
    "@shelex/cypress-allure-plugin": "^2.40.0",
    "cypress": "12.16.0",
    "cypress-cloud": "^1.7.4",
    "cypress-multi-reporters": "^1.6.3",
    "cypress-real-events": "^1.8.1",
    "cypress-recurse": "^1.35.2",
    "cypress-slack-reporter": "^1.5.3",
    "esbuild": "^0.18.10",
    "eslint": "^8.42.0",
    "eslint-plugin-cypress": "^2.13.3",
    "fs-extra": "^11.1.1",
    "mocha": "^10.2.0",
    "mochawesome": "^7.1.3",
    "mochawesome-merge": "^4.3.0",
    "mochawesome-report-generator": "^6.2.0",
    "typescript": "^5.1.3"
  },

In our case we switched to cypress-cloud run instead of cypress run command, but it seem to fail when using cypress run command too.

samixchoumi avatar Jun 28 '23 12:06 samixchoumi

Reproduction: https://github.com/mike-plummer/cypress-issue-27113

mike-plummer avatar Jun 28 '23 17:06 mike-plummer

@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!

mike-plummer avatar Jun 28 '23 18:06 mike-plummer

Do you have any news on this issue? We're still on v12.14.0 for now.

casalribeiro avatar Jul 07 '23 11:07 casalribeiro

Hi @JessefSpecialisterren , sorry you're still having issues. We addressed an issue that was causing this error in 12.16.0 but it appears you've identified one or more edge cases we missed. Are you able to share a reproduction case we can use to troubleshoot?

Hi, I have upgraded to v12.17.0 with "@shelex/cypress-allure-plugin": "^2.40.0" and still the problem exists.

mysticdevx avatar Jul 10 '23 21:07 mysticdevx

Done quick test on Cypress version 12.17.1 and @shelex/cypress-allure-plugin: 2.40.0 , Still it is broken

dilshan-swivel avatar Jul 11 '23 05:07 dilshan-swivel

Checked on 12.17.2 and this issue still persists. Sticking with 12.14.0 for now

stefan-cooper avatar Jul 27 '23 08:07 stefan-cooper

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.

Deop avatar Jul 27 '23 10:07 Deop

Having the same issue for 12.17.3. Any news about it @mike-plummer ?

samixchoumi avatar Aug 08 '23 12:08 samixchoumi

@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 avatar Aug 08 '23 12:08 mike-plummer

Having the same issue for 12.17.3

AlexandreTI-AUT avatar Aug 08 '23 18:08 AlexandreTI-AUT

I am experiencing the same issue. I downgraded Cypress to 11.0.0 to get Allure reports generating again. I am running 2.40.0 of cypress-allure-plugin.

danfooks avatar Aug 08 '23 18:08 danfooks

Tendo o mesmo problema para Cypress 12.17.3 e "@shelex/cypress-allure-plugin": "^2.40.0",

FerrazLeandro avatar Aug 11 '23 12:08 FerrazLeandro

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 [email protected]' OR npm install cypress@^12.14.0 along with the "@shelex/cypress-allure-plugin": "^2.40.0".

Rida55 avatar Aug 15 '23 12:08 Rida55

@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 this xyz event inside my plugin under setupNodeEvents. 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!

amaanbs avatar Aug 18 '23 09:08 amaanbs

@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 avatar Aug 18 '23 12:08 mike-plummer

Also waiting here for a fix to upgrade Cypress

jeremie-val avatar Aug 23 '23 11:08 jeremie-val

Cy 12.14 and 12.15 diff, only a handful of commits, should not be hard to at least find out what broke: https://github.com/cypress-io/cypress/compare/v12.14.0...v12.15.0

Any error, what's actually "broken" - that would help figure out which commit(s) broke it.

lmiller1990 avatar Aug 23 '23 23:08 lmiller1990

@lmiller1990 I already did some investigating a while ago and I'm pretty sure https://github.com/cypress-io/cypress/commit/89f0fb64650d1795a912773b5c0660d1aceea0bc is the culprit. cypress-allure-plugin uses cy.now('task' to send report data from the browser to Node, which stopped working after those extra security measures were implemented

We've switched to mochawesome reporting for our project, by the way. The report isn't as good, but at least it works with newer Cypress versions

JessefSpecialisterren avatar Aug 24 '23 07:08 JessefSpecialisterren

@JessefSpecialisterren, we switched to sorry-cypress and mochawesome too because of that …

On Thu, Aug 24, 2023 at 09:59 JessefSpecialisterren < @.***> wrote:

@lmiller1990 https://github.com/lmiller1990 I already did some investigating a while ago and I'm pretty sure 89f0fb6 https://github.com/cypress-io/cypress/commit/89f0fb64650d1795a912773b5c0660d1aceea0bc is the culprit. cypress-allure-plugin uses cy.now('task' https://github.com/Shelex/cypress-allure-plugin/blob/8af114383af639be9af1916a7723ab09869a0823/reporter/index.js#L76 to send report data from the browser to Node, which stopped working after those extra security measures were implemented

We've switched to mochawesome reporting for our project, by the way. The report isn't as good, but at least it works with newer Cypress versions

— Reply to this email directly, view it on GitHub https://github.com/cypress-io/cypress/issues/27113#issuecomment-1691198042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJFCGBH3MYSFIOMW2ZKVOLXW4CWZANCNFSM6AAAAAAZP667PI . You are receiving this because you were mentioned.Message ID: @.***>

samixchoumi avatar Aug 24 '23 10:08 samixchoumi

Sorry Cypress still uses the same binary, just a different cloud service -- switching to that is not going to fix this issue.

lmiller1990 avatar Aug 24 '23 21:08 lmiller1990

Yeah I know but the dashboard is better than allure report

On Thu, Aug 24, 2023 at 23:50 Lachlan Miller @.***> wrote:

Sorry Cypress still uses the same binary, just a different cloud service -- switching to that is not going to fix this issue.

— Reply to this email directly, view it on GitHub https://github.com/cypress-io/cypress/issues/27113#issuecomment-1692459196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJFCGDXHXYIMZLQTJLJGS3XW7EC7ANCNFSM6AAAAAAZP667PI . You are receiving this because you were mentioned.Message ID: @.***>

samixchoumi avatar Aug 24 '23 21:08 samixchoumi

We're having the same issue.

dirkrooijakkers avatar Aug 30 '23 09:08 dirkrooijakkers

Done quick test on Cypress version 13.0.0 and @shelex/cypress-allure-plugin: 2.40.0 , Still it is broken

dilshan-swivel avatar Aug 31 '23 07:08 dilshan-swivel