Issues when runnning tests with Xvfb
See original GitHub issueHi,
I am trying to run some tests with pytest-qt using Travis and to simulate at my workstation the same issue I am using pytest-xvfb.
The following test works when running at my computer without the Xvfb but something very similar fails at Travis and also at my computer when using Xvfb.
from PyQt5.QtWidgets import QLineEdit
def test_focus(qtbot):
line_edit = QLineEdit()
qtbot.addWidget(line_edit)
with qtbot.waitExposed(line_edit):
line_edit.show()
line_edit.setFocus()
qtbot.waitUntil(lambda: line_edit.hasFocus())
assert line_edit.hasFocus()
I tried to follow the same as the solution on this issue in here: https://github.com/pytest-dev/pytest-qt/issues/160 but no lucky so far.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
38 How To Run Your Tests Headlessly with Xvfb
If you're running tests headlessly across different builds at the same time (e.g., in parallel) on your CI server, then jobs will start...
Read more >Running tests with xvfb-run - Development - VTK Discourse
Hello, PROBLEM: I'm trying to run VTK testing through xvfb-run ctest and many of the tests (complete list of failed tests) end up...
Read more >GUI and Headless Browser Testing - Travis CI Docs
To run tests requiring a graphical user interface on Travis CI, use xvfb (X Virtual Framebuffer) to imitate a display. If you need...
Read more >selenium tests fail: xvfb-run: error: Xvfb failed to start
Below code to start XVFB server and test in headless mode written for java perspective. should run below command in CENTOS.
Read more >100909 - Xvfb crashes on bots when running aura_unittests ...
Issue 100909: Xvfb crashes on bots when running aura_unittests and views_unittests ... [==========] Running 35 tests from 5 test cases. [----------] Global test...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @nicoddemus and @The-Compiler for the input. It was really an issue of not having the window manager.
Here is what did the trick for me:
Now all my tests are passing and working as expected. Thank you for this great tool! 👍
Sure! I’m just not sure if I added it to the best place but here it is: https://github.com/pytest-dev/pytest-qt/pull/207 👍