YOU54F / cypress-plugins

A home for various Cypress Plugins
https://cypress-plugins.saf.dev/
MIT License
168 stars 45 forks source link

Only report to slack no CI #872

Closed bezba closed 3 years ago

bezba commented 3 years ago

Hi, I am not sure how I can use this to only report on slack. I have the slack webhook , but all i want is that when I run npm test to run all the specs and generates a report on its own at the end and posts it on slack. I followed this https://medium.com/@you54f/slack-reporting-for-cypress-io-421064865a83 You say I do this $ export SLACK_WEBHOOK_URL=yourWebhookUrlHere I dont have a CI or anything. "reporter": "cypress-multi-reporters", "reporterOptions": { "reporterEnabled": "mochawesome", "mochawesomeReporterOptions": { "reportDir": "cypress/reports/mocha", "quite": true, "overwrite": false, "html": false, "json": true } }

and in my package.json I have "cy:run": "CYPRESS_RETRIES=3 cypress run "", "clean:reports": "rm -R -f cypress/reports && mkdir cypress/reports && mkdir cypress/reports/mochareports", "pretest": "npm run clean:reports", "scripts": "cypress run", "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", "posttest": "npm run combine-reports && npm run generate-report", "test" : "npm run cy:run|| npm run posttest"

"dependencies": { "cypress": "^5.2.0", "cypress-cucumber-preprocessor": "^2.5.4", "cypress-file-upload": "^4.0.7", "cypress-multi-reporters": "^1.4.0", "faker": "^4.1.0", "mocha": "^8.2.1", "mochawesome": "^6.2.1", "mochawesome-merge": "^4.2.0", "mochawesome-report-generator": "^5.1.0" },

YOU54F commented 3 years ago

Hi,

Running it with --ci-provider none should give you the required behaviour of sending a report only to slack, based on your test results.