Skip to content

Instantly share code, notes, and snippets.

@hanikhan
Created November 27, 2017 11:41
Show Gist options
  • Save hanikhan/f2d95d19d080b468ab1a4cb699823f23 to your computer and use it in GitHub Desktop.
Save hanikhan/f2d95d19d080b468ab1a4cb699823f23 to your computer and use it in GitHub Desktop.
codeceptJS configuration file for BrowserStack
exports.config={
helpers: {
WebDriverIO: {
url: process.env.BASE_URL,
user: "<USERNAME>",
key: "<ACCESS_KEY>",
desiredCapabilities: {
project: "Sample Project",
build: "CodeceptJS",
"browserstack.local" : true,
os: "Windows",
os_version: "10",
resolution: "1920x1080",
},
uniqueScreenshotNames: true
},
Mochawesome: {
uniqueScreenshotNames: true
}
},
include: {
"I": "./lib/steps_file.js",
HomePage: "./lib/pages/HomePage.js",
BannerPage: "./lib/pages/BannerPage.js"
},
multiple: {
testHomePage: {
grep: "@HomePage",
browsers: [{"browser": "chrome", "desiredCapabilities": {name: "Home Page"}},{"browser": "firefox", "desiredCapabilities": {name: "Home Page"}}]
},
testBannerPage: {
grep: "@BannerPage",
browsers: [{"browser": "chrome", "desiredCapabilities": {name: "Banner Page"}},{"browser": "firefox", "desiredCapabilities": {name: "Banner Page"}}]
},
},
mocha: {
reporterOptions: {
"mocha-junit-reporter":{
stdout: "-",
options: {
mochaFile: "report/result.xml"
}
},
mochawesome: {
stdout: "-",
options: {
reportDir: "./report",
reportFilename: "Regression_Test",
reportTitle: "Regresstion Test",
reportPageTitle: "Regresstion Test",
ennableChart: true
}
}
}
},
bootstrap: null,
teardown: null,
output: "./report",
hooks: [],
tests: "tests/*/*.js",
timeout: 10000,
name: "browserstack-home-banner-test-codeceptjs",
smartWait: true
}
@pablopaul
Copy link

@hanikhan are the desiredCapabilities in multiple part are working when you use this config with run-multiple command? I can´t get it to work.

@hanikhan
Copy link
Author

hanikhan commented May 8, 2018

@pablopaul yes, this is a working configuration file. Command I am using to run this:
codeceptjs run-multiple --all -c browserstack.codecept.conf.js

you may refer a few sample repo's here:
https://github.com/DanteYu/codecept_practice
https://github.com/kinlu/Sample-CodeceptJS

@paulcredmond
Copy link

How can I have all tests runs run on multiple platforms, e.g. Android, iOS, Mac, Windows? The config above doesn't work for me if I try and add devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment