forked from lbovet/docson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
const app = express(); | ||
|
||
app.use(express.static('files')) | ||
|
||
app.use('/', express.static(path.join(__dirname, '..')) ); | ||
|
||
module.exports = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
"src_folders" : ["nightwatch"], | ||
"output_folder" : "reports", | ||
"selenium" : { | ||
"start_process" : false, | ||
// "server_path" : "./bin/selenium-server-standalone-3.8.1.jar", | ||
"port" : 4444, | ||
"cli_args" : { | ||
"webdriver.gecko.driver" : "./bin/geckodriver" | ||
} | ||
}, | ||
|
||
"test_settings" : { | ||
"default" : { | ||
"launch_url" : "http://localhost", | ||
"selenium_port" : 4444, | ||
"selenium_host" : "localhost", | ||
"silent": true, | ||
"screenshots" : { | ||
"enabled" : false, | ||
"path" : "" | ||
}, | ||
"desiredCapabilities": { | ||
"browserName": "firefox", | ||
"marionette": true | ||
} | ||
}, | ||
|
||
"chrome" : { | ||
"desiredCapabilities": { | ||
"browserName": "chrome" | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Nightwatch tests | ||
|
||
## Install | ||
|
||
$ npm -g install selenium-standalone | ||
$ selenium-standalone install | ||
|
||
## Run | ||
|
||
In one console: | ||
|
||
$ selenium-standalone start | ||
|
||
And in another: | ||
|
||
$ nightwatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const c2x = require( 'css2xpath' ); | ||
let static_app = require( '../lib/server' ); | ||
let server; | ||
|
||
const rootUrl = "http://localhost:3000/index.html"; | ||
|
||
module.exports = { | ||
before: done => { | ||
server = static_app.listen( 3000, done ); | ||
}, | ||
after: done => server.close( done ), | ||
'relative paths' : function (browser) { | ||
browser.url( rootUrl + "#tests/relative.json").pause(1000); | ||
|
||
browser | ||
.useXpath() | ||
.expect | ||
.element(c2x(':contains("a baz string")')) | ||
.present; | ||
|
||
browser.end(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('../lib/server').listen( | ||
3000, | ||
() => console.log( "server running on port 3000") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$id": "one", | ||
"type": "object", | ||
"properties": { | ||
"foo": { "$ref": "./subdir/bar.json" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$id": "two", | ||
"type": "object", | ||
"properties": { | ||
"baz": { "$ref": "./baz.json" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$id": "three", | ||
"type": "object", | ||
"properties": { | ||
"baz": { "type": "string", "description": "a baz string" } | ||
} | ||
} |