javascriptfunctional-testingfuncunit

Javascript FuncUnit open a wider window?


When I try to use FuncUnit to open a browser window to run some tests, the window it opens is too narrow and the site I am testing hides some menu items to work with the narrow window. Is there some way to increase the width of the window FuncUnit opens so the presence of these menu items can be tested? The docs provide no help with this issue.

The FuncUnit code I have is really basic:

test("dummy test", function () {
F.open('http://localhost:8000/');
});

I can increase the size of the window by hand after the test starts running, but that does not work for automated testing.

EDIT:

Other attempts that worked less well:


Solution

  • In the callback of F.open() use F.win.resizeTo(width, height):

    F.open("desired-url", function onOpenSuccess() {
        F.win.resizeTo(1024, 768);
    });