Fake X server for testing?

和自甴很熟 提交于 2021-02-06 10:03:26

问题


At work we fully test the GUI components. The problem arises from the fact that, while the testsuite is running, the various components pop up, stealing the focus or making it impossible to continue working. The first thing I thought of was Xnest, but I was wondering if there's a more elegant solution to this problem.


回答1:


I think what you need to do here is have your tests run on a different Display than the one you're working on.

When we moved our TeamCity agents to EC2, we had to figure out a solution to running our UI unit tests on a headless Linux server. I found a way to do it in this blog post, which outlines how to use Xvfb.

For my case, all I had to do was:

  • yum install xorg-x11-server-Xvfb
  • Xvfb :100 -ac to run the server. I added this to my rc.local file on my EC2 agents to start it at machine startup.
  • Then I added env.DISPLAY :100 to my TeamCity build configuration


来源:https://stackoverflow.com/questions/14321636/fake-x-server-for-testing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!