DevExpress / testcafe-browser-tools

Browser manipulation utils for TestCafe.
https://testcafe.io
MIT License
30 stars 34 forks source link

Unable to resize windows on xmonad #209

Closed Matt-Deacalion closed 3 years ago

Matt-Deacalion commented 3 years ago

Running the following test with TestCafe:

test('…', async t => {
    await t.resizeWindow(200, 200);
});

I get this output:

 Warnings (1):
 --
  Was unable to resize the window due to an error.

  The
  /home/matt/.npm-packages/pnpm-global/4/node_modules/.pnpm/testcafe-browser-tools@2.0.13/node_modules/testcafe-browser-tools/bin/linux/glibc-64/resize
  process failed with the null exit code.

Chrome 87.0.4280.88 and xmonad 0.15.

AlexKamaev commented 3 years ago

Hello, I was able to reproduce the issue. However, I am not sure that my system was set up like yours and that the cause of the issue is the same. I followed this guide to install clean xmonad: https://www.youtube.com/watch?v=3noK4GTmyMw I use the following configuration file: http://code.haskell.org/xmonad/man/xmonad.hs Do I need to install anything else? Could you please share your xmonad.hs configuration file? Could you clarify how TestCafe should resize windows in the tiling window manager? Is the mode without tiles available as well? Can you resize the browser window when you run it without a browser?

Matt-Deacalion commented 3 years ago

My xmonad configuration is the same as the default, I did try to float Chrome windows by default (so they're not tiled and can be resized) with the following change in xmonad.hs on line 213:

myManageHook = composeAll
    [ className =? "Gimp"           --> doFloat
    , className =? "Google-chrome"  --> doFloat ]

I can resize the browser window by floating it (in xmonad: hold Alt, right click and drag the window).

Thank you for the response! My tests work fine if I run testcafe in headless mode, so I'm using that for now.

$ testcafe 'chrome:headless' tests/e2e
Matt-Deacalion commented 3 years ago

PS: when you edit ~/xmonad/xmonad.hs it needs to recompile, you can do this with Alt + Tab + q when using the default configuration.

AndreyBelym commented 3 years ago

We use the _NET_MOVERESIZE_WINDOW message to resize windows on Linux platforms. This message is a part of the Extended Window Manager Hints (EWMH) convention. Xmonad doesn't support EWMH out of the box and only partial EWMH support is offered by a third-party party plugin: Xmonad.Hooks.EwmhDesktops. The plugin doesn't support the _NET_MOVERESIZE_WINDOW message, but you could write a custom hook to handle it.

We state in our docs that your window manager should be ICCCM/EWMH compliant on Linux: Resize Window. It seems that Xmonad is not completely EWMH-compliant, so I have to close this issue.

Matt-Deacalion commented 3 years ago

Thank you for the clarification @AndreyBelym - I got thrown off by this Wikipedia page and thought xmonad was ICCCM / EWMH compliant.