Skip to content

Commit

Permalink
Updated ejs dependency and fixed #1518 - a problem with reading capab…
Browse files Browse the repository at this point in the history
…ilities incorrectly
  • Loading branch information
beatfactor committed Dec 5, 2017
1 parent 4aa6aa2 commit c3418c5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 3 additions & 1 deletion lib/runner/clientmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ ClientManager.prototype.init = function(opts) {
this['@client'].once('selenium:session_create', function() {
var capabilities = this.api.capabilities || {};
var browserName = (capabilities.browserName && capabilities.browserName.toUpperCase()) || '';
var browserVersion = this.api.capabilities.version || this.api.capabilities.browserVersion;
var platformVersion = this.api.capabilities.platform || this.api.capabilities.platformVersion;

self.options.report_prefix = browserName + '_' + this.api.capabilities.version + '_' + this.api.capabilities.platform + '_';
self.options.report_prefix = browserName + '_' + browserVersion + '_' + platformVersion + '_';
});
return this;
};
Expand Down
10 changes: 4 additions & 6 deletions lib/runner/reporters/junit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ module.exports = new (function() {
var filename = path.join(output_folder, opts.filename_prefix + moduleName + '.xml');

var rendered = ejs.render(data, {
locals: {
module : module,
moduleName : moduleName,
className : className,
systemerr : globalResults.errmessages.join('\n')
}
module: module,
moduleName: moduleName,
className: className,
systemerr: globalResults.errmessages.join('\n')
});

fs.writeFile(filename, rendered, function(err) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightwatch",
"description": "A node.js bindings implementation for selenium 2.0/webdriver",
"description": "Easy to use Node.js based End-to-End testing solution for browser based apps and websites, using the W3C WebDriver API.",
"version": "0.9.17",
"author": {
"name": "Andrei Rusu",
Expand All @@ -16,7 +16,7 @@
},
"dependencies": {
"chai-nightwatch": "~0.1.x",
"ejs": "0.8.3",
"ejs": "2.5.7",
"lodash.clone": "3.0.3",
"lodash.defaultsdeep": "4.3.2",
"minimatch": "3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion test/lib/mocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"url" : "/wd/hub/session",
"postdata" : "{\"desiredCapabilities\":{\"browserName\":\"firefox\",\"javascriptEnabled\":true,\"acceptSslCerts\":true,\"platform\":\"ANY\"}}",
"response" : "{\"status\": 0, \"sessionId\": \"1352110219202\", \"value\": { \"javascriptEnabled\": true, \"browserName\": \"firefox\", \"version\": \"TEST\", \"platform\": \"TEST\"}, \"state\": null}",
"response" : "{\"status\": 0, \"sessionId\": \"1352110219202\", \"value\": { \"javascriptEnabled\": true, \"browserName\": \"firefox\", \"browserVersion\": \"TEST\", \"platformVersion\": \"TEST\"}, \"state\": null}",
"responseHeaders" : {
},
"statusCode" : 201,
Expand Down
4 changes: 2 additions & 2 deletions test/src/core/testNightwatchApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = MochaTest.add('test Nightwatch Api', {
assert.deepEqual(api.capabilities, {
javascriptEnabled: true,
browserName: 'firefox',
version: 'TEST',
platform: 'TEST'
browserVersion: 'TEST',
platformVersion: 'TEST'
});

assert.deepEqual(api.globals, {
Expand Down
2 changes: 1 addition & 1 deletion test/src/runner/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ module.exports = {
}
var content = data.toString();
try {
assert.ok(content.indexOf('<failure message="AssertionError: 1 == 0 - expected &quot;0&quot; but got: &quot;1&quot;">') > 0, 'Report contains failure information.')
assert.ok(content.indexOf('<failure message="AssertionError: 1 == 0 - expected &#34;0&#34; but got: &#34;1&#34;">') > 0, 'Report contains failure information.')
done();
} catch (err) {
done(err);
Expand Down

0 comments on commit c3418c5

Please sign in to comment.