Could not load reporter by name: cypress-testrail-reporter

2.3k views Asked by At

I'm trying to publish my cypress test result into testrail with cypress-testrail-reporter I set up my cypress.json as follows

{
    "baseUrl": "https://myAppUrl.xyz",
    "viewportWidth": 1920,
    "viewportHeight": 1080,
    "video": false,
    "reporter": "cypress-testrail-reporter",
    "reporterOptions": {
        "host": "https://mycompnay.com/testrail",
        "username": "[email protected]",
        "password": "testrailsPassword",
        "projectId": 2,
        "suiteId": 18120
    }
}

And package.json as follows

{
  "name": "vivifytestrailreporter",
  "version": "1.0.0",
  "description": "https://github.com/Vivify-Ideas/cypress-testrail-reporter#readme",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cypress": "^7.2.0"
  },
  "devDependencies": {
    "cypress-testrail-reporter": "^1.2.8"
  }
}

Created a simple test that runs fine with npx cypress open and has the case id on it as follows

/// <reference types="Cypress" />

describe('Info tests', () => {
    it('C1294180 - Verify info', () => {
        ... cy.commands to runt he test 
    });
});

But when I run npx cypress run to test and publish the results I got this error can you help me fix it

~/workspace/testrailReporterCustomized » npx cypress run                                                                                                                                                             
Could not load reporter by name: cypress-testrail-reporter

We searched for the reporter in these paths:

- /Users/juanvaldez/git/testrailReporterCustomized/cypress-testrail-reporter
- /Users/juanvaldez/git/testrailReporterCustomized/node_modules/cypress-testrail-reporter

Error: Could not locate the bindings file. Tried:
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/build/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/build/Debug/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/build/Release/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/out/Debug/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/Debug/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/out/Release/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/Release/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/build/default/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/compiled/14.15.1/darwin/x64/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/addon-build/release/install-root/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/addon-build/debug/install-root/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/addon-build/default/install-root/deasync.node
 → /Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/lib/binding/node-v87-darwin-x64/deasync.node
    at bindings (/Users/juanvaldez/git/testrailReporterCustomized/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/Users/juanvaldez/git/testrailReporterCustomized/node_modules/deasync/index.js:30:31)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12789)
    at Function.Module._load (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/override_require.js:15:27)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/juanvaldez/git/testrailReporterCustomized/node_modules/cypress-testrail-reporter/dist/testrail.js:52:15)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12789)
    at Function.Module._load (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/override_require.js:15:27)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/juanvaldez/git/testrailReporterCustomized/node_modules/cypress-testrail-reporter/dist/cypress-testrail-reporter.js:21:18)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12789)
    at Function.Module._load (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/override_require.js:15:27)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/juanvaldez/git/testrailReporterCustomized/node_modules/cypress-testrail-reporter/index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12789)
    at Function.Module._load (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/override_require.js:15:27)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Function.loadReporter (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/reporter.js:524:14)
    at ProjectE2E.watchSettingsAndStartWebsockets (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/project-base.js:270:36)
    at /Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/project-base.js:142:49
    at tryCatcher (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/juanvaldez/Library/Caches/Cypress/7.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:461:21)
1

There are 1 answers

0
sania dsouza On

Not sure you could solve this but I also ran across this today. Turns out the deasync package is causing an issue. I reverted the cypress-testrail-reporter version to 1.2.2 which didn't use deasync as a dependency and it seems to work. If you haven't seen a more solid fix, this works for the time-being.

I am using the latest cypress 7.5.0 btw.