Baseline CBT e2e CI setup

This commit is contained in:
Kyle Shockey
2018-01-08 18:32:05 -06:00
parent 04c63427d2
commit ebf2140fad
5 changed files with 138 additions and 1 deletions
+4
View File
@@ -29,10 +29,13 @@
"open-localhost": "node -e 'require(\"open\")(\"http://localhost:3200\")'",
"predev": "npm install",
"test": "npm run lint:errors && npm run test:nodejs",
"test:ci": "npm-run-all lint:errors test:nodejs test:ci:e2e",
"test:browser": "karma start --config karma.conf.js",
"test:ci:e2e": "npm-run-all --parallel -r hot-server test:e2e:mock-api test:e2e:all:cbt",
"test:coverage": "nyc npm run test:nodejs",
"test:e2e": "npm-run-all --parallel -r hot-server test:e2e:mock-api test:e2e:all",
"test:e2e:all": "sleep 3 && nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json",
"test:e2e:all:cbt": "sleep 3 && nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch-cbt.json",
"test:e2e:initial-render": "nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json --group initial-render",
"test:e2e:mock-api": "json-server --watch test/e2e/db.json --port 3204",
"test:nodejs": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package test/xss",
@@ -102,6 +105,7 @@
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"babel-runtime": "^6.23.0",
"cbt_tunnels": "^0.3.0",
"chromedriver": "^2.30.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "0.28.4",
+24
View File
@@ -0,0 +1,24 @@
var cbt = require("cbt_tunnels")
module.exports = {
baseUrl: "http://local:3200",
before: function(done) {
console.log("Starting up tunnel")
cbt.start({
username: process.env.CBT_USERNAME || "",
authkey: process.env.CBT_AUTHKEY || ""
}, function(err, data) {
if (err) {
done(err)
} else {
done(data)
}
})
},
after: function(done) {
console.log("Closing Down Tunnel")
cbt.stop()
done()
}
}
+54
View File
@@ -125,6 +125,60 @@
}
],
"status": "available"
},
{
"id": 8,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
},
{
"id": 9,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
},
{
"id": 10,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
}
]
}
+55
View File
@@ -0,0 +1,55 @@
{
"src_folders" : ["test/e2e/scenarios"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "test/e2e/pages",
"globals_path" : "test/e2e/cbt-globals.js",
"test_workers" : {
"enabled" : true,
"workers" : "auto"
},
"test_runner" : {
"type" : "mocha",
"options" : {
"ui" : "bdd",
"reporter" : "list"
}
},
"selenium" : {
"start_process" : false,
"server_path" : "",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.ie.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 80,
"selenium_host" : "hub.crossbrowsertesting.com",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"username": "${CBT_USERNAME}",
"access_key": "${CBT_AUTHKEY}",
"desiredCapabilities": {
"acceptSslCerts": "1",
"browserName": "chrome",
"javascriptEnabled": "1",
"name": "NightwatchJSExample",
"record_network" : "true",
"record_video" : "true"
}
}
}
}
+1 -1
View File
@@ -60,4 +60,4 @@
}
}
}
}
}