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

Can not set reporterOptions from inside plugins #7652

Closed
nitzanashi opened this issue Jun 10, 2020 · 7 comments
Closed

Can not set reporterOptions from inside plugins #7652

nitzanashi opened this issue Jun 10, 2020 · 7 comments
Labels
stale no activity on this issue for a long period type: unexpected behavior User expected result, but got another

Comments

@nitzanashi
Copy link

nitzanashi commented Jun 10, 2020

Current behavior:

setting reporterOptions inside plugins/index.js does nothing.
also, reporterOptions is not part of ConfigOptions interface :/

Desired behavior:

setting reporterOptions inside plugins/index.js returns the settings as described.

Test code to reproduce

// plugins/index.js

module.exports = (on, config) => {
    return {
        ...config,
        reporterOptions: {
            test: true,
        },
    };
}

Versions

tested on 4.5.0

@jennifer-shehane
Copy link
Member

This may be a case where the reporterOptions on non-mutable at this point like in #6407, but I'm unaware of this situation.

I can see that the config is changed within the plugins, but not shown in the resolved Configuration - but console.log(Cypress.config('reporterOptions')) resolves with the correct value.

Are the new values passed to reporterOptions not taking effect at all?

@jennifer-shehane jennifer-shehane added the type: unexpected behavior User expected result, but got another label Jun 11, 2020
@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Jun 11, 2020
@albertmir
Copy link

albertmir commented Aug 12, 2020

Just to bring more information.
I saw that setting reporterOptions value as a string resolves correctly in configuration. It is only when setting an object inside of it that we get the null.

// plugins/index.js

module.exports = (on, config) => {
    return {
        ...config,
        reporterOptions: "This is just a test",
    };
}

Settings tab:
image

Can it be a somehow related to this previous issue #7959?

Versions:

Tested on 4.12.1

@quad5
Copy link

quad5 commented Nov 10, 2020

This seems to be working fine in 5.5.0.

@sainthkh
Copy link
Contributor

@quad5 When reporterOptions is a string, it shows the value correctly, but when it's an object, it simply shows a null.

@cypress-bot cypress-bot bot added stage: ready for work The issue is reproducible and in scope and removed stage: needs investigating Someone from Cypress needs to look at this labels Dec 21, 2020
@ilbmiller
Copy link

ilbmiller commented Apr 14, 2022

It is still an issue in cypress 7.2.0. Frustrating as we have our own config file 'extends' enhancement that relies on plugins processing of config files, and thus can't 'inherit' a reporterOptions object from an ancestor configFile due to this bug.

@cypress-bot cypress-bot bot added stage: backlog and removed stage: ready for work The issue is reproducible and in scope labels Apr 28, 2022
@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 May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

7 participants