1

Я построил GenericTest, чтобы связать тест CasperJs с тестовым примером TFS.Visual Studio Enterprise GenericTest Test Запуск проблемы развертывания

<?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.1.b\bin\casperjs.exe" arguments="test &quot;testproject\Tests\LoginWithEmail.js&quot; --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" /> 
    <SummaryXmlFile path="%TestOutputDirectory%\&lt;Enter summary file name here&gt;" /> 
</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) ========== 

Любые идеи, почему?

ответ

0

Похоже, вы используете относительные пути в атрибуте DeploymentItems filename.
Тест-бегун, как представляется, использует C:\Windows\system32 в качестве рабочего каталога при поиске этих файлов (в соответствии с сообщением об ошибке).

Судя по атрибуту storage в узле GenericTest, эти файлы находятся в 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.1.b\bin\casperjs.exe" arguments="test &quot;testproject\Tests\LoginWithEmail.js&quot; --ignore-ssl-errors=true" maxDuration="0" workingDirectory="%TestOutputDirectory%" /> 
    <SummaryXmlFile path="%TestOutputDirectory%\&lt;Enter summary file name here&gt;" /> 
</GenericTest> 
Смежные вопросы