2017-05-06 152 views
1

我不確定問題是出現在NUnit還是SpecFlow中,但是每當我將「運行功能測試」任務添加到我的構建中時,在TFS2017中運行構建時出現以下錯誤。 ..在TFS2017中運行NUnit/SpecFlow測試

2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test discovery started. 
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 5 
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again. 
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Error : NUnit Adapter 3.7.0.0: Test discovery complete 
2017-05-06T00:11:00.4676774Z 
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test run aborted. Test run id: 5 
2017-05-06T00:11:00.4676774Z ##[error]System.Exception: The test run was aborted, failing the task. 
2017-05-06T00:11:00.5175379Z ##[error]PowerShell script completed with 1 errors. 

有沒有人知道問題是什麼?

非常感謝,

+0

測試可以在本地運行成功嗎?你正在使用哪個版本的VS和VS測試代理? –

+1

不太清楚是什麼問題,但切換到MSTest似乎可以解決問題 – Konzy262

+0

如果您使用speckflow,則需要確保使用MS Test來實現。您只需要使用與您爲SpecFlow使用的提供程序的單元測試相同的適配器。更多細節請看下面我的回覆。 –

回答

0

Run Functional Tests task用於以下場景。

典型場景包括:要求在測試機器其他安裝

  • 試驗,如不同的瀏覽器爲硒測試
  • 編碼的UI測試
  • 測試需要一個特定的操作系統配置
  • 要使用多臺測試機更快地執行大量單元測試

如果您正在使用speckflow,您需要確保您使用MS Test來實現。

不管單元測試供應商使用這對SpecFlow,因爲所有主要的單元測試框架,它提供了必要的適配器(這是你需要運行從Visual Studio測試測試相同的適配器的事實Explorer窗口)

因此,您需要在此場景中使用Visual Studio Test任務(也用於處理標準單元測試)。有關設置的詳細信息,請參閱此博客:SpecFlow Tips--Run only specific scenarios in TFS/VSTS build