Skip to content

Commit 00009ef

Browse files
Improve logging
1 parent 796fa5f commit 00009ef

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

selenium/test/amqp.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ module.exports = {
5252
resolve()
5353
})
5454
})
55-
console.log("Opening amqp connection using " + JSON.stringify(connectionOptions))
55+
log("Opening amqp connection using " + JSON.stringify(connectionOptions,
56+
(key, value) => {
57+
if (key === "key") return undefined; // omit this key
58+
return value;
59+
}
60+
))
5661

5762
let connection = container.connect(connectionOptions)
5863
let receiver = connection.open_receiver({

selenium/test/pageobjects/BasePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ module.exports = class BasePage {
307307
'Timed out after [timeout=' + this.timeout + ';polling=' + this.polling + '] awaiting till visible ' + element,
308308
this.polling / 2)
309309
}catch(error) {
310-
console.log("isDisplayed failed due to " + error);
310+
require('../utils.js').log("isDisplayed failed due to " + error);
311311
return Promise.resolve(false);
312312
}
313313
}

selenium/test/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CaptureScreenshot {
4141
await fsp.mkdir(screenshotsSubDir)
4242
}
4343
const dest = path.join(screenshotsSubDir, name + '.png')
44-
console.log("screenshot saved to " + dest)
44+
module.exports.log("screenshot saved to " + dest)
4545
await fsp.writeFile(dest, image, 'base64')
4646
}
4747
}
@@ -146,7 +146,7 @@ module.exports = {
146146
const queryString = params.join('&');
147147

148148
const url = d.baseUrl + '/login?' + queryString;
149-
console.log("Navigating to " + url);
149+
module.exports.log("Navigating to " + url);
150150
return d.driver.get(url);
151151
},
152152

@@ -307,7 +307,7 @@ module.exports = {
307307
driver.executeScript('lambda-status=passed')
308308
} else {
309309
if (captureScreen != null) {
310-
console.log("Teardown failed . capture...");
310+
module.exports.log("Teardown failed . capture...");
311311
await captureScreen.shot('after-failed');
312312
}
313313
driver.executeScript('lambda-status=failed')

0 commit comments

Comments
 (0)