I need to test my script at different viewport sizes. In my tests I'd like to change the viewport size of PhantomJS by setting page.viewportSize. I'm running my tests through grunt-contrib-qunit and PhantomJS isn't accessible in my test code. Is there a way to gain access to it?
It's not possible now on the dist version.
grunt-contrib-qunit depends on grunt-lib-phantomjs, which don't allow this feature. But, an interesting commit (6 days ago) from bdowling on github is available. For sure, this will help you.
You can get this commit by yourself end edit the qunit task to try it.
Patience, my young Padawan. Patience!
It's possible to do this now. Here's what my Gruntfile.js
looks like:
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: {
src: ['tests/test.html'],
options: {
page : {
viewportSize : { width: 1280, height: 800 }
}
}
},
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With