我想用 jenkins 测试一个 specflow 项目。而且我只能测试一个项目。我只是更改它显示No tests to execute
消息的测试文件。即使两个项目具有相同的内容,只是项目名称不同。为什么会这样?什么原因?请帮帮我,谢谢!
消息是:
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\test2
Path To MSTest.exe: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe
Delete old result file file:/C:/Program%20Files%20(x86)/Jenkins/workspace/test2/TestResult.trx
[test2] $ "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" /resultsfile:TestResult.trx "/testcontainer:C:\Users\Documents\Visual Studio 2013\Projects\test\test\bin\Debug\test.dll"
Microsoft (R) Test Execution Command Line Tool Version 12.0.21005.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading C:\Users\Documents\Visual Studio 2013\Projects\test\test\bin\Debug\test.dll...
Starting execution...
No tests to execute.
Processing tests results in file(s) TestResult.trx
FATAL: No MSTest test report files were found.
FATAL: No MSTest TRX test report files were found. Configuration error?
Build step 'Publish MSTest test result report' marked build as failure
Finished: FAILURE
是的。我只是调试所有测试。我尝试将 specflowfeaturesteps.cs 中的内容放入 Unit.cs。并尝试使用 jenkins 运行它。然后我发现它只测试了单元测试中的一个函数。
消息:
通过 test.UnitTest1.login 1/1 测试通过
specflowfeature.feature:
Given I login pages with default test user and password
Then the page should show 'http://' on the screen
specflowfeaturesteps.cs:
[Given(@"I login pages with default test user and password")]
public void login_success()
{
I.Open("http://");
I.Enter("cherry").In("#loginName");
I.Enter("****").In("#password");
I.Click("input[value='Log In']");
}
[Then(@"the page should show '(.*)' on the screen")]
public void check_URL(string p0)
{
I.Assert.Url((uri) => uri.GetLeftPart(UriPartial.Path) == p0);
}