如何使用 TFS build 2015 运行自动硒测试? [英] How can i run automated selenium tests using TFS build 2015?

查看:20
本文介绍了如何使用 TFS build 2015 运行自动硒测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有嵌入到单元测试中的 NUnit selenium 测试,我正在尝试使用 TFS Build 2015 运行它.所有测试都在本地运行得很好,但不是从 TFS 服务器运行的.我启用了代码覆盖,发现Module unittests.dll"工作正常,大部分代码都被覆盖,但Seleniumtest.exe"覆盖了0行.

I have NUnit selenium tests that i have embedded into Unit test and i am trying to run this using TFS Build 2015. All the tests run perfectly fine locally but not from the TFS Server. I enabled code coverage and found out that "Module unittests.dll" works fine and most of the code is covered but for "Seleniumtest.exe" 0 lines covered.

我已经阅读了很多关于这个问题的文章,并想到了让 TFS 代理以交互模式运行的想法,但我不知道如何从 TFS 服务器执行此操作,而且大多数在线文档都不够好.谢谢

I have read a lot on this problem and came across the idea of enabling the TFS Agent to run in interactive mode but i do not know how to do this from the TFS Server and most of the documentation online is not good enough.Thanks

推荐答案

如果您使用的是托管代理队列,则不能.如果您有自己的本地构建代理,则只需从命令提示符(而不是作为服务)运行该代理.这就是互动"的全部含义.

If you're using the Hosted agent queue, you can't. If you have your own on-premise build agent, you just need to run the agent from a command prompt (as opposed to as a service). That's all that "interactive" means.

您还可以使用 测试代理任务 将测试代理部署到目标机器并调用它们的测试.即使您使用托管代理队列,这也允许您运行 UI 测试——您会将测试的运行传递给本地测试代理.

You can also use the Test Agent tasks to deploy a test agent to a target machine and invoke the tests on them. This will also allow you to run UI tests even if you're using the hosted agent queue -- you'll be passing off the running of the tests to an on-premise test agent.

附带说明一下,您通常应该将 UI 测试作为构建过程的一部分运行,而应作为应用程序发布到 QA 环境后发布管道中的一个步骤.UI 测试缓慢且脆弱,您不希望 CI 过程因运行 UI 测试而陷入困境.

On a side note, you should generally not run UI tests as part of a build process, but rather as a step in a release pipeline after the application has been released to a QA environment. UI tests are slow and brittle, and you don't want your CI process to be bogged down with running UI tests.

这篇关于如何使用 TFS build 2015 运行自动硒测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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