前情提要
- 專案使用 Specflow 寫 BDD
- Visual Stuio 找不到測試所以才升級 SpecRun 與 Specflow
- Visual Studio 2017 升級到 15.8.1 後突然無法正常搜尋到測試
- SpecRun.Runner 升級(1.2 → 1.8.2)
去年 12 月跟 Visual Studio 折騰了許久,才讓專案的測試項目重見光明,
在今年與其它專案合併後,測試又從我們團隊的眼前消失了。
調整項目
升級 Specflow 與 SpecRun 相關套件
取得 SpecRun 位於專案的 packages
資料夾中。
設定 CI
由於 SpecRun 版本不符會導致 CI Job Error , 需要設定以新的 SpecRun 執行 CI
D:\SpecRun.Runner.1.8.2\tools\SpecRun.exe run D:\Project\Core.Test\bin\Debug\Core.Test.dll /baseFolder:Core.Test\bin\Prod /toolIntegration:vs201 0 /reportFile:Core.Test.TestResult.html
參考
VS2017 的測試總管找不到測試項目,或僅有部分資料
說明:Something changed in the NUnit and XUnit Test Adapter.
But I am not sure, if it really worked before the Visual Studio update.
I think I saw this behavior already in earlier versions of Visual Studio and NUnit3/XUnit2. (此原因尚未被實證)- 解法 1(暫解):
工具>擴充功能和更新>停用”Dotnet Extensions for Test Explorer” - 解法 2(暫解):
改用 VS2015 - 參考:
- 解法 1(暫解):
We could not find a data exchange file at the path System.ArgumentNullException
- 說明: 聽說 SpecFlow 2.2 fixed
- 解法(暫解): Tools > Options > SpecFlow >Data Exchange Path,隨便設定一個路徑去 overwrite the default value
- 參考:
- Build fails: We could not find a data exchange file
- Visual Studio 2017 Generation error: Could not load file or assembly ‘Microsoft.Build.Framework, Version=15.1.0.0
- Visual Studio Plugin for VS2017 does not always use Specflow Generator 2.2.0.0
- SpecFlow with SpecRun and NUnit fails with ArgumentNullException #639
(fin)