Browse Source

integrate nightwatch

bubble
RVKen 7 years ago
parent
commit
622ce14195
6 changed files with 98 additions and 1 deletions
  1. +3
    -1
      package.json
  2. BIN
     
  3. BIN
     
  4. +63
    -0
      test/e2e/nightwatch.json
  5. +31
    -0
      test/e2e/scenarios/test.js
  6. +1
    -0
      test/e2e/specs/1.json

+ 3
- 1
package.json View File

@@ -32,7 +32,8 @@
"test": "npm run lint-errors && npm run just-test-in-node",
"test-in-node": "npm run lint-errors && npm run just-test-in-node",
"just-test": "karma start --config karma.conf.js",
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package"
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package",
"e2e": "nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json --verbose"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
@@ -109,6 +110,7 @@
"less-loader": "2.2.1",
"license-checker": "^8.0.4",
"mocha": "^2.5.3",
"nightwatch": "^0.9.16",
"node-sass": "^4.5.0",
"npm-run-all": "3.1.1",
"null-loader": "0.1.1",


BIN
View File


BIN
View File


+ 63
- 0
test/e2e/nightwatch.json View File

@@ -0,0 +1,63 @@
{
"src_folders" : ["test/e2e/scenarios"],
"output_folder" : "reports",
"live_output": true,
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"test_workers" : {
"enabled" : true,
"workers" : "auto"
},

"test_runner" : {
"type" : "mocha",
"options" : {
"ui" : "bdd",
"reporter" : "list"
}
},

"selenium" : {
"start_process" : true,
"server_path" : "test/e2e/bin/selenium-server-standalone-3.4.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "test/e2e/bin/chromedriver",
"webdriver.firefox.profile" : "",
"webdriver.ie.driver" : ""
}
},

"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "chrome",
"marionette": true
}
},

"chrome" : {
"desiredCapabilities": {
"browserName": "chrome"
}
},

"edge" : {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
}
}
}

+ 31
- 0
test/e2e/scenarios/test.js View File

@@ -0,0 +1,31 @@
describe('Google demo test for Mocha', function () {
describe('with Nightwatch', function () {
before(function (client, done) {
done()
})

after(function (client, done) {
client.end(function () {
done()
})
})

afterEach(function (client, done) {
done()
})

beforeEach(function (client, done) {
done()
})

it('uses TDD to run the Google simple test', function (client) {
client
.url('http://google.com')
.expect.element('body').to.be.present.before(1000)

client.setValue('input[type=text]', ['nightwatch', client.Keys.ENTER])
.pause(1000)
.assert.containsText('#main', 'Night Watch')
})
})
})

+ 1
- 0
test/e2e/specs/1.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save