Skip to content
This repository has been archived by the owner on Dec 22, 2018. It is now read-only.

Reporter may crash with ENOENT on empty specs #11

Open
khitrenovich opened this issue Dec 15, 2016 · 2 comments
Open

Reporter may crash with ENOENT on empty specs #11

khitrenovich opened this issue Dec 15, 2016 · 2 comments

Comments

@khitrenovich
Copy link

khitrenovich commented Dec 15, 2016

When reporter is set to record video per test and keep videos for failed tests only, it may crash with ENOENT error when it has no content (for example, still WIP).

Sample spec:

it('sample test', function() {});

Sample failure:

      ✓ sample test
Error: ENOENT: no such file or directory, unlink '/sample/path/to/project/reports/videos/c927de20-84fc-460f-91ac-273892136ead.mov'
    at Error (native)
    at Object.fs.unlinkSync (fs.js:1089:18)
    at VideoReporter._stopScreencast (/sample/path/to/project/node_modules/protractor-video-reporter/lib/VideoReporter.js:104:8)
    at VideoReporter.specDone (/sample/path/to/project/node_modules/protractor-video-reporter/lib/VideoReporter.js:137:10)
    at dispatch (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1839:28)
    at ReportDispatcher.specDone (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1822:11)
    at Spec.specResultCallback [as resultCallback] (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:760:18)
    at complete (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:327:12)
    at QueueRunner.clearStack (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:555:9)
    at QueueRunner.run (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1754:12)
==== async task ====
    at Object.<anonymous> (/sample/path/to/project/node_modules/jasminewd2/index.js:94:33)
    at attemptAsync (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1789:24)
    at QueueRunner.run (/sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1745:16)
    at /sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1771:16
    at /sample/path/to/project/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1716:9
    at /sample/path/to/project/node_modules/jasminewd2/index.js:18:5
    at /sample/path/to/project/node_modules/jasminewd2/index.js:100:21
    at /sample/path/to/project/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (/sample/path/to/project/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)

Sample Reporter configuration:

    var VideoReporter = require('protractor-video-reporter');
    jasmine.getEnv().addReporter(new VideoReporter({
      baseDirectory: path.join(__dirname, 'reports/videos/'),
      singleVideo: false,
      saveSuccessVideos: false
    }));
@khitrenovich khitrenovich changed the title Reporter crashes with ENOENT on empty specs Reporter may crash with ENOENT on empty specs Dec 15, 2016
@khitrenovich
Copy link
Author

khitrenovich commented Dec 15, 2016

Note that situation here is somehow similar to #8, but (my guess) here the file was not created yet because the spec is too short.

@benjaminapetersen
Copy link

I have also experienced this.

Related to #21.

When I remove the boolean flag, I do get an output, but not a video file:

test/reports/videos/protractor-specs.srt

This file contains the following:

1
00:00:00,004 --> 00:00:08,194
<font color="red">FAILED</font> should be able to create a new project

The boolean is not working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants