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

Could not load reporter by name: cypress-multi-reporters (used in Buildkite CI/CD pipeline) #154

Closed luisaangelicag closed 1 year ago

luisaangelicag commented 3 years ago

Expected behavior

cypress-multi-reporters can be found

Actual behavior

Could not load reporter by name: cypress-multi-reporters
--
  |  
  | We searched for the reporter in these paths:
  |  
  | - /tribe-brand-cypress/cypress-multi-reporters
  | - /tribe-brand-cypress/node_modules/cypress-multi-reporters
  |  
  | The error we received was:
  |  
  | Cannot find module '/tribe-brand-cypress/node_modules/cypress-multi-reporters'

Information about the Issue

I'm trying to setup our automation CI/CD pipeline (Buildkite) to generate reports and integrate it to slack (cypress-slack-reporters).

Here's the cypress.json setup:

{
  "baseUrl": "http://172.16.0.6",
  "env": {
    "platform_host": "http://172.16.0.5",
    "brand_app_host": "http://172.16.0.6"
  },
  "pageLoadTimeout": 150000,
  "defaultCommandTimeout": 20000,
  "viewportWidth": 1200,
  "viewportHeight": 1000,
  "video": false,
  "chromeWebSecurity": false,

  "reporter": "cypress-multi-reporters",
  "reporterOptions": {
    "reporterEnabled": "mochawesome",
    "mochawesomeReporterOptions": {
        "reportDir": "cypress/reports/mocha",
        "quiet": true,
        "overwrite": false,
        "html": false,
        "json": true
    }
  }
}

Here's package.json with the currently installed modules

{
  "name": "tribe-brand-cypress",
  "version": "1.0.0",
  "description": "QA cypress tests for new brand app",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "cy:run": "cypress run --browser chrome",
    "clean:reports": "rm -R -f cypress/reports && mkdir cypress/reports && mkdir cypress/reports/mochareports",
    "pre-test": "npm run clean:reports",
    "combine-reports": "mochawesome-merge cypress/reports/mocha/*.json > cypress/reports/mochareports/report.json",
    "generate-report": "marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mochareports",
    "post-test": "npm run combine-reports && npm run generate-report",
    "slack-reporter": "npx cypress-slack-reporter --report-dir=cypress/reports/mochareports --ci-provider=custom --custom-url=cypress/reports/mochareports/report.html"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/TribeInfluence/tribe-brand-cypress.git"
  },
  "keywords": [
    "cypress"
  ],
  "author": "oscar",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/TribeInfluence/tribe-brand-cypress/issues"
  },
  "homepage": "https://github.com/TribeInfluence/tribe-brand-cypress#readme",
  "devDependencies": {
    "cypress": "^3.8.3",
    "cypress-multi-reporters": "^1.5.0",
    "cypress-slack-reporter": "^1.2.1",
    "gmail-tester": "^1.1.0",
    "mocha": "^9.0.3",
    "mochawesome": "^6.2.2",
    "mochawesome-merge": "^4.2.0",
    "mochawesome-report-generator": "^5.2.0"
  },
  "dependencies": {
    "xhr": "^2.5.0"
  }
}

Steps to reproduce the behavior

The dockerfile used in the automation CI/CD pipeline also includes the installation of the packages needed for the report: image

Based on the logs, cypress-multi-reporters is installed successfully so I'm not sure where my config went wrong image

The issue cannot be reproduced when ran locally.

YOU54F commented 1 year ago

Will be archiving this repo today, thanks for the issue raising

Code is now held here https://github.com/YOU54F/cypress-plugins/tree/master/cypress-multi-reporters