{"_id":"@comeon/agent-js-cypress","_rev":"1-8a0ba86a0585f184a085d7f037dc8815","name":"@comeon/agent-js-cypress","dist-tags":{"latest":"1.4.2"},"versions":{"1.4.2":{"name":"@comeon/agent-js-cypress","version":"1.4.2","description":"This agent helps Cypress to communicate with Report Portal","main":"index.js","scripts":{"eslint":"eslint \"./**/*.js\"","format":"npm run eslint -- --fix"},"contributors":[{"name":"Velu S Gautam","email":"i@velusgautam.com"},{"name":"Roshith CK","email":"roshith.chiminiyan@comeon.com"}],"keywords":["comeon-automation","ReportPortal","Cypress","reporting","epam"],"repository":{"type":"git","url":"git+https://github.com/comeon-stockholm/agent-js-cypress.git"},"dependencies":{"@comeon-stockholm/reportportal-client":"^2.0.0","glob":"7.1.3","mocha":"7.0.1"},"license":"Apache-2.0","devDependencies":{"cypress":"3.8.2","eslint":"6.5.1","eslint-config-airbnb-base":"14.0.0","eslint-config-prettier":"6.9.0","eslint-plugin-cypress":"2.8.1","eslint-plugin-import":"2.20.0","eslint-plugin-prettier":"3.1.2","prettier":"1.19.1"},"gitHead":"db2ac977ff50465780513a09a7fdf9ff610a4b9c","bugs":{"url":"https://github.com/comeon-stockholm/agent-js-cypress/issues"},"homepage":"https://github.com/comeon-stockholm/agent-js-cypress#readme","_id":"@comeon/agent-js-cypress@1.4.2","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-46PECF4ZoVzcPkLNEEYfV5RaqRPXuDMQy9ILLmyeddOY4/0+OOWM8Njay6lw0RcMjTDBS5eiw5mgbe/a/pxnsQ==","shasum":"9dc8e67e046c769eea3d864463d73df78ed72f6b","tarball":"https://registry.npmjs.org/@comeon/agent-js-cypress/-/agent-js-cypress-1.4.2.tgz","fileCount":15,"unpackedSize":57227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1qAaCRA9TVsSAnZWagAATzUQAJmtVfdj2+SC/4EHw/jP\nHCL5ExrfIAD3rotWVnC9yXmoKA1hmnrEWuwmrSffb/DtiPTiXa2pVkg/l5c1\nHbQhRyPq+A4VDjokDa6Wd3g4iwdYvtm/cm08JBuRA9yQFM+N5bKBHm3CyOc2\nKaNFOgaeo7BRrLenhZkKUbBrfVuL3/SbSwIDgDXxmasD5YMy/hbKwKtpgi8C\n7C7b2xkbyhQ70ZOXP3CrOWPbN2UGdyo6OTbf6rpVcTsYpHgWg8bdYLyn+gyL\nhEt7z5CvLGW5eFS29NU+v9KFxq9SoAWfa0R8xEchL/FTxP5/2VxECj/OKFSJ\nRZErga7RHl49VgSQTQfSOrnpB1p7gol0yUUXvofLTBv3pH/19+anFtTD7XvI\nEd6/2NxE1p9AI/wv9temDsYomKYyfwMMtFBIXtY8PIMkQKSqpgpMXwjzpFsI\no9t2FIy8XNxo0fwS8ed5m17NMnN+KHuGs/j7HEa4S+a5TPCRNrEZHY4s74wK\nprQ2G0cT4W5whg4a7eahDgQsSDsdTpHTxTbdWGrnpxFkyaFzGsib9frFDN31\nhXtDMGbCgITPYZrJPxENTOCXYtrC7kZfSDfZLhstbRBURZHCmCusMgXf88lu\ntzdj2veX6yPkG3JLwrEzr7c2s/sZGYr7zwSFiEg0sA8qG7BAiPUQB9KGPrht\nm4Je\r\n=vEqd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoJAHajhhFOMy13X6p1D25gwb7C0j9S4/kOc9NaFaK5AiAOp82iN3q5VFv2rttPqi2zCl+L1TzE919Ld1C6oAyGUw=="}]},"maintainers":[{"name":"drfront","email":"npm@comeon.com"},{"name":"stockholm","email":"npm@comeon.com"}],"_npmUser":{"name":"stockholm","email":"npm@comeon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/agent-js-cypress_1.4.2_1591123994392_0.30516477243354156"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-02T18:53:14.255Z","1.4.2":"2020-06-02T18:53:14.494Z","modified":"2022-04-05T00:24:02.231Z"},"maintainers":[{"name":"drfront","email":"npm@comeon.com"},{"name":"stockholm","email":"npm@comeon.com"}],"description":"This agent helps Cypress to communicate with Report Portal","homepage":"https://github.com/comeon-stockholm/agent-js-cypress#readme","keywords":["comeon-automation","ReportPortal","Cypress","reporting","epam"],"repository":{"type":"git","url":"git+https://github.com/comeon-stockholm/agent-js-cypress.git"},"contributors":[{"name":"Velu S Gautam","email":"i@velusgautam.com"},{"name":"Roshith CK","email":"roshith.chiminiyan@comeon.com"}],"bugs":{"url":"https://github.com/comeon-stockholm/agent-js-cypress/issues"},"license":"Apache-2.0","readme":"# agent-js-cypress\n\nCypress js agent is runtime reporter for [EPAM report portal](https://github.com/comeon-stockholm/agent-js-cypress) which provides information about collection run.\n\n## Install\n\n\n```console\nnpm install @comeon-stockholm/agent-js-cypress --save-dev\n```\n\n## Usage\n\n\n#### Cypress.json\n\nAdd the following options to cypress.json\n\n\n```json\n\n{\n    \"reporter\": \"agent-js-cypress\",\n    \"reporterOptions\": {\n        \"endpoint\": \"http://your-instance.com:8080/api/v1\",\n        \"token\": \"00000000-0000-0000-0000-000000000000\",\n        \"launch\": \"LAUNCH_NAME\",\n        \"project\": \"PROJECT_NAME\",\n        \"description\": \"PROJECT_DESCRIPTION\",\n        \"isLaunchMergeRequired\": false\n    }\n}\n\n```\n\nTo run example tests also add the following settings to cypress.json, replace `\"reporter\": \"agent-js-cypress\"` by `\"reporter\": \"index.js\"` and use command `npm test`.\n\n```json\n\n{\n  ...\n  \"integrationFolder\": \"example/integration\",\n  \"screenshotsFolder\": \"example/screenshots\"\n}\n\n```\n\n#### Add file to run Cypress with custom behavior\n\nCreate folder \"scripts\" on project folder. Copy the following script into \"cypress.js\" file and put it to \"scripts\"\nfolder.\n\n```javascript\n\nconst cypress = require('cypress'),\n    RPClient = require('@comeonautomation/reportportal-client')\n    fs = require('fs'),\n    glob = require(\"glob\");\n\nconst cypressConfigFile = \"cypress.json\";\n\n\nconst getLaunchTempFiles = () => {\n    return glob.sync(\"rplaunch-*.tmp\");\n}\n\nconst deleteTempFile = (filename) => {\n    fs.unlinkSync(filename);\n}\n\ncypress.run().then(\n    () => {\n      fs.readFile(cypressConfigFile, 'utf8', function (err, data) {\n        if (err) {\n            throw err;\n        }\n\n        const config = JSON.parse(data);\n\n        if (config.reporterOptions.isLaunchMergeRequired) {\n            const client = new RPClient(config.reporterOptions);\n            client.mergeLaunches();\n            const files = getLaunchTempFiles();\n            files.map(deleteTempFile);\n        }\n      });\n    },\n    error => {\n      console.error(error)\n\n      const files = getLaunchTempFiles();\n      files.map(deleteTempFile);\n      process.exit(1)\n    }\n);\n\n```\n\n#### Update package.json \"scripts\" section\n\n```json\n\n\"scripts\": {\n    ...\n    \"cypress\": \"node scripts/cypress.js\",\n    ...\n},\n\n```\n\n## Options\n\nRuns support following options:\n\n| Parameter             | Description                                                                                                       |\n| --------------------- | ----------------------------------------------------------------------------------------------------------------- |\n| token                 | User's Report Portal token from which you want to send requests. It can be found on the profile page of this user. |\n| endpoint              | URL of your server. For example 'https://server:8080/api/v1'.                                                     |\n| launch                | Name of launch at creation.                                                                                       |\n| project               | The name of the project in which the launches will be created.                                                    |\n| isLaunchMergeRequired | Determines merge Cypress run's in to one launch or not                                                            |\n| rerun                 | Enable [rerun](https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/rerun.md)           |\n| rerunOf               | UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name|\n\n## Screenshot support\n\nCurently supported only default usage of Cypress screenshot function. Using custom filename **is not supported**.\n\n```javascript\n\ncy.screenshot()\ncy.get('.post').screenshot()\n\n```\n\n# Copyright Notice\n\nLicensed under the [Apache License v2.0](LICENSE)\n\n# Contribution\n\n<img src=\"img/ahold-delhaize-logo-green.jpg\" width=\"250\">\n","readmeFilename":"README.md"}