We are trying to remove unnecessary console logs when we are running our e2e with protractor
We have tried to add loggingPrefs and logLevel to our protractor config. We've also tried overriding the SpecReporter to remove unneeded logs
This is our protractor.conf.js:
{
allScriptsTimeout: 120000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
shardTestFiles: true,
loggingPrefs: {
driver: 'OFF',
server: 'OFF',
browser: 'OFF'
},
maxInstances: 3,
chromeOptions: {
args: isDocker ? ["--headless", "--disable-gpu", "--window-size=1224x800", "--no-sandbox"] : []
}
},
logLevel: "ERROR",
directConnect: true,
baseUrl: 'http://localhost:4202',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
isVerbose: false,
includeStackTrace: false,
defaultTimeoutInterval: 240000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: false}, summary:{displayPending: false } }));
browser.driver.get(browser.baseUrl + '/#access_token=' + process.env.ESO_ACCESS_TOKEN);
}
};
We are trying to remove these types of logs from the cmd:
[1022/132003.278:INFO:CONSOLE(3904)] "Angular is running in the development mode. Call enableProdMode() to enable the production mode.", source: webpack-internal:///./node_modules/@angular/core/esm5/core.js (3904)
[1022/132003.285:INFO:CONSOLE(3904)] "Angular is running in the development mode. Call enableProdMode() to enable the production mode.", source: webpack-internal:///./node_modules/@angular/core/esm5/core.js (3904)
[1022/132003.404:INFO:CONSOLE(3904)] "Angular is running in the development mode. Call enableProdMode() to enable the production mode.", source: webpack-internal:///./node_modules/@angular/core/esm5/core.js (3904)
[1022/132005.755:INFO:CONSOLE(2998)] "WebSocket connection to 'ws://localhost:4202/sockjs-node/880/zuhsnbvp/websocket' failed: WebSocket is closed before the connection is established.", source: webpack-internal:///./node_modules/sockjs-client/dist/sockjs.js (2998)
[1022/132005.938:INFO:CONSOLE(2998)] "WebSocket connection to 'ws://localhost:4202/sockjs-node/921/5ziqcybu/websocket' failed: WebSocket is closed before the connection is established.", source: webpack-internal:///./node_modules/sockjs-client/dist/sockjs.js (2998)
[1022/132006.119:INFO:CONSOLE(2998)] "WebSocket connection to 'ws://localhost:4202/sockjs-node/747/rduwognj/websocket' failed: WebSocket is closed before the connection is established.", source: webpack-internal:///./node_modules/sockjs-client/dist/sockjs.js (2998)