我组装了 UI 自动化测试(白色)。
我已经引入了一个类,其中包含要在此程序集中重用的所有 Autination Id:
public static class AutomationId
{
public static class Toolbar
{
public const string MyControl = "MyControlId";
}
}
现在我试图在我的测试类(同一个程序集)中使用它:
var control = mainWindow.Get<Button>(AutomationId.Toolbar.MyControl);
此代码可以在本地编译。但是在 TeamCity 上,我遇到了这样的错误:
The name 'AutomationId' does not exist in the current context