2017-09-15 2 views
0

Ma configuration:"Process est sorti avec le code 0" lorsque les tests E2E échoué au jasmin-spec-journaliste

  • de Windows 10
  • noeud NPM 5.3.0
  • v8.4.0
  • jasmin 2.8 0,0
  • jasmin-spec-reporter 4.2.1
  • rapporteur 5.1.2

Auparavant, j'ai utilisé un enregistreur de jasmin standard pour la sortie des tests E2E. Récemment j'ai installé jasmine-spec-reporter et la sortie semble meilleure. Mais maintenant j'ai un problème avec TeamCity. Après l'exécution du test dans TeamCity j'ai toujours "Processus quitté avec le code 0", même si certains tests ont échoué. Avec l'enregistreur standard je n'ai pas rencontré un tel problème. Pourriez-vous nous suggérer comment résoudre ce problème?

sortie TeamCity:

I/launcher - Running 1 instances of WebDriver 
I/direct - Using ChromeDriver directly... 
Jasmine started 

    1 LoginComponent 
    x should set focus to the Password field after incorrect password has been entered 
     - Expected false to be truthy. 
      at Function.CustomMatchers.expectToBeFocused (D:\TeamCity\BuildAgent\work\e2eng2\ng2\e2e\matchers\custom-matchers.ts:13:6) 
      at UserContext.<anonymous> (D:\TeamCity\BuildAgent\work\e2eng2\ng2\e2e\tests\login.e2e.ts:53:18) 
      at new ManagedPromise (D:\TeamCity\BuildAgent\work\e2eng2\ng2\node_modules\selenium-webdriver\lib\promise.js:1067:7) 
      at ControlFlow.promise (D:\TeamCity\BuildAgent\work\e2eng2\ng2\node_modules\selenium-webdriver\lib\promise.js:2396:12) 
      at TaskQueue.execute_ (D:\TeamCity\BuildAgent\work\e2eng2\ng2\node_modules\selenium-webdriver\lib\promise.js:2970:14) 
      at TaskQueue.executeNext_ (D:\TeamCity\BuildAgent\work\e2eng2\ng2\node_modules\selenium-webdriver\lib\promise.js:2953:27) 
      at asyncRun (D:\TeamCity\BuildAgent\work\e2eng2\ng2\node_modules\selenium-webdriver\lib\promise.js:2860:25) 

************************************************** 
*     Failures     * 
************************************************** 

1) LoginComponent should set focus to the Password field after incorrect password has been entered 
    - Expected false to be truthy. 

Executed 1 of 9 specs (1 FAILED) (8 SKIPPED) in 10 secs. 
I/launcher - 0 instance(s) of WebDriver still running 
I/launcher - chrome #01 passed 
Process exited with code 0 

Mes protractor.conf.js

require('ts-node').register({ 
    compilerOptions: { 
    noEmitHelpers: false 
    } 
}); 
var helpers = require('./helpers'); 
var SpecReporter = require('jasmine-spec-reporter').SpecReporter; 

exports.config = { 
    baseUrl: 'http://localhost:8080/ng2/', 

    // use `npm run e2e` 
    specs: [ 
    helpers.root('e2e/**/*.e2e.ts') 
    ], 
    exclude: [], 

    framework: 'jasmine2', 

    allScriptsTimeout: 110000, 

    jasmineNodeOpts: { 
    defaultTimeoutInterval: 600000, 
    print: function() {} 
    }, 
    directConnect: true, 

    capabilities: { 
    'browserName': 'chrome', 
    chromeOptions: { 
     args: [ 
     '--start-maximized' 
     ] 
    } 
    }, 

    onPrepare: function() { 
    browser.ignoreSynchronization = true; 
    jasmine.getEnv().clearReporters(); 
    jasmine.getEnv().addReporter(new SpecReporter({ 
     displayStacktrace: 'all', 
     suite: { 
     displayNumber: true, 
     }, 
     spec: { 
     displayPending: true, 
     displayStacktrace: true, 
     }, 
     summary: { 
     displayDuration: true, 
     }, 
     prefixes: { 
     successful: '+ ', 
     failed: 'x ', 
     }, 
    })); 
    }, 

    useAllAngular2AppRoots: true 
}; 

Répondre

0

Je résolu cette question. Mon problème était que je tue tous les autres journalistes. Pour résoudre ce problème il suffit de supprimer cette ligne

jasmine.getEnv().clearReporters();