You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
},
instrument: {
files: ['../WebContent/resources/js/**/*.js'],
options: {
lazy: true,
coverageVariable: '__coverage__',
basePath: 'coverage/e2e/instrumented/test/'
}
},
connect: {
server: {
options: {
port: 3000,
hostname: 'localhost',
}
},
},
protractor_coverage: {
options: {
configFile: "node_modules/protractor/example/conf.js", // Default config file
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
//coverageDir: 'coverage/e2e/instrumented/',
//debug: true,
args: {
// Arguments passed to the command
}
},
custom: {
options: {
configFile: "src/conf.js", // Target-specific config file
//coverageDir: 'coverage',
//debug: true,
args: {
baseUrl: 'http://localhost:3000/',
// Arguments passed to the command
//'browser': 'firefox'
},
run: {}
}
}
},
makeReport: {
src: 'coverage/**/*.json',
options: {
type: 'html',
dir: 'coverage_reports',
print: 'detail'
}
}
});
//loading grunt task
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-protractor-webdriver');
grunt.loadNpmTasks('grunt-protractor-coverage');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
//Registering task to be executed
grunt.registerTask('test', ['clean:tests','copy:coverageE2E', 'instrument' ,'connect','protractor_coverage:custom','makeReport']);
};
I suppose while providing the instrumented code to the test case at http://localhost:3000 , there appears to be some problem, as this is acting like base url, to which I have appended application relative paths when doing a browser.get('/testgui'). however, this throws the error-Angular could not be found on the page.
Is there anything I have misunderstood or missed?
Any suggestions?
The text was updated successfully, but these errors were encountered:
i'm also getting the same error with a similar kind of Grunt file.
Resources followed for this setup : https://dzone.com/articles/measuring-code-coverage
If anyone has any updates or workaround for this, do comment.
Hi,
While working on code coverage for protractor e2e cases, using grunt-protractor-coverage, I observed this issue on test execution.
PFB the gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['coverage', 'coverage_reports'],
},
copy: {
coverageE2E: {
files: [{
expand: true,
dot: true,
cwd: '/path/to/base/directory/',
dest: 'coverage/e2e/instrumented/app',
src: [
'WebContent/resources/css/',
'WebContent/resources/fonts/',
'WebContent/resources/html/',
'WebContent/resources/images/',
]
}]
}
};
I suppose while providing the instrumented code to the test case at http://localhost:3000 , there appears to be some problem, as this is acting like base url, to which I have appended application relative paths when doing a browser.get('/testgui'). however, this throws the error-Angular could not be found on the page.
Is there anything I have misunderstood or missed?
Any suggestions?
The text was updated successfully, but these errors were encountered: