Compare commits

...
20 Commits
Author SHA1 Message Date
kyle 6ca1fa1c42 Merge branch 'master' into cbt-run-e2e 2018-03-02 17:02:13 -08:00
Kyle Shockey 6549cbbb92 re-enable live output 2018-01-23 17:24:39 -08:00
Kyle Shockey 4c3a70cb0d enable Nightwatch parallelization 2018-01-23 17:08:23 -08:00
kyle cb53a2c677 Merge branch 'master' into cbt-run-e2e 2018-01-23 16:36:38 -08:00
Kyle Shockey fb8dc7bd1e Add max_duration CrossBrowserTesting capability 2018-01-18 16:42:23 -06:00
Kyle Shockey a89b50f862 Remove name 2018-01-11 20:13:28 -06:00
kyle 72eaad1ef9 Merge branch 'master' into cbt-run-e2e 2018-01-10 18:45:46 -06:00
Kyle Shockey 1dfb6f8ae6 Modify the CBT proxy after each suite 2018-01-09 16:25:44 -06:00
Kyle Shockey f151f67c45 Use rawgit to serve petstore.json spec 2018-01-09 16:01:48 -06:00
Kyle Shockey daa1ce8acf Override visibility timeout in CI 2018-01-09 15:52:51 -06:00
Kyle Shockey 40a2646844 Use json-server to serve test specs in test:ci:e2e 2018-01-09 15:41:47 -06:00
Kyle Shockey 1187707611 DONTMERGE: use surge.sh CDN deployments for e2e assets
just a test, this might be faster than using the CBT proxy.
2018-01-09 15:11:40 -06:00
Kyle Shockey 02beda929b bash is hard 2018-01-09 14:10:39 -06:00
Kyle Shockey 5266667ed3 Disable ESLint console error 2018-01-09 13:52:33 -06:00
Kyle Shockey a5457e3c75 Revert db.json changes 2018-01-09 13:46:41 -06:00
Kyle Shockey 4b0a4966fc Instruct Travis to use npm run test:ci 2018-01-09 13:42:41 -06:00
Kyle Shockey c2aa28d266 MOAR e2e testing! CI runs are now behind the ENABLE_CI_E2E flag 2018-01-09 13:39:37 -06:00
Kyle Shockey ebf2140fad Baseline CBT e2e CI setup 2018-01-08 18:32:05 -06:00
Kyle Shockey 04c63427d2 Alphabetize npm scripts 2018-01-08 17:12:27 -06:00
Kyle Shockey 3ce43d030c Use colon:divider in npm scripts 2018-01-08 17:11:02 -06:00
14 changed files with 187 additions and 88 deletions
+1
View File
@@ -15,6 +15,7 @@ before_deploy:
- npm run build - npm run build
env: env:
- DOCKER_IMAGE_NAME=swaggerapi/swagger-ui - DOCKER_IMAGE_NAME=swaggerapi/swagger-ui
script: npm run test:ci
deploy: deploy:
- provider: npm - provider: npm
email: apiteam@swagger.io email: apiteam@swagger.io
+24 -21
View File
@@ -14,30 +14,32 @@
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"scripts": { "scripts": {
"build": "npm run build-core && npm run build-bundle && npm run build-standalone", "build": "npm run build:core && npm run build:bundle && npm run build:standalone",
"build-bundle": "webpack --config webpack-dist-bundle.config.js --colors", "build:bundle": "webpack --config webpack-dist-bundle.config.js --colors",
"build-core": "webpack --config webpack-dist.config.js --colors", "build:core": "webpack --config webpack-dist.config.js --colors",
"build-standalone": "webpack --config webpack-dist-standalone.config.js --colors", "build:standalone": "webpack --config webpack-dist-standalone.config.js --colors",
"predev": "npm install", "deps:check": "npm run deps:license && npm run deps:size",
"deps:license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv",
"deps:size": "webpack -p --config webpack.check.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt",
"dev": "npm-run-all --parallel hot-server open-localhost", "dev": "npm-run-all --parallel hot-server open-localhost",
"watch": "webpack --config webpack-watch.config.js --watch --progress",
"open-localhost": "node -e 'require(\"open\")(\"http://localhost:3200\")'",
"hot-server": "webpack-dev-server --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress --content-base dev-helpers/", "hot-server": "webpack-dev-server --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress --content-base dev-helpers/",
"deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv",
"deps-size": "webpack -p --config webpack.check.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt",
"deps-check": "npm run deps-license && npm run deps-size",
"lint": "eslint --cache --ext '.js,.jsx' src test", "lint": "eslint --cache --ext '.js,.jsx' src test",
"lint-errors": "eslint --cache --quiet --ext '.js,.jsx' src test", "lint:errors": "eslint --cache --quiet --ext '.js,.jsx' src test",
"lint-fix": "eslint --cache --ext '.js,.jsx' src test --fix", "lint:fix": "eslint --cache --ext '.js,.jsx' src test --fix",
"test": "npm run lint-errors && npm run just-test-in-node", "open-localhost": "node -e 'require(\"open\")(\"http://localhost:3200\")'",
"test-in-node": "npm run lint-errors && npm run just-test-in-node", "predev": "npm install",
"just-test": "karma start --config karma.conf.js", "test": "npm run lint:errors && npm run test:nodejs",
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package test/xss", "test:ci": "npm-run-all lint:errors test:nodejs test:ci:e2e",
"just-check-coverage": "nyc npm run just-test-in-node", "test:browser": "karma start --config karma.conf.js",
"test-e2e": "sleep 3 && nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json", "test:ci:e2e": "if [ \"$ENABLE_CI_E2E\" = \"true\" ]; then npm-run-all --parallel -r test:e2e:mock-api test:e2e:all:cbt; else exit 0; fi",
"e2e-initial-render": "nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json --group initial-render", "test:coverage": "nyc npm run test:nodejs",
"mock-api": "json-server --watch test/e2e/db.json --port 3204", "test:e2e": "npm-run-all --parallel -r hot-server test:e2e:mock-api test:e2e:all",
"e2e": "npm-run-all --parallel -r hot-server mock-api test-e2e" "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 --static test/e2e/specs --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",
"watch": "webpack --config webpack-watch.config.js --watch --progress"
}, },
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^2.0.2", "@braintree/sanitize-url": "^2.0.2",
@@ -104,6 +106,7 @@
"babel-preset-react": "^6.23.0", "babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0", "babel-preset-stage-0": "^6.22.0",
"babel-runtime": "^6.23.0", "babel-runtime": "^6.23.0",
"cbt_tunnels": "^0.3.0",
"chromedriver": "^2.30.1", "chromedriver": "^2.30.1",
"copy-webpack-plugin": "^4.0.1", "copy-webpack-plugin": "^4.0.1",
"css-loader": "0.28.4", "css-loader": "0.28.4",
+32
View File
@@ -0,0 +1,32 @@
/* eslint-disable no-console */
var cbt = require("cbt_tunnels")
module.exports = {
baseAppUrl: "http://swagger-ui-ci-asset-deployment-test.surge.sh",
// use rawgit.com to get test/e2e/specs/petstore.json from master
// not a great solution, but CBT's proxy is too slow to fetch
// the data directly.
specPath: "https://rawgit.com/swagger-api/swagger-ui/master/test/e2e/specs/petstore.json",
visibleTimeout: 10000,
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()
}
}
+6
View File
@@ -0,0 +1,6 @@
var cbt = require("cbt_tunnels")
module.exports = {
baseAppUrl: "http://localhost:3200",
specPath: "http://localhost:3200/test-specs/petstore.json"
}
+57
View File
@@ -0,0 +1,57 @@
{
"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_runner" : {
"type" : "mocha",
"options" : {
"ui" : "bdd",
"reporter" : "list"
}
},
"test_workers": {
"enabled": true,
"workers": 3
},
"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",
"record_network" : "true",
"record_video" : "true",
"max_duration": 1200
}
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
"custom_commands_path" : "", "custom_commands_path" : "",
"custom_assertions_path" : "", "custom_assertions_path" : "",
"page_objects_path" : "test/e2e/pages", "page_objects_path" : "test/e2e/pages",
"globals_path" : "", "globals_path" : "test/e2e/globals.js",
"test_workers" : { "test_workers" : {
"enabled" : true, "enabled" : true,
"workers" : "auto" "workers" : "auto"
+1 -1
View File
@@ -20,7 +20,7 @@ module.exports = {
version: { version: {
selector: ".version" selector: ".version"
}, },
baseUrl: { baseAppUrl: {
selector: ".base-url" selector: ".base-url"
}, },
mainUrl: { mainUrl: {
+9 -9
View File
@@ -4,12 +4,12 @@ describe("render informationContainer", function () {
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -19,18 +19,18 @@ describe("render informationContainer", function () {
}) })
it("renders section", function (client) { it("renders section", function (client) {
mainPage.expect.section("@informationContainer").to.be.visible.before(5000) mainPage.expect.section("@informationContainer").to.be.visible.before(client.globals.visibleTimeout || 5000)
client.end() client.end()
}) })
it("renders content", function (client) { it("renders content", function (client) {
informationContainer.waitForElementVisible("@title", 5000) informationContainer.waitForElementVisible("@title", client.globals.visibleTimeout || 5000)
.assert.containsText("@title", "Swagger Petstore") .assert.containsText("@title", "Swagger Petstore")
.assert.containsText("@version", "1.0.0") .assert.containsText("@version", "1.0.0")
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]") .assert.containsText("@baseAppUrl", "[ Base URL: localhost:3204/ ]")
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/petstore.json") .assert.attributeEquals("@mainUrl", "href", client.globals.specPath)
.assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/petstore.json") .assert.containsText("@mainUrlContent", client.globals.specPath)
.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.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("@swaggerUrl", "href", "http://swagger.io/")
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/") .assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")
+6 -6
View File
@@ -3,12 +3,12 @@ describe("Render Model Wrapper", function () {
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -20,13 +20,13 @@ describe("Render Model Wrapper", function () {
done() done()
}) })
it("Render model wrapper", function(client){ it("Render model wrapper", function(client){
mainPage.expect.section("@modelWrapper").to.be.visible.before(5000) mainPage.expect.section("@modelWrapper").to.be.visible.before(client.globals.visibleTimeout || 5000)
client.end() client.end()
}) })
it("Render model wrapper collapse", function(client){ it("Render model wrapper collapse", function(client){
modelWrapper.waitForElementVisible("@modelContainer", 5000) modelWrapper.waitForElementVisible("@modelContainer", client.globals.visibleTimeout || 5000)
.click("@modelCollapse") .click("@modelCollapse")
.assert.cssClassNotPresent("@modelContainer", "is-open") .assert.cssClassNotPresent("@modelContainer", "is-open")
+15 -15
View File
@@ -3,13 +3,13 @@ describe("render pet api container", function () {
let apiWrapper let apiWrapper
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -25,13 +25,13 @@ describe("render pet api container", function () {
client.end() client.end()
}) })
it("test rendered pet container", function (client) { it("test rendered pet container", function (client) {
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000) apiWrapper.waitForElementVisible("@petAPIWrapper", client.globals.visibleTimeout || 5000)
.expect.element("@petAPIWrapper").to.be.visible .expect.element("@petAPIWrapper").to.be.visible
client.end() client.end()
}) })
it("collapse pet wrapper", function (client) { it("collapse pet wrapper", function (client) {
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000) apiWrapper.waitForElementVisible("@petAPIWrapper", client.globals.visibleTimeout || 5000)
.click("@petAPIWrapperBar") .click("@petAPIWrapperBar")
.assert.cssClassNotPresent("@petAPIWrapper", "is-open") .assert.cssClassNotPresent("@petAPIWrapper", "is-open")
@@ -41,7 +41,7 @@ describe("render pet api container", function () {
apiWrapper.waitForElementVisible("@petOperationPostContainer", 10000) apiWrapper.waitForElementVisible("@petOperationPostContainer", 10000)
.assert.containsText("@petOperationPostTitle", "/pet") .assert.containsText("@petOperationPostTitle", "/pet")
.click("@petOperationPostCollpase") .click("@petOperationPostCollpase")
.waitForElementVisible("@petOperationPostCollapseContainer", 5000) .waitForElementVisible("@petOperationPostCollapseContainer", client.globals.visibleTimeout || 5000)
.click("@petOperationPostTryBtn") .click("@petOperationPostTryBtn")
.waitForElementVisible("@petOperationPostTryText", 1000) .waitForElementVisible("@petOperationPostTryText", 1000)
.waitForElementVisible("@petOperationPostExecuteBtn", 1000) .waitForElementVisible("@petOperationPostExecuteBtn", 1000)
@@ -52,9 +52,9 @@ describe("render pet api container", function () {
}) })
it("Testing post /pet api Mock data", function (client) { it("Testing post /pet api Mock data", function (client) {
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000) apiWrapper.waitForElementVisible("@petOperationPostContainer", client.globals.visibleTimeout || 5000)
.click("@petOperationPostCollpase") .click("@petOperationPostCollpase")
.waitForElementVisible("@petOperationPostCollapseContainer", 5000) .waitForElementVisible("@petOperationPostCollapseContainer", client.globals.visibleTimeout || 5000)
.click("@petOperationPostTryBtn") .click("@petOperationPostTryBtn")
.waitForElementVisible("@petOperationPostExecuteBtn", 1000) .waitForElementVisible("@petOperationPostExecuteBtn", 1000)
.click("@petOperationPostExecuteBtn") .click("@petOperationPostExecuteBtn")
@@ -72,7 +72,7 @@ describe("render pet api container", function () {
}) })
it("render put /pet api container", function (client) { it("render put /pet api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000) apiWrapper.waitForElementVisible("@petOperationPutContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@petOperationPutTitle", "/pet") .assert.containsText("@petOperationPutTitle", "/pet")
.click("@petOperationPutCollpase") .click("@petOperationPutCollpase")
.waitForElementVisible("@petOperationPutCollapseContainer", 3000) .waitForElementVisible("@petOperationPutCollapseContainer", 3000)
@@ -86,7 +86,7 @@ describe("render pet api container", function () {
}) })
it("Testing put /pet api Mock data", function (client) { it("Testing put /pet api Mock data", function (client) {
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000) apiWrapper.waitForElementVisible("@petOperationPutContainer", client.globals.visibleTimeout || 5000)
.click("@petOperationPutCollpase") .click("@petOperationPutCollpase")
.waitForElementVisible("@petOperationPutCollapseContainer", 3000) .waitForElementVisible("@petOperationPutCollapseContainer", 3000)
.click("@petOperationPutTryBtn") .click("@petOperationPutTryBtn")
@@ -106,7 +106,7 @@ describe("render pet api container", function () {
}) })
it("render get by tag /pet api container", function (client) { it("render get by tag /pet api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000) apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags") .assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags")
.click("@petOperationGetByTagCollpase") .click("@petOperationGetByTagCollpase")
.waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000) .waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000)
@@ -120,7 +120,7 @@ describe("render pet api container", function () {
}) })
it("Testing get by tag /pet api Mock data", function (client) { it("Testing get by tag /pet api Mock data", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000) apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", client.globals.visibleTimeout || 5000)
.click("@petOperationGetByTagCollpase") .click("@petOperationGetByTagCollpase")
.waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000) .waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000)
.click("@petOperationGetByTagTryBtn") .click("@petOperationGetByTagTryBtn")
@@ -140,7 +140,7 @@ describe("render pet api container", function () {
}) })
it("render get by ID /pet/{petId} api container", function (client) { it("render get by ID /pet/{petId} api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000) apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}") .assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
.click("@petOperationGetByIdCollpase") .click("@petOperationGetByIdCollpase")
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000) .waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
@@ -153,7 +153,7 @@ describe("render pet api container", function () {
}) })
it("render get by ID /pet/{petId} api Mock data", function (client) { it("render get by ID /pet/{petId} api Mock data", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000) apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}") .assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
.click("@petOperationGetByIdCollpase") .click("@petOperationGetByIdCollpase")
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000) .waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
+8 -8
View File
@@ -3,13 +3,13 @@ describe("render store api container", function(){
let apiWrapper let apiWrapper
beforeEach( function(client, done){ beforeEach( function(client, done){
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(3000) .pause(3000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -21,23 +21,23 @@ describe("render store api container", function(){
done() done()
}) })
it("test rendered store container", function(client){ it("test rendered store container", function(client){
apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000) apiWrapper.waitForElementVisible("@storeAPIWrapper", client.globals.visibleTimeout || 5000)
.expect.element("@storeAPIWrapper").to.be.visible .expect.element("@storeAPIWrapper").to.be.visible
client.end() client.end()
}) })
it("callapse store wrapper", function(client){ it("callapse store wrapper", function(client){
apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000) apiWrapper.waitForElementVisible("@storeAPIWrapper", client.globals.visibleTimeout || 5000)
.click("@storeAPIWrapperBar") .click("@storeAPIWrapperBar")
.assert.cssClassNotPresent("@storeAPIWrapper", "is-open") .assert.cssClassNotPresent("@storeAPIWrapper", "is-open")
client.end() client.end()
}) })
it("render get /store/inventory api container", function (client) { it("render get /store/inventory api container", function (client) {
apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000) apiWrapper.waitForElementVisible("@storeOperationGetContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@storeOperationGetTitle", "/store/inventory") .assert.containsText("@storeOperationGetTitle", "/store/inventory")
.click("@storeOperationGetCollpase") .click("@storeOperationGetCollpase")
.waitForElementVisible("@storeOperationGetCollapseContainer", 5000) .waitForElementVisible("@storeOperationGetCollapseContainer", client.globals.visibleTimeout || 5000)
.click("@storeOperationGetTryBtn") .click("@storeOperationGetTryBtn")
.waitForElementVisible("@storeOperationGetExecuteBtn", 1000) .waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
.click("@storeOperationGetTryBtn") .click("@storeOperationGetTryBtn")
@@ -47,7 +47,7 @@ describe("render store api container", function(){
}) })
it("Testing get /store/inventory api Mock data ", function (client) { it("Testing get /store/inventory api Mock data ", function (client) {
apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000) apiWrapper.waitForElementVisible("@storeOperationGetContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@storeOperationGetTitle", "/store/inventory") .assert.containsText("@storeOperationGetTitle", "/store/inventory")
.click("@storeOperationGetCollpase") .click("@storeOperationGetCollpase")
.waitForElementVisible("@storeOperationGetCollapseContainer", 3000) .waitForElementVisible("@storeOperationGetCollapseContainer", 3000)
+10 -10
View File
@@ -3,13 +3,13 @@ describe("render user api container", function(){
let apiWrapper let apiWrapper
beforeEach( function(client, done){ beforeEach( function(client, done){
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -21,20 +21,20 @@ describe("render user api container", function(){
done() done()
}) })
it("test rendered user container", function(client){ it("test rendered user container", function(client){
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000) apiWrapper.waitForElementVisible("@userAPIWrapper", client.globals.visibleTimeout || 5000)
.expect.element("@userAPIWrapper").to.be.visible .expect.element("@userAPIWrapper").to.be.visible
client.end() client.end()
}) })
it("callapse user wrapper", function(client){ it("callapse user wrapper", function(client){
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000) apiWrapper.waitForElementVisible("@userAPIWrapper", client.globals.visibleTimeout || 5000)
.click("@userAPIWrapperBar") .click("@userAPIWrapperBar")
.assert.cssClassNotPresent("@userAPIWrapper", "is-open") .assert.cssClassNotPresent("@userAPIWrapper", "is-open")
client.end() client.end()
}) })
it("render put /user/{username} api container", function (client) { it("render put /user/{username} api container", function (client) {
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000) apiWrapper.waitForElementVisible("@userOperationPutContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@userOperationPutTitle", "/user/{username}") .assert.containsText("@userOperationPutTitle", "/user/{username}")
.click("@userOperationPutCollpase") .click("@userOperationPutCollpase")
.waitForElementVisible("@userOperationPutCollapseContainer", 3000) .waitForElementVisible("@userOperationPutCollapseContainer", 3000)
@@ -46,7 +46,7 @@ describe("render user api container", function(){
client.end() client.end()
}) })
it("Test put /user/{username} api Mock data", function (client) { it("Test put /user/{username} api Mock data", function (client) {
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000) apiWrapper.waitForElementVisible("@userOperationPutContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@userOperationPutTitle", "/user/{username}") .assert.containsText("@userOperationPutTitle", "/user/{username}")
.click("@userOperationPutCollpase") .click("@userOperationPutCollpase")
.waitForElementVisible("@userOperationPutCollapseContainer", 3000) .waitForElementVisible("@userOperationPutCollapseContainer", 3000)
@@ -63,7 +63,7 @@ describe("render user api container", function(){
client.end() client.end()
}) })
it("render delete /user/{username} api container", function (client) { it("render delete /user/{username} api container", function (client) {
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000) apiWrapper.waitForElementVisible("@userOperationDeleteContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@userOperationDeleteTitle", "/user/{username}") .assert.containsText("@userOperationDeleteTitle", "/user/{username}")
.click("@userOperationDeleteCollpase") .click("@userOperationDeleteCollpase")
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000) .waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
@@ -75,7 +75,7 @@ describe("render user api container", function(){
client.end() client.end()
}) })
it("Test delete /user/{username} api Mock data", function (client) { it("Test delete /user/{username} api Mock data", function (client) {
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000) apiWrapper.waitForElementVisible("@userOperationDeleteContainer", client.globals.visibleTimeout || 5000)
.assert.containsText("@userOperationDeleteTitle", "/user/{username}") .assert.containsText("@userOperationDeleteTitle", "/user/{username}")
.click("@userOperationDeleteCollpase") .click("@userOperationDeleteCollpase")
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000) .waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
+8 -8
View File
@@ -4,15 +4,15 @@ describe("Render scheme", function () {
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
schemeContainer = mainPage.section.schemeContainer schemeContainer = mainPage.section.schemeContainer
client.waitForElementVisible(".download-url-input", 5000) client.waitForElementVisible(".download-url-input", client.globals.visibleTimeout || 5000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -21,25 +21,25 @@ describe("Render scheme", function () {
}) })
it("render section", function (client) { it("render section", function (client) {
mainPage.expect.section("@schemeContainer").to.be.visible.before(5000) mainPage.expect.section("@schemeContainer").to.be.visible.before(client.globals.visibleTimeout || 5000)
client.end() client.end()
}) })
it("render scheme option", function (client) { it("render scheme option", function (client) {
schemeContainer.waitForElementVisible("@httpOption", 5000) schemeContainer.waitForElementVisible("@httpOption", client.globals.visibleTimeout || 5000)
.expect.element("@httpOption").to.be.selected .expect.element("@httpOption").to.be.selected
client.end() client.end()
}) })
it("render authorized button", function (client) { it("render authorized button", function (client) {
schemeContainer.waitForElementVisible("@btnAuthorize", 5000) schemeContainer.waitForElementVisible("@btnAuthorize", client.globals.visibleTimeout || 5000)
.expect.element("@btnAuthorize").to.be.visible .expect.element("@btnAuthorize").to.be.visible
client.end() client.end()
}) })
it("render click event", function(client) { it("render click event", function(client) {
schemeContainer.waitForElementVisible("@btnAuthorize", 5000) schemeContainer.waitForElementVisible("@btnAuthorize", client.globals.visibleTimeout || 5000)
.click("@btnAuthorize") .click("@btnAuthorize")
.assert.visible("@authorizationModal") .assert.visible("@authorizationModal")
.assert.containsText("@appName", "Application: your-app-name") .assert.containsText("@appName", "Application: your-app-name")
+3 -3
View File
@@ -18,15 +18,15 @@ describe("initial render", function () {
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3200") .url(client.globals.baseAppUrl)
.page.main() .page.main()
topbar = mainPage.section.topbar topbar = mainPage.section.topbar
client.waitForElementVisible(".download-url-input", 10000) client.waitForElementVisible(".download-url-input", 10000)
.pause(5000) .pause(client.globals.visibleTimeout || 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json") .setValue(".download-url-input", client.globals.specPath)
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)