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

Cypress reporter wont work with explicit case ID #709

Open
MHazenHT opened this issue Nov 18, 2024 · 3 comments
Open

Cypress reporter wont work with explicit case ID #709

MHazenHT opened this issue Nov 18, 2024 · 3 comments

Comments

@MHazenHT
Copy link

Ive tried both scenarios where the Qase ID is explicit and does not exist ( 9999) and when it does exist (case 63 exists already)

In either case I get the same error (whole shebang below)

What does work is not using a Qase ID at all. Not even including the qase statement in the test, the tests are created and results are updated, telling me the api and qase reporter mostly work. But I would like the mapping to be more robust in case tests are reorganized - moved around between suites or projects.

Error mentioned above:

Adding test result: {"attachments":[],"author":null,"fields":{},"message":"nullThe following error originated from your test code, not from Cypress.\n\n > Cannot read properties of undefined (reading 'constants')\n\nWhen Cypress detects uncaught errors originating from your test code it will automatically fail the current test.\n\nCypress could not associate this error to any specific test.\n\nWe dynamically generated a new test to display this failure.","muted":false,"params":{},"group_params":{},"relations":{"suite":{"data":[]}},"run_id":null,"signature":"cypress::e2e::myktest.cy.js::an_uncaught_error_was_detected_outside_of_a_test","steps":[],"id":"687750e4-9651-466f-8145-3d7e12399ddc","execution":{"status":"failed","start_time":null,"end_time":null,"duration":228,"stacktrace":"TypeError: The following error originated from your test code, not from Cypress.\n\n > Cannot read properties of undefined (reading 'constants')\n\nWhen Cypress detects uncaught errors originating from your test code it will automatically fail the current test.\n\nCypress could not associate this error to any specific test.\n\nWe dynamically generated a new test to display this failure.\n at ./node_modules/cypress-qase-reporter/dist/reporter.js (webpack://@hiringthing/hiringthing/./node_modules/cypress-qase-reporter/dist/reporter.js:15:79)\n at __webpack_require__ (webpack://@hiringthing/hiringthing/webpack/bootstrap:19:0)\n at ./node_modules/cypress-qase-reporter/dist/index.js (webpack://@hiringthing/hiringthing/./node_modules/cypress-qase-reporter/dist/index.js:2:19)\n at __webpack_require__ (webpack://@hiringthing/hiringthing/webpack/bootstrap:19:0)\n at eval (webpack://@hiringthing/hiringthing/./cypress/e2e/myktest.cy.js:1:0)\n at eval (https://asdf.applicant-tracking.test:3000/__cypress/tests?p=cypress/e2e/myktest.cy.js:97705:2)\n at eval (https://asdf.applicant-tracking.test:3000/__cypress/tests?p=cypress/e2e/myktest.cy.js:97706:12)\n at eval (<anonymous>)","thread":null},"testops_id":null,"title":"An uncaught error was detected outside of a test"} [2024-11-18T21:08:04.979Z] [DEBUG] qase: Config: {"id":"default","mode":"testops","debug":true,"logging":true,"createNewCases":true,"testops":{"api":{"token":"REDACTED"},"project":"CYPRESS","uploadAttachments":true,"run":{"title":"Cypress Automated Tests","complete":true,"id":6},"plan":{},"batch":{}},"report":{"connections":{"local":{}}}} [2024-11-18T21:08:05.115Z] [DEBUG] qase: Transformed result: {"attachments":[],"comment":"nullThe following error originated from your test code, not from Cypress.\n\n > Cannot read properties of undefined (reading 'constants')\n\nWhen Cypress detects uncaught errors originating from your test code it will automatically fail the current test.\n\nCypress could not associate this error to any specific test.\n\nWe dynamically generated a new test to display this failure.","defect":false,"param":{},"param_groups":[],"stacktrace":"TypeError: The following error originated from your test code, not from Cypress.\n\n > Cannot read properties of undefined (reading 'constants')\n\nWhen Cypress detects uncaught errors originating from your test code it will automatically fail the current test.\n\nCypress could not associate this error to any specific test.\n\nWe dynamically generated a new test to display this failure.\n at ./node_modules/cypress-qase-reporter/dist/reporter.js (webpack://@hiringthing/hiringthing/./node_modules/cypress-qase-reporter/dist/reporter.js:15:79)\n at __webpack_require__ (webpack://@hiringthing/hiringthing/webpack/bootstrap:19:0)\n at ./node_modules/cypress-qase-reporter/dist/index.js (webpack://@hiringthing/hiringthing/./node_modules/cypress-qase-reporter/dist/index.js:2:19)\n at __webpack_require__ (webpack://@hiringthing/hiringthing/webpack/bootstrap:19:0)\n at eval (webpack://@hiringthing/hiringthing/./cypress/e2e/myktest.cy.js:1:0)\n at eval (https://asdf.applicant-tracking.test:3000/__cypress/tests?p=cypress/e2e/myktest.cy.js:97705:2)\n at eval (https://asdf.applicant-tracking.test:3000/__cypress/tests?p=cypress/e2e/myktest.cy.js:97706:12)\n at eval (<anonymous>)","start_time":null,"status":"failed","steps":[],"time":null,"time_ms":228,"case":{"title":"An uncaught error was detected outside of a test","suite_title":"","description":null,"postconditions":null,"preconditions":null}} [2024-11-18T21:08:05.471Z] [DEBUG] qase: Results sent to Qase: 1

@gibiw
Copy link
Contributor

gibiw commented Nov 19, 2024

@MHazenHT Hi! Can you show me how do you specify Qase ID in a test?

@MHazenHT
Copy link
Author

Sure!

I was intending to give automated tests a high ID number and I had hoped that the relationship would be preserved when test were moved, or renamed.

import { qase } from "cypress-qase-reporter";

describe("Qase Minimal Test", function () {
  qase(1001, it("Links to an existing test case", function () {
    cy.visit("https://example.com");
    cy.contains("More information").should("exist");
  }));
});

@gibiw
Copy link
Contributor

gibiw commented Nov 19, 2024

@MHazenHT you need to update import:

import {qase} from 'cypress-qase-reporter/mocha'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants