Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bin/chromedriver
Binary file not shown.
Binary file added bin/selenium-server-standalone-2.53.1.jar
Binary file not shown.
31 changes: 31 additions & 0 deletions client/test/integration/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

module.exports = {
'B3 is on the page' : function (browser) {
browser
.url('http://localhost:9909')
.waitForElementVisible('body', 1000)
.assert.elementPresent('.b3-robot')
.end()
},
'Pressing a command button decreases the number of available moves': function(browser) {
var moves = 0;
browser
.url('http://localhost:9909')
.waitForElementVisible('.b3-robot', 1000)
.click('.skylight-close-button') //should clear the popup
.getText('.moves-left', function(result) {
moves = divValToInt(result.value)
//weeeee - callback hell
browser
.click('.action-forward')
.waitForElementVisible('.commandQueueIcon', 1000)
.assert.containsText('.moves-left', String(moves - 1))
.end()
})
}
}

//This is a bit fragile.
function divValToInt(str) {
return parseInt(/\d+/.exec(str)[0])
}
39 changes: 39 additions & 0 deletions nightwatch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"src_folders" : ["client/test/integration"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",

"selenium" : {
"start_process" : "true",
"server_path" : "bin/selenium-server-standalone-2.53.1.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "bin/chromedriver"
}
},

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

}
}

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"watch-css": "nodemon -e scss -x \"npm run build-css\"",
"build": "cd client && webpack --progress --profile --colors",
"build:watch": "cd client && webpack --progress --profile --colors --watch",
"test": "cd client && babel-tape-runner test/*.js | tap-spec"
"test": "cd client && babel-tape-runner test/*.js | tap-spec",
"test:integration": "nightwatch"
},
"author": "olwiba",
"license": "MIT",
Expand Down