bennyhat / protractor-istanbul-plugin Goto Github PK
View Code? Open in Web Editor NEWProtractor plugin that collects istanbul coverage results from a page and dumps them to coverage.json files (one per spec).
License: MIT License
Protractor plugin that collects istanbul coverage results from a page and dumps them to coverage.json files (one per spec).
License: MIT License
I have made a saveCoverage function identical the example in the readme.md and added it to my config.
Unfortunately after running a few tests that appear to not save any coverage information (we know the code is being hit via console.log) and running saveCoverage it still is not writing the coverage information to disk. Does the saveCoverage function need to return anything or is it just an empty function? Any ideas why my function is not working?
The plugin does not seem to respect the options passed
here is my config:
plugins: [{
"path": "./node_modules/protractor-istanbul-plugin",
"outputPath": "coverage/e2e"
}],
outputPath is style coverage
the options
argument of the setup
function is empty....
Hi there,
i just installed this plugin into my project and edited the protractor.conf.js per doc suggested.
When i ran the e2e testing, there's no code coverage json files generated under coverage folder.
Would u please give me some hints?
Thank you in advance.
We're using protractor 4.0.2, Jasmine 2, and version 2.0.0 of protractor-istanbul-plugin. Tests pass on Chrome and even on Firefox when using a Linux or Mac. For some reason on Windows our e2e tests hang after a couple of tests and the only way to fix it is to remove this plugin from our protractor config file. By the way versions of Firefox later than 46 aren't working at all with Protractor so we're using version 46.
I have added the plugin to the protractor.conf.js as shown in the readme. However there is neither default 'coverage' folder created, nor created when i add the outputPath property manually. Anyway those are the logs from the protractor:
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
Test select component configuration:
․ Test select component configuration: 2920ms
1 passing (3s)
Plugin: protractor-istanbul-plugin (teardown)
�[32m Pass: Coverage gathering �[39m
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
Finished 'e2e' after 4.16 s
I am using protractor version 2.1.0.
Thank you in advance!
I have used this example you have
https://github.com/bennyhat/protractor-istanbul-plugin-example
However my results show
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|
=============================== Coverage summary ===============================
Statements : 100% ( 0/0 )
Branches : 100% ( 0/0 )
Functions : 100% ( 0/0 )
Lines : 100% ( 0/0 )
================================================================================
I move the files to a tmp directory and source that directory in my server.
gulp.task('test:files', function(done) {
return gulp.src(['app/**'])
.pipe(gulp.dest('tmp/'));
});
gulp.task('test:app:coverage', ['test:files'], function() {
return gulp.src(['./app/**/*.js'])
.pipe(gulpIstanbul({
coverageVariable: '__coverage__'
}))
.pipe(gulp.dest('tmp/'));
});
app.use('/', express.static(path.join(staticAssetBase, 'tmp')));
and my protractor config contains
plugins : [{
package: 'protractor-istanbul-plugin',
logAssertions: true,
failAssertions: true
}],
Is there anything I am missing that will get my results.
When we run the test in our environment, our test goes to multiple stacks which also uses same plugin and has this __coverage__
variable so our coverage gets messed up.
There should be a way to change the name of this variable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.