Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReportPortal.io integration is not supported with BrowserStack-Cypress Runs #277

Open
debosmita-29 opened this issue Mar 9, 2022 · 2 comments

Comments

@debosmita-29
Copy link

We currently leverage BrowserStack-Cypress-CLI to run our regression tests and we want it to be integrated with ReportPortal.io but the integration is not supported for the BrowserStack-Cypress runs. While our other tests that execute Cypress run command does integrate well with ReportPortal.io. We have a use-case to get real-time reporting from our regression tests as well which is blocked because of this unsupported feature.

Could you please take a look into this use-case and revert.

Thanks!

@sourav-kundu
Copy link

@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?

@debosmita-29
Copy link
Author

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" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants