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

allure-cypress : getting error - 'Converting circular structure to JSON' #1070

Closed
delatrie opened this issue Jul 23, 2024 · 7 comments · Fixed by #1127
Closed

allure-cypress : getting error - 'Converting circular structure to JSON' #1070

delatrie opened this issue Jul 23, 2024 · 7 comments · Fixed by #1127
Assignees
Labels
theme:cypress type:bug Something isn't working
Milestone

Comments

@delatrie
Copy link
Collaborator

delatrie commented Jul 23, 2024

Discussed in https://github.com/orgs/allure-framework/discussions/2650

Originally posted by pranit-lqc July 22, 2024
We are using Vue 3 component on the UI side.

Version,
"allure-commandline": "^2.29.0",
"allure-cypress": "^3.0.0-beta.7",
"cypress": "13.5.1",

Getting below error:

without the Allure plugin, we don't see this error.

@delatrie delatrie added the type:bug Something isn't working label Jul 23, 2024
@delatrie
Copy link
Collaborator Author

Presumably, we're trying to stringify too much here:

args: command.attributes.args.map((arg) => (typeof arg === "string" ? arg : JSON.stringify(arg, null, 2))),

@Karczewski
Copy link

Hi, I'm encountering the same issue.
Instead of using JSON.stringify, you can use something like this:

function safeStringify(obj, replacer, spaces) {
  try {
    return JSON.stringify(obj, replacer, spaces);
  } catch (error) {
    return `[Unserializable: ${error.message}]`;
  }
};

@perrsikk
Copy link

Hello
Issue reproduces with latest allure-cypress version "3.0.0-beta.10"
image

@baev
Copy link
Member

baev commented Aug 12, 2024

@perrsikk thanks for the info

@baev baev reopened this Aug 12, 2024
@baev baev self-assigned this Aug 12, 2024
@BlessedLongsword
Copy link

I am also having this issue. For now, it has happened when doing a cy.wrap() inside a .each() loop of a list of DOM elements, or at the end of a .within() block.

For example:

  • within() block
    cy.get('[status="positive"]').first().within(() => {
      cy.contains('Created');
      cy.get([icon="clear"]).click();
    });
  • each() block
cy.get('[data-testid="loc-list"]').find('list')
            .should('have.length', data.length)
            .each(($loc, index) => {
              const locName = data.at(index).name;
              cy.wrap($loc).should('contain.text', locName);
            });

@delatrie delatrie assigned delatrie and unassigned baev Aug 20, 2024
@Vinit-Sapiens
Copy link

@delatrie , any update on issue. it is kind of blocker for us.

@delatrie
Copy link
Collaborator Author

delatrie commented Sep 4, 2024

The fix will be released as soon as #1127 gets reviewed & merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:cypress type:bug Something isn't working
Projects
None yet
6 participants