Fake X server for testing?

后端 未结 1 980
予麋鹿
予麋鹿 2021-02-07 10:07

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 i

相关标签:
1条回答
  • 2021-02-07 10:47

    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
    0 讨论(0)
提交回复
热议问题