Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reporterOptions are not resolved when they are set in setupNodeEvents #27689

Open
gustawx opened this issue Aug 29, 2023 · 8 comments
Open

reporterOptions are not resolved when they are set in setupNodeEvents #27689

gustawx opened this issue Aug 29, 2023 · 8 comments
Labels
prevent-stale mark an issue so it is ignored by stale[bot] stage: needs investigating Someone from Cypress needs to look at this

Comments

@gustawx
Copy link

gustawx commented Aug 29, 2023

Current behavior

  1. set up reporterOptions in setupNodeEvents
  2. start Cypress GUI
  3. Go to Settings
  4. Go to Project Settings
  5. Check Resolved configuration section

results:
reporterOptions are not resolved correctly - like they have been set in setupNodeEvents. They are always set to null. I observed this only fot this one config option.

Desired behavior

reporterOptions resolved correctly, like they have been set in setupNodeEvents

Test code to reproduce

Quite easy to reproduce, just define reporterOptions in cypress.config.ts:

export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      config.reporterOptions = {
        reportFilename: "filename",
        html: true,
        json: true,
      };
      // and this only for demo purpose
      config.reporterOptionsAnother = {
        reportFilename: "filename",
        html: true,
        json: true,
      };
      return config;
    },
  },
});

image

Cypress Version

12.17.2

Node version

18.12.1

Operating System

Windows, Linux, not tested on OS

Debug Logs

No response

Other

No response

@gustawx gustawx changed the title reporterOptions are not resolved whenthey are set in setupNodeEvents reporterOptions are not resolved when they are set in setupNodeEvents Aug 29, 2023
@TzolkinB
Copy link

TzolkinB commented Sep 11, 2023

Seeing what might be a similar issue. Using Cypress 12.17.1.
We have a global package where we set default configs for repos to consume.

In setUpNodeEvents, console.log(config.reporterOptions) shows the expected default config results but config.resolved.reporterOptions is showing null.

Tested with Cypress 10.7.0 and seeing the same unexpected behavior where config.resolved.reporterOptions is incorrect but config.reporterOptions does show what is expected.

@himkanda
Copy link

himkanda commented Sep 14, 2023

Able to confirm in my project that this is an issue only with the key-value pair type configurations, like reporterOptions and retries

Cypress version: 13.1.0
Node: 20.5.1
Browser: Chrome 116, Electron 106

Test Code to reproduce:

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      config.baseUrl = "https://www.google.com";
      config.chromeWebSecurity = false;
      config.defaultCommandTimeout = 35000;
      config.excludeSpecPattern = ["abc.spec.ts", "xyz.spec.ts"];
      config.reporterOptions = {
        charts: true,
        graphs: false,
      };
      config.retries = {
        openMode: 2,
        runMode: 2,
      };
      return config;
    },
  },
});

In cypress settings, I can see that all given config properties got resolved with values provided in setupNodeEvents, except retries and reporterOptions

  • retries still shows {runMode: 0, openMode: 0}
  • reporterOptions still shows null

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Mar 13, 2024
@gustawx
Copy link
Author

gustawx commented Mar 13, 2024

Hello @jennifer-shehane could someone from Cypress team check this issue? Due to inactivity it will be automatically closed. It's not a good way to handle the issues ;]

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label Mar 14, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Sep 10, 2024
@gustawx
Copy link
Author

gustawx commented Sep 10, 2024

@jennifer-shehane any update on this issue? Still valid...

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label Sep 11, 2024
@jennifer-shehane jennifer-shehane added the prevent-stale mark an issue so it is ignored by stale[bot] label Sep 16, 2024
@jennifer-shehane
Copy link
Member

Has anyone confirmed if this is a bug with the visual display of the reporterOptions/retries in the resolved config in the UI? Or is it also a problem with Cypress reading in these values properly. My guess is that it's a bug in the resolved config VIEW.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Sep 16, 2024
@gustawx
Copy link
Author

gustawx commented Sep 18, 2024

Yes, it really doesn't work, it's not only the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent-stale mark an issue so it is ignored by stale[bot] stage: needs investigating Someone from Cypress needs to look at this
Projects
None yet
Development

No branches or pull requests

5 participants