DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.81k stars 668 forks source link

Unable to take screenshots on linux with GNOME on Wayland #1180

Closed sirgallifrey closed 6 years ago

sirgallifrey commented 7 years ago

Are you requesting a feature or reporting a bug?

Bug (I think)

What is the current behavior?

Test unable to take screenshots on linux error screenshot

  Was unable to take a screenshot due to an error.

  Command failed: /home/browser-tests/node_modules/testcafe-browser-tools/bin/linux/64/screenshot
  /home/browser-tests/ss/2017-01-26_05-15-43/test-3/Chrome_55.0.2883_Linux_0.0.0/errors/1.png
  X Error of failed request:  BadWindow (invalid Window parameter)
    Major opcode of failed request:  3 (X_GetWindowAttributes)
    Resource id in failed request:  0x0
    Serial number of failed request:  7
    Current serial number in output stream:  8

What is the expected behavior?

To take screenshots normally, as it as introduced for linux in v0.12.0

How would you reproduce the current behavior (if this is a bug)?

I just run a test which fails with the options to take screenshots on fails

Steps to reproduce

test.js

fixture('test').page('http://google.com')

test('if is facebook', async (t) => {

    await t.expect(await t.eval(() => {window.location.toString()})).match(/(facebook.com)$/, 'hey, this is not facebook');
});
testcafe -S -s ./ss chrome test.js

Specify your

AndreyBelym commented 7 years ago

Hello, @sirgallifrey! What window manager are you using? Currently we need full EWMH support: https://github.com/DevExpress/testcafe-browser-tools/issues/112.

sirgallifrey commented 7 years ago

Ohh I see.. Sorry I haven't searched for issues on testcafe-browser-tools Is there something I can do to help?

My wm info:

# wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
AndreyBelym commented 7 years ago

Are you using Wayland or X11?

sirgallifrey commented 7 years ago

X11

AndreyBelym commented 7 years ago

Can you give me the outputs of pacman -Q and ps aux, please?

sirgallifrey commented 7 years ago

yes, but they are a little big, I paste here anyway?

sirgallifrey commented 7 years ago

ps aux

pacman -Q

AndreyBelym commented 7 years ago

Really thank you! Unfortunately, you are using Wayland (search for wayland in ps aux). GNOME Shell has very limited support for EWMH under Wayland: https://wiki.gnome.org/Initiatives/Wayland/Gaps#ICCCM.2BAC8-EWMH. With X11 Gnome Shell it must be fine, I have tested X11 GNOME on Fedora 24. As workaround, please, try to log out, get to the password input screen, press the gear and select regular GNOME (not GNOME on Wayland), like on the screenshot below. image

sirgallifrey commented 7 years ago

:open_mouth: You know more about my OS setup than myself.. haha In my 'gear menu' I have the options: GNOME, GNOME Classic and GNOME on Xorg. I was using the GNOME option and to test I changed to GNOME on Xorg but it had no effect and the ps aux still shows Wayland... I am the one who have to thank you @AndreyBelym

So it's not a bug then. It's expected to not work on a EWMH-non-compliant window manager.

I don't know if you guys have plans on supporting non EWMH window managers or not, but if you do I'm available to help if you need to test something

AndreyBelym commented 7 years ago

Yes, we have, and I think that we have to develop it ASAP, because GNOME is quite popular desktop environment, and meanwhile Wayland is getting more common.

AndreyBelym commented 6 years ago

Closed in favor of https://github.com/DevExpress/testcafe/issues/2415

lock[bot] commented 5 years ago

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.