Удаление журналов Angular и Webdriver INFO Console на транспортире e2es - PullRequest
0 голосов
/ 22 октября 2019

Мы пытаемся удалить ненужные журналы консоли, когда мы запускаем нашу e2e с транспортиром

Мы попытались добавить loggingPrefs и logLevel в нашу конфигурацию транспортира. Мы также попытались переопределить SpecReporter для удаления ненужных журналов

Это наш 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);
}
};

Мы пытаемся удалить журналы этих типов из 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)
...