远程虚拟机上的自动化 UI 测试策略

发布于 2024-09-16 12:10:19 字数 543 浏览 4 评论 0 原文

我正在使用 TeamCity 进行 CI 构建,并且希望设置第二个构建来在 Windows XP 和 Windows 7 虚拟机上运行自动化 UI 测试。

我想象构建工作如下:

  1. 编译,运行单元测试等。
  2. 使用 WiX
  3. 准备 MSI 将 MSI 复制到目标测试机器
  4. 远程执行 MSI 的
  5. 将测试工具代码复制到远程机器
  6. 运行测试
  7. 构建完成

自动化 UI 测试是使用 NUnit 编写的,并且将需要直接在测试虚拟机上运行(它们不能远程运行)。重要的是,如果测试失败,它会出现在 TeamCity 构建日志中并且构建失败。我不想在任何一个测试虚拟机上安装 VS 或 TeamCity 构建代理。

看来大部分工作应该可以使用 psexec.exe 来实现。我应该考虑其他替代工具(最好是开源工具)吗?

I'm using TeamCity for my CI builds, and I'd like to set up a second build for running automated UI tests on Windows XP and Windows 7 virtual machines.

I imagine the build working as follows:

  1. Compile, run unit tests, etc.
  2. Prepare MSI using WiX
  3. Copy MSI to target test machines
  4. Remotely execute MSI's
  5. Copy test harness code to remote machine
  6. Run tests
  7. Build finishes

The automated UI tests are written using NUnit and would need to be run directly on the test virtual machine (they can't run remotely). It's important that if the tests fail, it appears in the TeamCity build log and the build fails. I'd rather not install VS or the TeamCity build agents on either of the test virtual machines.

It seems that most of this should be possible using psexec.exe. Are there any alternative (preferably open source) tools that I should look at?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏の忆 2024-09-23 12:10:19

深吸一口气

我们正在寻找一些方法来帮助我们完成自动化 UI 测试。我们使用 ranorex 来测试 UI,并使用 TeamCity/Msbuild 来执行测试。

我们从未找到任何工具来帮助我们(我一直在关注一些工具,所以会监视这个线程),但这是我们所做的。

  1. CI 服务器将安装文件和测试脚本复制到测试主机服务器。
  2. 然后,CI 服务器在测试主机服务器上启动自定义应用程序,并提供要启动的 VM 的名称。
  3. 然后,测试主机服务器使用 Virtual PC.exe -singlepc -pc vhdname.vhd -launch 启动 VM 软件,并等待其关闭(在运行测试后)。
  4. VM 从网络位置获取安装文件和脚本并执行。
  5. 运行测试后,它将结果返回到网络位置并自行关闭。
  6. 控制权返回给自定义应用程序。
  7. 控制权返回到 CI 服务器,该服务器根据结果确定它是通过还是失败(并更新 UI,以便开发人员了解结果)。
  8. 结果作为工件收集在 TeamCity 中并在 Svn 中标记。

我想这就是全部了。虽然很复杂,但它确实有效。希望其中有人能帮助你。

takes a deep breath

We were looking into something to help us out with our automated UI tests. We use ranorex to test the UI and TeamCity/Msbuild to execute the tests.

We never found any tools to help us out (I’m constantly keeping an eye out for some so will monitor this thread) but here is what we did instead.

  1. The CI server copies the setup files and test scripts to the Testing Host Server.
  2. The CI server then launches a custom app on the Testing Host Server providing the name of the VM to launch.
  3. The Test Host Server then launches the VM software, using Virtual PC.exe -singlepc -pc vhdname.vhd -launch , and waits for it to shutdown (after it’s run its tests).
  4. The VM grabs the setup files and scripts from the network location and executes.
  5. After the tests are run it then returns the results to a networked location and shuts itself down.
  6. Control is returned to the custom app.
  7. Control is returned to the CI server which determines from the results if it has passed or failed (and updates the UI so developers are made aware of the result).
  8. Results are collection as artifacts in TeamCity and tagged in Svn.

I think that's everything. Its convoluted, however, it works. Hope someone of that helps you.

铁轨上的流浪者 2024-09-23 12:10:19

Gallio 团队的 Jeff Brown 已谈论一个名为Archimedes 来支持这种要求。听起来很有希望,但我认为到目前为止还没有取得太大进展。

与此同时,Gallio 项目中有一个名为 VM Tool 这可能会做你想做的事。它提供了停止、启动和快照虚拟机的命令,更重要的是,来回复制文件和执行命令。

我想您还考虑过 Powershell 远程处理

Jeff Brown of the Gallio team has been talking about a tool called Archimedes that he's planning to write to support this kind of requirement. It sounds promising, but I don't think there has been much progress on it so far.

In the mean time though, there is something in the Gallio project called VM Tool that may do what you want. It provides commands to stop, start and snapshot virtual machines, and more importantly, to copy files back and forth and execute commands.

I presume you have also considered Powershell Remoting?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文