YOU54F / cypress-multi-reporters

A maintained fork of mocha-multi-reporters compatible with mocha 6+ and below
MIT License
74 stars 6 forks source link

ECONNREFUSED due to incorrect path for latest @reportportal/agent-js-cypress reporter #95

Closed mleonard0826 closed 3 years ago

mleonard0826 commented 4 years ago

Expected behavior

I can utilize cypress-multi-reporters to employ both @reportportal/agent-js-cypress and mochawesome in my project.

Actual behavior

I am presented with the following error when executing my tests:

Fail to start launch Error: connect ECONNREFUSED 127.0.0.1:80
    at [Path to Project]/node_modules/@reportportal/client-javascript/lib/rest.js:31:23
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Information about the Issue

I believe that cypress-multi-reporters may be pointing to the wrong child folder of the @reportportal module. The error implies it's pointed to @reportportal/client-javascript when it should be looking at @reportportal/agent-js-cypress.

My cypress.json file includes:

    "reporter": "cypress-multi-reporters",
    "reporterOptions": {
        "configFile": "reporter.json"
    },
    "supportFile": "cypress/support/index.js"

My reporter.json file:

{
    "reporterEnabled": "@reportportal/agent-js-cypress, mochawesome",
    "agentJsCypressReporterOptions": {
        "endpoint": "http://localhost:8080/api/v1",
        "token": "35c84358-5bb2-419f-9bd7-3cafa424db74",
        "launch": "Cypress Test Run 2020.09.21",
        "project": "Pricing",
        "description": "Test run from [Project Name]",
        "isLaunchMergeRequired": true
    },
    "mochawesomeReporterOptions": {
        "reportDir": "cypress/reports/mocha",
        "quite": true,
        "overwrite": true,
        "html": false,
        "json": true
    }
}

Steps to reproduce the behavior

  1. Implement cypress-multi-reporters with @reportportal/agent-js-cypress and mochawesome as two reporters
  2. Run Cypress tests
YOU54F commented 4 years ago

Can you check

https://github.com/YOU54F/cypress-multi-reporters#configuring-reporters

dropping the @ should work for scoped reporters 👍🏽

YOU54F commented 4 years ago

Thank you for the great report btw

mleonard0826 commented 4 years ago

Hi @YOU54F

I'm not currently able to evaluate this as my local instance of Report Portal is no longer working. I've reached out to the Report Portal team for assistance and will try this once it's back up.

YOU54F commented 3 years ago

Hi @mleonard0826 I am going to close this because I believe the posted solution should solve this issue. Feel free to reopen if you ever need to!