웹, MVC4, WatiN 및 NUnit 용 VS Express 2012를 사용하여 "Hello World"WatiN 예제를 사용하려고합니다.웹, MVC4, WatiN 및 NUnit 용 VS Express 2012를 사용하여 통합 테스트를 찾거나 실행할 수 없습니다.
그러나 테스트는 Visual Studio에서 인식되지 않는 것 같습니다. 테스트 방법을 마우스 오른쪽 버튼으로 클릭하고 "테스트 실행"을 클릭하면 재 작성 (깨끗한 상태)을 제외하고는 아무 것도 발생하지 않습니다. 아무 때나 "테스트 탐색기"에 아무 것도 나타나지 않습니다.
통합 테스트 코드는 다음과 같습니다
내가 nuget를 사용하여 NUnit를하고 WatiN을 모두 설치 한using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using WatiN.Core;
namespace FootyStatMVC1.Tests
{
[TestFixture]
[RequiresSTA]
public class UnitTest1
{
[Test]
public void TestMethod1()
{
IE ie = new IE("http://www.google.com");
ie.TextField(Find.ByName("q")).TypeText("WatiN");
ie.Button(Find.ByValue("Google Search")).Click();
}
}
}
. 또한 결과 설정 파일의 app.config라는이처럼 보이는
http://agilewarrior.wordpress.com/2010/07/02/getting-started-with-watin-nunit-and-mvc-net/
에 의해 조언 구성 코드를 추가 한 :
<configuration>
<appSettings>
</appSettings>
<connectionStrings></connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<!-- MSM integration testing aug 31st-->
<configSections>
<sectionGroup name="NUnit">
<section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<NUnit>
<TestRunner>
<!-- Valid values are STA or MTA (Others are ignored) -->
<add key="ApartmentState" value="STA" />
</TestRunner>
</NUnit>
</configuration>
왜 비주얼 스튜디오에 보이지 않는 시험? 사전에
감사합니다!
매트
업데이트 : 빌드에 대한 오류 목록에서 다음과 같은 "i"(정보) 경고를 발견했습니다 : "NUnit '요소에 대한 스키마 정보를 찾을 수 없으며'TestRunner ','add ' 'key'와 'value'. 모두 태그 사이의 라인을 나타냅니다. VS가이를 인식하지 못하는 이유는 무엇입니까? –
matskm