用于测试的假 X 服务器? [英] Fake X server for testing?

查看:33
本文介绍了用于测试的假 X 服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们全面测试了 GUI 组件.问题源于这样一个事实,即在测试套件运行时,会弹出各种组件,窃取焦点或使其无法继续工作.我首先想到的是 Xnest,但我想知道这个问题是否有更优雅的解决方案.

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.

推荐答案

我认为您在这里需要做的是让您的测试在与您正在处理的显示器不同的显示器上运行.

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

当我们将 TeamCity 代理移至 EC2 时,我们必须找出在无外设 Linux 服务器上运行 UI 单元测试的解决方案.我在这篇博客文章,概述了如何使用 Xvfb.

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 运行服务器.我将此添加到我的 EC2 代理上的 rc.local 文件中,以便在机器启动时启动它.
  • 然后我将 env.DISPLAY :100 添加到我的 TeamCity 构建配置
  • 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

这篇关于用于测试的假 X 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆