PhantomJS,Qunit,Grunt测试浏览器大小调整小部件 [英] PhantomJS, Qunit, Grunt testing browser resize widgets
问题描述
我创建了一个jQuery UI Widget
,它会调整DIV/内容的大小以填充浏览器屏幕.一切正常,但现在我想创建unit tests
来测试它正在调整大小并保持边界等.
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.
我正在将Grunt
与grunt-contrib-qunit
结合使用,后者使用PhantomJS
进行测试,但是现在由于无法通过JS调整浏览器的大小,因此现在不确定如何测试浏览器的大小.也许PhantomJS提供了一些使我可以在运行时对其进行更改的东西?
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?
推荐答案
检查 CasperJS 库.它允许您控制浏览器"(实际上是PhantomJS).
Check CasperJS library. It allows you to control "browser" (which is PhantomJS actually).
这篇关于PhantomJS,Qunit,Grunt测试浏览器大小调整小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!