我是UI编码测试的新手,请多多包涵。
我有此测试,它在Visual Studio中运行良好:
namespace FOGAutomationTests.Tests.IntegrationTests
{
[TestClass]
public class TestEstablishmentFromCubito : BaseTest
{
#region Test setup and teardown
[ClassInitialize]
public static new void ClassInitialize(TestContext context)
{
BaseTest.ClassInitialize(context);
}
[ClassCleanup]
public static new void ClassCleanup()
{
BaseTest.ClassCleanup();
}
#endregion
#region Tests
[
DataSource(
"Microsoft.VisualStudio.TestTools.DataSource.CSV",
"|DataDirectory|\\TestData\\TestCubitoCycle.csv",
"TestCubitoCycle#csv",
DataAccessMethod.Sequential),
DeploymentItem("TestData\\TestCubitoCycle.csv"),
TestMethod
]
public void TestCubitoCycle()
{
#region Arrange
string cubitoEstablishmentName = GetColumnData(EstablishmentFilter.EstablishmentName.ToString());
string cubitoSearchParam = GetColumnData("CubitoSearchParam");
#endregion
#region Act
MenuWindow menuWindow = loginWindow.LogInWithCorrectCredentials();
menuWindow.ClickDialogButton("OK");
var window = menuWindow
.ViewCubitoAccounts()
.QuickSearch(cubitoSearchParam)
.SelectEstablishment(rowNumber: 1)
.CreateEstablishmentFromCubito()
.GoBackToMenu();
#endregion
#region Assert
WindowManager.FocusTopWindow();
Assert.IsTrue(window.HasDialogWithText("El registro fue guardado exitosamente.", "Información"));
#endregion
}
#endregion
}
}
然后,我试图使用Visual Studio Agent MSTest.exe(如显示的here)运行测试。这是我在CMD中的命令:
C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE>MsTest.exe /testcontainer:C:\Users\SamuelJOteroCobian\source\repos\FOG\FOGAutomationTests\bin\Debug\FOGAutomationTests.dll /resultsfile:C:\result.trx
但是,当我执行该命令时,它会以消息“没有要执行的测试”来响应我。我很确定我的路径是正确的并且正在执行正确的DLL
任何帮助将不胜感激。
谢谢!