MOAR e2e testing! CI runs are now behind the ENABLE_CI_E2E flag

This commit is contained in:
Kyle Shockey
2018-01-09 13:39:37 -06:00
parent ebf2140fad
commit c2aa28d266
12 changed files with 27 additions and 25 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
"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:ci:e2e": "if [[ $ENABLE_CI_E2E == true ]]; then npm-run-all --parallel -r hot-server test:e2e:mock-api test:e2e:all:cbt; else exit 0; fi",
"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",
+2 -2
View File
@@ -3,7 +3,7 @@ var cbt = require("cbt_tunnels")
module.exports = {
baseUrl: "http://local:3200",
before: function(done) {
beforeEach: function(done) {
console.log("Starting up tunnel")
cbt.start({
username: process.env.CBT_USERNAME || "",
@@ -16,7 +16,7 @@ module.exports = {
}
})
},
after: function(done) {
afterEach: function(done) {
console.log("Closing Down Tunnel")
cbt.stop()
done()
+5
View File
@@ -0,0 +1,5 @@
var cbt = require("cbt_tunnels")
module.exports = {
baseUrl: "http://localhost:3200"
}
+1 -4
View File
@@ -1,14 +1,11 @@
{
"src_folders" : ["test/e2e/scenarios"],
"output_folder" : "reports",
"live_output": true,
"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",
+1 -1
View File
@@ -5,7 +5,7 @@
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "test/e2e/pages",
"globals_path" : "",
"globals_path" : "test/e2e/globals.js",
"test_workers" : {
"enabled" : true,
"workers" : "auto"
+4 -4
View File
@@ -4,12 +4,12 @@ describe("render informationContainer", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
@@ -29,8 +29,8 @@ describe("render informationContainer", function () {
.assert.containsText("@title", "Swagger Petstore")
.assert.containsText("@version", "1.0.0")
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]")
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/petstore.json")
.assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/petstore.json")
.assert.attributeEquals("@mainUrl", "href", client.globals.baseUrl + "/test-specs/petstore.json")
.assert.containsText("@mainUrlContent", client.globals.baseUrl + "/test-specs/petstore.json")
.assert.containsText("@description", "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.")
.assert.attributeEquals("@swaggerUrl", "href", "http://swagger.io/")
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")
+2 -2
View File
@@ -3,12 +3,12 @@ describe("Render Model Wrapper", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
+2 -2
View File
@@ -3,13 +3,13 @@ describe("render pet api container", function () {
let apiWrapper
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
+2 -2
View File
@@ -3,13 +3,13 @@ describe("render store api container", function(){
let apiWrapper
beforeEach( function(client, done){
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(3000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
+2 -2
View File
@@ -3,13 +3,13 @@ describe("render user api container", function(){
let apiWrapper
beforeEach( function(client, done){
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
+3 -3
View File
@@ -4,7 +4,7 @@ describe("Render scheme", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
schemeContainer = mainPage.section.schemeContainer
@@ -12,7 +12,7 @@ describe("Render scheme", function () {
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
@@ -49,4 +49,4 @@ describe("Render scheme", function () {
client.end()
})
})
})
+2 -2
View File
@@ -18,7 +18,7 @@ describe("initial render", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url(client.globals.baseUrl)
.page.main()
topbar = mainPage.section.topbar
@@ -26,7 +26,7 @@ describe("initial render", function () {
client.waitForElementVisible(".download-url-input", 10000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", client.globals.baseUrl + "/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)