-
Notifications
You must be signed in to change notification settings - Fork 25
Saga doesn't generate correct coverage metrics #96
Comments
Maybe it is to do with this.
I bumbed the version to 1.4.2 as saw some phantom related fixes but no luck?? |
your pom snippet may be more useful here as the error indicates it's failing to load a script |
pom snippet. if it can't find the scripts why does it generate a report? I saw some commit related to phantomjs and local http servers?
|
I have no experience using mocha/sinon, i've only used jasmine. |
Ok thanks, but I'm not using a local server. We are reading from the file system. |
I fixed this error but still no change in the metrics and a different ERROR, do these stop the metrics being generated.
|
The very raw version of possibly working PhantomJS support is in the snapshot version, not yet released, so 1.4.2 wouldn't have it either. And, sadly, I don't have any experience with mocha either, so if someone does - jump in. |
I have experience with mocha-phantomjs but what would I need to do to start experimenting or extending saga? I would be happy to contribute :) |
@JonCook that would be great! Most of the things you'd want are under saga-core (everything else is concrete implementations for various build systems and what not), you can take a look at the The most interesting thing in terms of this issue is how to instrument (and how to use the gathered stats, of course). The instrumentation itself, i.e. once you've already got your hands on the source code of a script, should work by now (that's your Last but not least, it uses Ghost Driver in order to talk to PhantomJS. So, kickstarts the driver, starts up a proxy server, sets it to be used by the driver, fires up the test and then collects the data. Let me know if you've got any questions 😄 |
@JonCook AFAIR it's only ignored because it mentions a full path to the phantomjs binary, and I didn't have the time to make it better, but apart from that, the test is supposed to work, I think |
Hi, I've had some time to play with this and appears to work with the existing phantom functionality. I created a new java unit tests and js files and it works. Would you like me to submit my test files? I do have another question, looks like 1.5 is stable now, do I need to put something in my pom.xml to see to use a phantomjs binary etc? Thanks |
@JonCook absolutely, tests are very welcome! To use PhantomJS you only need to put the web driver class name (see this comment for details). To specify the path to the phantomjs binary, you can use the Sorry there are no docs about this yet 😿 |
@timurstrekalov - Thanks <baseDir>http://10.248.40.101:8234/${basedir}/src</baseDir>
<webDriverClassName>org.openqa.selenium.phantomjs.PhantomJSDriver</webDriverClassName> I get a connect refused exception every time, looks like ghostdriver allocates a different port each time it starts up so how can I put the correct port? |
Are you sure the exception is coming from the PhantomJS port rather than Saga trying to connect to that URL over there? Would be nice to see the stacktrace... |
So it is really great I can plug saga straight into mvn and I get a report! Can't believe it!! However, always a however. I have the following test and corresponding js. I know the test definitely covers most of the js file in question but saga doesn't seem to recognise this and reports very low coverage. I wondered what I'm doing wrong, maybe it is the way the widget is constructed? We don't use new so maybe saga won't work in this way? Probably the widget code can be improved but that isn't the point yet..
We are using mocha-phantomjs testrunner.
Some ideas?
Thanks very much
Jon
widget under test:
Test
The text was updated successfully, but these errors were encountered: