GithubHelp home page GithubHelp logo

Comments (2)

sourav-kundu avatar sourav-kundu commented on May 28, 2024

@debosmita-29 Could you point to the exact integration steps that you do locally or share a link to a sample where this integration works out of the box, for us to be able to reproduce it on our end?

from browserstack-cypress-cli.

debosmita-29 avatar debosmita-29 commented on May 28, 2024

Hi @sourav-kundu!
I am installing a npm package in dev dependencies
"@reportportal/agent-js-cucumber": "^5.0.2",
"@reportportal/agent-js-cypress": "^5.0.2",

I have added this plugin @reportportal/agent-js-cypress/lib/plugin to our cypress/plugins/index.ts file like this
`///
const browserify = require('@cypress/browserify-preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
const resolve = require('resolve');
const fs = require('fs');
const pdf = require('pdf-parse');
const { isFileExist } = require('cy-verify-downloads');
const registerReportPortalPlugin = require('@reportportal/agent-js-cypress/lib/plugin');

module.exports = (on, config) => {
registerReportPortalPlugin(on, config);
const updatedConfig = {
...config,
reporterOptions: {
...config.reporterOptions,
token: process.env.ReportPortalToken
}
};
};

module.exports = on => {
on('file:preprocessor', cucumber());
};

module.exports = (on, config) => {
const options = {
...browserify.defaultOptions,
typescript: resolve.sync('typescript', { baseDir: config.projectRoot })
};`

Moreover, I am importing this library in our custom commands here require('@reportportal/agent-js-cypress/lib/commands/reportPortalCommands');

I am creating a reportPortal config in the root of our project relative to cypress.json and browserstack.json
{ "token": "${rp.token}", "endpoint": "${rp.endpoint}/api/v1", "launch": "${rp.launch}", "project": "${rp.your_project}", "takeScreenshot": "onFailure", "description": "Awesome launch description.", "attributes": [ { "key": "launchAttributeKey", "value": "launchAttributeValue" } ], "mode": "DEFAULT", "debug": false, "restClientConfig": { "timeout": 0 } }

In cypress.json I am adding the reporterOptions as
"reporterOptions": { "reporterEnabled": ["@reportportal/agent-js-cypress"], "reportportalAgentJsCypressReporterOptions": { "endpoint": "http://ech-10-157-151-162.mastercard.int:8080/api/v1", "token": "c001e2b2-1db0-4a67-8888-e538d5a7dbe7", "launch": "debosmita.roysaha_TEST_CYPRESS", "project": "cera", "description": "Testing ReportPortal Integration with Cypress", "isLaunchMergeRequired": false, "debug": true } },

Similarly, I am pointing my browserstack.json to the dev dependency
{ "browsers": [ { "browser": "chrome", "os": "Windows 10", "versions": ["88"] }, { "browser": "chrome", "os": "OS X Catalina", "versions": ["88"] }, { "browser": "firefox", "os": "Windows 10", "versions": ["88"] }, { "browser": "edge", "os": "Windows 10", "versions": ["88"] } ], "run_settings": { "cypress_config_file": "./cypress.json", "project_name": "Expense-Management-UI", "build_name": "Expense-Management-e2e", "cypress_version": "7", "system_env_vars": ["ReportPortalEndpoint", "ReportPortalToken", "ReportPortalProject"], "specs": ["cypress/integration/**/*.feature"], "exclude": [ "cypress/integration/approver-e2e/approver-list-page-accessibility.feature", "cypress/integration/cardholder-e2e/cardholder-list-page-accessbility.feature", "cypress/integration/smoke-test.feature", "cypress/integration/cardholder-e2e/cardholder-readonly-expenses.feature" ], "downloads": ["./results"], "parallels": "4", "npm_dependencies": { "@cypress/browserify-preprocessor": "3.0.1", "@types/cucumber": "6.0.1", "@types/cypress-cucumber-preprocessor": "4.0.0", "axe-core": "^4.1.4", "cypress": "^7.5.0", "cypress-axe": "^0.12.2", "cypress-cucumber-preprocessor": "4.0.1", "cypress-mochawesome-reporter": "1.3.0", "ts-node": "~5.0.1", "@cucumber/cucumber": "7.0.0", "cypress-file-upload": "^5.0.8", "cypress-localstorage-commands": "^1.4.1", "cucumber": "6.0.5", "resolve": "1.20.0", "cypress-multi-reporters": "^1.5.0", "cypress-plugin-tab": "^1.0.5", "pdf-parse": "^1.1.1", "cy-verify-downloads": "0.0.5", "@reportportal/agent-js-cypress": "^5.0.2" }, "package_config_options": { "cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true } } }, "connection_settings": { "local": false, "local_identifier": null }, "disable_usage_reporting": false, "browserstack.debug": "true", "browserstack.console": "info" }

from browserstack-cypress-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.