Visual Studio Enterprise GenericTest 测试 运行 部署问题
Visual Studio Enterprise GenericTest Test Run deployment issue
我构建了一个 GenericTest 来将 CasperJs 测试与 TFS 测试用例相关联。
<?xml version="1.0" encoding="UTF-8" ?>
<GenericTest name="Login With Email" storage="c:\development\testproject\tests\generic\login with email.generictest" id="0d5c40d3-2224-4adf-9a5b-7ef5b6e61f3a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<DeploymentItems>
<DeploymentItem filename="testproject\Site\Login\Index.js" />
<DeploymentItem filename="testproject\Site\Settings.js" />
<DeploymentItem filename="testproject\Site\Navigation.js" />
<DeploymentItem filename="testproject\Site\History\Index.js" />
<DeploymentItem filename="testproject\Tests\LoginWithEmail.js" />
</DeploymentItems>
<Command filename="C:\tools\CasperJs.1.b\bin\casperjs.exe" arguments="test "testproject\Tests\LoginWithEmail.js" --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" />
<SummaryXmlFile path="%TestOutputDirectory%\<Enter summary file name here>" />
</GenericTest>
但是当我 运行 从测试资源管理器进行测试时,我得到了错误:
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Login\Index.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Login\Index.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Settings.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Settings.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Navigation.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Navigation.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\History\Index.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\History\Index.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Tests\LoginWithEmail.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Tests\LoginWithEmail.js'.
========== Run test finished: 1 run (0:00:14.346) ==========
知道为什么吗?
您似乎在 DeploymentItems filename
属性中使用相对路径。
测试运行程序在查找这些文件时似乎使用 C:\Windows\system32
作为工作目录(根据错误消息)。
从GenericTest节点中的storage
属性来看,这些文件位于c:\development\testproject\
中。因此,您必须将其添加到部署项的路径中:
<?xml version="1.0" encoding="UTF-8" ?>
<GenericTest name="Login With Email" storage="c:\development\testproject\tests\generic\login with email.generictest" id="0d5c40d3-2224-4adf-9a5b-7ef5b6e61f3a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<DeploymentItems>
<DeploymentItem filename="c:\development\testproject\Site\Login\Index.js" />
<DeploymentItem filename="c:\development\testproject\Site\Settings.js" />
<DeploymentItem filename="c:\development\testproject\Site\Navigation.js" />
<DeploymentItem filename="c:\development\testproject\Site\History\Index.js" />
<DeploymentItem filename="c:\development\testproject\Tests\LoginWithEmail.js" />
</DeploymentItems>
<Command filename="C:\tools\CasperJs.1.b\bin\casperjs.exe" arguments="test "testproject\Tests\LoginWithEmail.js" --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" />
<SummaryXmlFile path="%TestOutputDirectory%\<Enter summary file name here>" />
</GenericTest>
我构建了一个 GenericTest 来将 CasperJs 测试与 TFS 测试用例相关联。
<?xml version="1.0" encoding="UTF-8" ?>
<GenericTest name="Login With Email" storage="c:\development\testproject\tests\generic\login with email.generictest" id="0d5c40d3-2224-4adf-9a5b-7ef5b6e61f3a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<DeploymentItems>
<DeploymentItem filename="testproject\Site\Login\Index.js" />
<DeploymentItem filename="testproject\Site\Settings.js" />
<DeploymentItem filename="testproject\Site\Navigation.js" />
<DeploymentItem filename="testproject\Site\History\Index.js" />
<DeploymentItem filename="testproject\Tests\LoginWithEmail.js" />
</DeploymentItems>
<Command filename="C:\tools\CasperJs.1.b\bin\casperjs.exe" arguments="test "testproject\Tests\LoginWithEmail.js" --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" />
<SummaryXmlFile path="%TestOutputDirectory%\<Enter summary file name here>" />
</GenericTest>
但是当我 运行 从测试资源管理器进行测试时,我得到了错误:
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Login\Index.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Login\Index.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Settings.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Settings.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\Navigation.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\Navigation.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Site\History\Index.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Site\History\Index.js'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'testproject\Tests\LoginWithEmail.js' specified by the test 'login with email': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\testproject\Tests\LoginWithEmail.js'.
========== Run test finished: 1 run (0:00:14.346) ==========
知道为什么吗?
您似乎在 DeploymentItems filename
属性中使用相对路径。
测试运行程序在查找这些文件时似乎使用 C:\Windows\system32
作为工作目录(根据错误消息)。
从GenericTest节点中的storage
属性来看,这些文件位于c:\development\testproject\
中。因此,您必须将其添加到部署项的路径中:
<?xml version="1.0" encoding="UTF-8" ?>
<GenericTest name="Login With Email" storage="c:\development\testproject\tests\generic\login with email.generictest" id="0d5c40d3-2224-4adf-9a5b-7ef5b6e61f3a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<DeploymentItems>
<DeploymentItem filename="c:\development\testproject\Site\Login\Index.js" />
<DeploymentItem filename="c:\development\testproject\Site\Settings.js" />
<DeploymentItem filename="c:\development\testproject\Site\Navigation.js" />
<DeploymentItem filename="c:\development\testproject\Site\History\Index.js" />
<DeploymentItem filename="c:\development\testproject\Tests\LoginWithEmail.js" />
</DeploymentItems>
<Command filename="C:\tools\CasperJs.1.b\bin\casperjs.exe" arguments="test "testproject\Tests\LoginWithEmail.js" --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" />
<SummaryXmlFile path="%TestOutputDirectory%\<Enter summary file name here>" />
</GenericTest>