Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit 0e98d84

Browse files
authored
Merge pull request #77 from mobify/remove-sitejs-warnings
Remove sitejs warnings
2 parents 2b10575 + 11e7af3 commit 0e98d84

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2.1.0
22
- Adds a `triggerClick` command that uses JavaScript's click.
3-
- Renames `navigate` to `clickAndWaitUntilMobified` to avoid colliding with a core Nightwatch command with the same name.
3+
- Renames `navigate` to `clickAndWaitUntilMobified` to avoid colliding with a core Nightwatch command with the same name. Resolves https://github.com/mobify/nightwatch-commands/issues/74
4+
- Warnings related to a missing `site.json` should no longer be output if not using the `.preview()` command. Resolves https://github.com/mobify/nightwatch-commands/issues/73
45
2.0.1
56
-Update [selenium-download](https://github.com/groupon/selenium-download) to 2.0.10
67
- selenium chromedriver 2.29

commands/preview.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,34 @@
2727
*/
2828

2929
var path = require('path');
30+
var qs = require('querystring');
3031

31-
try {
32-
var siteConfig = require(path.join(path.resolve('./'), '/tests/system/site.json'));
33-
} catch (e) {
34-
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
35-
console.log('Not using optional site.json. Looking for site.js...');
36-
}
37-
}
32+
exports.command = function(url, callback) {
33+
var browser = this;
3834

39-
try {
40-
var siteConfig = require(path.join(path.resolve('./'), '/tests/system/site.js'));
41-
} catch (e) {
42-
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
43-
console.log('Not using optional /tests/system/site.js.');
35+
try {
36+
var siteConfig = require(path.join(path.resolve('./'), '/tests/system/site.json'));
37+
} catch (e) {
38+
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
39+
console.log('Not using optional site.json. Looking for site.js...');
40+
}
4441
}
45-
}
4642

47-
try {
48-
var siteConfig = require(path.join(path.resolve('./'), '/system/site.js'));
49-
} catch (e) {
50-
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
51-
console.log('Not using optional /system/site.js.');
43+
try {
44+
var siteConfig = require(path.join(path.resolve('./'), '/tests/system/site.js'));
45+
} catch (e) {
46+
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
47+
console.log('Not using optional /tests/system/site.js.');
48+
}
5249
}
53-
}
5450

55-
var qs = require('querystring');
56-
57-
exports.command = function(url, callback) {
58-
var browser = this;
51+
try {
52+
var siteConfig = require(path.join(path.resolve('./'), '/system/site.js'));
53+
} catch (e) {
54+
if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
55+
console.log('Not using optional /system/site.js.');
56+
}
57+
}
5958

6059
if (siteConfig) {
6160
var site = siteConfig.profiles[siteConfig.activeProfile];

0 commit comments

Comments
 (0)