0

I was wondering if there is any simple way to capture that a protractor spec file has failed.

If one it block fails when you run a test on browserstack or saucelabs it marks that as a failure. I would like to if possible capture that value in the afterAll function or some other better way. The reason for this is ultimately to post to testrail using their api.

I was trying to use this https://www.npmjs.com/package/testrail-promise to accomplish this since it will do a lot of the work for you. The problem with the way they suggest to implement it within protractor is that it is creating test cases for each it block but I want to create a test case for each file and the resu

Below is just a example mockup of 3 test cases based on the filename and the results would be extracted from however protractor determines a test has failed.


  • some_spec1.js : Failed

  • some_spec2.js : Passed

  • some_spec3.js : Failed


BarretV
  • 1,197
  • 7
  • 17
  • 2
    You could make your own jasmine reporter, there's a `suiteDone` event/function that gets called automatically at the end of each suite, and the object will contain the status of the spec (pass/fail). https://jasmine.github.io/2.1/custom_reporter.html#section-suiteDone – Gunderson Apr 06 '17 at 22:48
  • thanks for the suggestion. I'm currently investigating this functionality. I am trying to figure out how to get the name of the file in the reporter. That's a whole other question – BarretV Apr 07 '17 at 17:10

0 Answers0