持续集成.Net和Javascript与单元测试 [英] Continuous Integration For .Net and Javascript with Unit tests

查看:162
本文介绍了持续集成.Net和Javascript与单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个持续集成工具,它将支持.Net单元测试和Javascript单元测试并执行构建。



看起来我的主要选项是CruiseControl。 NET使用JUnit和NUnit或团队城市和JS测试驱动程序。



是否有任何其他选项,你使用或有好的或坏的经验。


解决方案

+1。我使用CC.Net和NUnit& Selenium 进行UI测试。 CC.Net允许你做你需要的一切,这是一个轻松的设置。



您可以编写自定义模块,以便在构建服务器上执行诸如递增构建版本号和修改配置文件等操作。



您可以快乐地使用单元测试和Selenium的组合来测试UI,使用如下测试:

  [TestFixture] 
public class UITest
{
private ISelenium selenium;
private StringBuilder verificationErrors;

[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium(server,4444,* iexplore,http://服务器/);
selenium.Start();
verificationErrors = new StringBuilder();
}

[Test]
public void TheUITest()
{
selenium.Open(/ RecipeProfessor2 /);
selenium.Click(btnTest);
selenium.Click(Button1);
selenium.Click(ctl00_ctl06_toolBar_Home_Solve);
selenium.Click(ctl00_ContentPlaceHolder1_chkIsLive);
selenium.WaitForPageToLoad(30000);
// etc
}

}

你可以添加任何标准单元测试或UI测试所需的测试。


I need a Continuous integration tool that will support both .Net Unit tests and Javascript unit tests and perform the builds.

It looks like my main options are CruiseControl.NET using JUnit and NUnit or Team City and JS Test Driver.

Are there any other options and which ones have you used or had good or bad experiences with.

thanks

解决方案

+1 for CC.Net here. I use a combination of CC.Net and NUnit & Selenium for UI testing. CC.Net allows you to do everything you require and it's a doddle to setup.

You can write custom modules to allow you to do things such as incremenet build numbers and modify config files on the build server.

You can happily use a combination of unit tests and Selenium to test the UI using a test such as the following:

[TestFixture]
public class UITest
{
    private ISelenium selenium;
    private StringBuilder verificationErrors;

    [SetUp]
    public void SetupTest()
    {
        selenium = new DefaultSelenium("server", 4444, "*iexplore", "http://server/");
        selenium.Start();
        verificationErrors = new StringBuilder();
    }

    [Test]
    public void TheUITest()
    {
        selenium.Open("/RecipeProfessor2/");
        selenium.Click("btnTest");
        selenium.Click("Button1");
        selenium.Click("ctl00_ctl06_toolBar_Home_Solve");
        selenium.Click("ctl00_ContentPlaceHolder1_chkIsLive");
        selenium.WaitForPageToLoad("30000");
        // etc
    }

}

You can obviously add in as many tests you require for either standard unit tests or UI tests.

这篇关于持续集成.Net和Javascript与单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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