-
Notifications
You must be signed in to change notification settings - Fork 19
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
Multiple browsers not working #2
Comments
This is working for me now. So you can close the issue... |
Hi @csrenato do you mind sharing as to how you got this working within a cucumber context? Thanks in advance. |
Hi @bhreinb I've followed another path for this problem. First, I have created a npm task in package.json for each browser/device I am testing on (npm run Chrome, npm run Firefox ...). Each of the tasks will run the test on a predefined port. Example: "Chrome": "cucumber-js --world-parameters {\"port1\":\"1111\"\,\"port2\":\"1112\"\,\"skipJsErrors\":[\"true\"]\,\"browsers\":[\"chrome\"]\"\} --format json:reports/report.json" Code from hooks: function runTest(browsers, tcOptions) { createTestCafe('localhost', tcOptions.port1, tcOptions.port2) After that I have created a Jenkins job for each of those npm tasks (for example: npm run Chrome). The job name would then be "Chrome", the other job would be Firefox and so on. When I launch that particular job, I use the Jenkins job name variable to pass it in the npm task. Example from Jenkinsfile: def NPM_TASK = sh (script: "echo $JOB_NAME ",returnStdout: true).trim() sh "npm run $NPM_TASK" This way, you can use only 1 Jenkinsfile for all of your tests and save yourself the trouble of maintaining multiple repositories and you can run all your tests in parallel. |
Hello Helen.
First of all, thank you for providing the cucumber testcafe demo, it was of great help for me.
I would like to ask you if you had any problems running the tests in multiple browsers?
My code snippet from hooks.js:
return runner
.src('./test.js')
.browsers('chrome', 'firefox')
.run()
.catch(function (error) {
console.log(error);
});
The problem is:
Running the test in chrome and firefox -> both browsers open but tests start and run only on the first browser listed in "run". In this example, test run only in chrome.
Also, the second browser does not close after the test.
Did you have any similar issues or could you provide some clarification?
Thanks!
Renato
The text was updated successfully, but these errors were encountered: