PhantomJS, Qunit, Grunt testing browser resize widgets
Asked Answered
F

2

1

I've created a jQuery UI Widget that resizes a DIV/thing to fill up the browser screen. It all works fine but now I want to create unit tests for testing that it's resizing and keeping to boundaries etc.

I'm using Grunt with grunt-contrib-qunit, which uses PhantomJS to do tests but am now unsure how I can test browser resizing at this point as it's not possible via JS to resize a browser. Perhaps PhantomJS provides something that allows me to alter it at runtime?

Field answered 4/7, 2013 at 9:57 Comment(0)
B
1

Check CasperJS library. It allows you to control "browser" (which is PhantomJS actually).

Bashemath answered 24/9, 2013 at 12:8 Comment(0)
T
0

You can use the following code to define the width and height of the chrome-less browser:

grunt.initConfig({
   qunit: {
      src: ['tests/test.html'],
      options: {
          page : {
              viewportSize : { width: 1280, height: 800 }
          }
      }
   },
});
Tweeny answered 20/3, 2015 at 13:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.