本文整理汇总了C#中Microsoft.Test.UIAutomation.TestManager.TestCaseAttribute类的典型用法代码示例。如果您正苦于以下问题:C# TestCaseAttribute类的具体用法?C# TestCaseAttribute怎么用?C# TestCaseAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestCaseAttribute类属于Microsoft.Test.UIAutomation.TestManager命名空间,在下文中一共展示了TestCaseAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NarratorScenario1
public void NarratorScenario1(TestCaseAttribute testCase)
{
HeaderComment(testCase);
// blah blah blah...
}
示例2: GetBoundingRect1
public void GetBoundingRect1(TestCaseAttribute testAttribute)
{
HeaderComment(testAttribute);
Rect rect;
Rect parentRect = m_le.Current.BoundingRectangle;
if (!m_le.Current.IsOffscreen)
{
if (parentRect.Width == 0)
ThrowMe(CheckType.Verification, "TitleBar Width cannot be zero");
if (parentRect.Height == 0)
ThrowMe(CheckType.Verification, "TitleBar Height cannot be zero");
}
foreach (AutomationElement child in m_le.FindAll(TreeScope.Subtree, Condition.TrueCondition))
{
rect = child.Current.BoundingRectangle;
if (rect.Width == 0)
ThrowMe(CheckType.Verification, "{0}'s Width cannot be zero", child.Current.Name);
if (rect.Height == 0)
ThrowMe(CheckType.Verification, "{0}'s Height cannot be zero", child.Current.Name);
if (Rect.Intersect(parentRect, rect) != rect)
ThrowMe(CheckType.Verification, "{0}'s BoundingRectangle is not within the parents BoundingRectangle", child.Current.Name);
}
m_TestStep++;
}
示例3: AutomationTest
/// <summary>
/// initializes new instance with the testPriority and testType
/// </summary>
public AutomationTest(AutomationTest originalTest, TestPriorities testPriority, TestTypes testType)
{
this.TestCaseAttribute = originalTest.TestCaseAttribute;
this.Method = originalTest.Method;
this._testPriority = testPriority;
this._testType = testType;
}
示例4: TestNode
public TestNode(XmlDocument document, int step, string message, string methodName, bool isClientSideProvider, TestCaseAttribute testCaseAttribute, string verificationMethod, string controlPath)
{
Document = document;
Step = step; MethodName = methodName; IsClientSideProvider = isClientSideProvider.ToString().Substring(0, 1).ToUpper();
Attribute = testCaseAttribute;
VerificationMethod = verificationMethod;
ControlPath = controlPath;
Message = message;
}
示例5: Layout1
public void Layout1(TestCaseAttribute testCaseAttribute)
{
HeaderComment(testCaseAttribute);
// "Precondition: This is a vertical scrollbar",
TSC_VerifyPropertyEqual(m_le.GetCurrentPropertyValue(AutomationElement.OrientationProperty), OrientationType.Vertical, AutomationElement.OrientationProperty, CheckType.IncorrectElementConfiguration);
// "If this is a non Right to Left layout, the bounding rectangle will be on the right side, if Right to Left, bounding rectangle will be on the left side of the parent control",
TS_VerifyLayout(m_le, CheckType.Verification);
}
示例6: StartTestInfo
/// <summary>
///
/// </summary>
/// <param name="xmlNodeObjectID">XmlNode that idetifies the object to test. This can be as simple as the name of the control, to a node that represents the path</param>
/// <param name="testCaseAttribute"></param>
/// <param name="methodInfo">MethodInfo of the method of the test</param>
public StartTestInfo(XmlNode xmlNodeObjectID, TestCaseAttribute testCaseAttribute, MethodInfo methodInfo)
{
this.XmlNodeObjectID = xmlNodeObjectID;
this.TestAttribute = testCaseAttribute;
this.MethodInfo = methodInfo;
StringBuilder possibleIssuesMessageBuilder = new StringBuilder();
this.PossibleIssuesMessage = possibleIssuesMessageBuilder.ToString();
}
示例7: StaticsDontHaveLabels
public void StaticsDontHaveLabels(TestCaseAttribute testCaseAttribute)
{
HeaderComment(testCaseAttribute);
//"Precondition: Classname is 'Static'",
TSC_VerifyPropertyEqual(m_le.Current.ClassName.ToLower(), "static", AutomationElement.ClassNameProperty, CheckType.IncorrectElementConfiguration);
//"Verify: LabeledBy == null",
TSC_VerifyPropertyEqual(m_le.Current.LabeledBy, null, AutomationElement.LabeledByProperty, CheckType.Verification);
}
示例8: AccessOneCharacter
public void AccessOneCharacter(TestCaseAttribute testCaseAttribute)
{
HeaderComment(testCaseAttribute);
//"Precondition: There is an access key character",
TSC_VerifyProperty(m_le.Current.AccessKey.Length, 0, false, AutomationElement.AcceleratorKeyProperty, CheckType.IncorrectElementConfiguration);
//"Verify: AccessKey length must be one character in length",
TSC_VerifyProperty(m_le.Current.AccessKey.Length, 1, true, AutomationElement.AcceleratorKeyProperty, CheckType.Verification);
}
示例9: IsTextPatternAvailableProperty1
public void IsTextPatternAvailableProperty1(TestCaseAttribute testCaseAttribute)
{
HeaderComment(testCaseAttribute);
// "Precondition: Element has a valid hwnd",
TSC_VerifyProperty(m_le.Current.NativeWindowHandle, 0, false, AutomationElement.NativeWindowHandleProperty, CheckType.IncorrectElementConfiguration);
// "Verification: HelpTextProeprty != null",
TSC_VerifyProperty(m_le.Current.FrameworkId, "Win32", true, AutomationElement.FrameworkIdProperty, CheckType.IncorrectElementConfiguration);
// "Verification: HelpTextProeprty != \"\"",
TSC_VerifyPropertyEqual((bool)m_le.GetCurrentPropertyValue(AutomationElement.IsTextPatternAvailableProperty), false, AutomationElement.IsTextPatternAvailableProperty, CheckType.Verification);
}
示例10: MsaaScenario1
public void MsaaScenario1(TestCaseAttribute testCase)
{
HeaderComment(testCase);
_errorList = new ArrayList();
GetProperties(m_le, true, false, "1");
if (_errorList.Count != 0)
{
string error = "";
foreach (string s in _errorList)
error += s + "\n";
ThrowMe(CheckType.Verification, error);
}
}
示例11: TestGridItemContainingGridPropertyS11
public void TestGridItemContainingGridPropertyS11(TestCaseAttribute checkType)
{
HeaderComment(checkType);
AutomationElement grid1 = null;
AutomationElement grid2 = null;
//"Step: Traverse up the tree to find a AutomationElement that supports GridPattern",
TS_GetContainGridByNavigation(m_le, out grid1, CheckType.Verification);
//"Step: Get the ContainingGrid property",
TS_GetContainGridByCall(out grid2, CheckType.Verification);
//"Step: Verify that the two AutomationElements are the same"
TS_AreTheseTheSame(grid1, grid2, true, CheckType.Verification);
}
示例12: TestMenuStructureAndNames
public void TestMenuStructureAndNames(TestCaseAttribute testCase, object[] arguments)
{
XmlDocument doc = new XmlDocument();
if (arguments == null)
throw new ArgumentException();
string xml = (string)arguments[0];
//"Step: Load the argument into an XmlDocument",
TS_LoadMenuDefinition(xml, ref doc, CheckType.Verification);
//"Verify: That the menu tree matches the XmlDocument tree structure by name"
TestMenu menuBar = _appCommands.GetIWUIMenuCommands().GetMenuBar().GetFirstSubMenu();
TS_VerifyXmlToTree(doc.DocumentElement.FirstChild, menuBar);
}
示例13: XmlTestInfo
private XmlTestInfo(
TestCaseAttribute testCaseAttribute,
MethodInfo methodInfo,
XmlNode xmlElementPathNode)
{
this.Name = testCaseAttribute.TestName;
this.Summary = testCaseAttribute.TestSummary;
this.Priority = testCaseAttribute.Priority.ToString();
this.Status = testCaseAttribute.Status.ToString();
this.Author = testCaseAttribute.Author;
this.TestCaseType = testCaseAttribute.TestCaseType.ToString();
this.Description = testCaseAttribute.Description;
if (methodInfo != null)
{
this.MethodInfo.AssemblyFile = methodInfo.DeclaringType.Assembly.FullName;
this.MethodInfo.Class = methodInfo.DeclaringType.FullName;
this.MethodInfo.Method = methodInfo.Name;
}
this.ElementInfo = new XmlTestElementInfo(xmlElementPathNode);
}
示例14: TstToolTipClosedEvent1
public void TstToolTipClosedEvent1(TestCaseAttribute testCase)
{
HeaderComment(testCase);
AutomationElement tooltip = null;
Exception errorThrown = null;
try
{
// "Step: Move mouse
ATGTestInput.Input.MoveTo(new Point(500, 500)); m_TestStep++;
// "Step: Get the Start menu button",
TS_GetStartMenuButton(ref m_le, CheckType.Verification);
// Precondition: Verify that the start menu is visible",
TSC_VerifyPropertyEqual(m_le.Current.IsOffscreen, false, AutomationElement.IsOffscreenProperty, CheckType.IncorrectElementConfiguration);
// "Step: Add WindowOpenedEvent listener for application",
TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.ToolTipOpenedEvent, TreeScope.Subtree, CheckType.Verification);
// "Step: Add ToolTipClosedEvent listener for application",
TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.ToolTipClosedEvent, TreeScope.Element | TreeScope.Subtree, CheckType.Verification);
Thread.Sleep(1000);
// "Step: Move the mouse to the middle of the Start menu button so that an AutomationElement.ToolTipOpenedEvent is fired",
TS_MoveTo(m_le, CheckType.Verification);
// "Step: Find the corrent tooltip",
// Sometimes the tooltip won't come up so if this happens, just bail for now and catch it the next time we run
TS_ToolTipCurrentlyOpened(TreeWalker.ControlViewWalker.GetParent(m_le), ref m_le, CheckType.IncorrectElementConfiguration);
// "Step: Move mouse to the 256,0, so that ToolTipClosedEvent can be fired.
ATGTestInput.Input.MoveTo(new Point(256, 256)); m_TestStep++;
// "Step: Wait for one event to occur
//waiting for 5 seconds here because that's how long it takes for tooltipevents to propagate.
TSC_WaitForEvents(5);
// "Verify: That the ToolTipOpenedEvent is fired for the application"
TSC_VerifyEventListener(m_le, AutomationElement.ToolTipOpenedEvent, EventFired.True, CheckType.Verification);
// "Verify: That the ToolTipClosedEvent is fired for the application"
TSC_VerifyEventListener(tooltip, AutomationElement.ToolTipClosedEvent, EventFired.True, CheckType.Verification);
}
catch (Exception error)
{
errorThrown = error;
}
finally
{
// Precondition: Remove all listeners
TS_RemoveAllListeners(CheckType.Verification);
if (errorThrown != null)
{
throw errorThrown;
}
}
}
示例15: TstMenuClosedEvent1
public void TstMenuClosedEvent1(TestCaseAttribute testCase, object[] arguments)
{
//TODO: this case passes, but it crashes the application, looks like there is a UIA bug, that when
//it's monitoring the MenuClosedEvent, it crashes when an event takes place.
//bug filed: 1286276
Library.ValidateArgumentNonNull(testCase, "testCase");
Library.ValidateArgumentNonNull(arguments, "arguments");
Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");
string appPath = (string)arguments[0];
Exception cachedException = null;
AutomationElement menu = null;
HeaderComment(testCase);
// "Step: Start the application",
TS_OpenWindow(appPath, null, CheckType.Verification);
try
{
// "Step: Add WindowOpenedEvent listener for application",
TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.MenuClosedEvent, TreeScope.Element, CheckType.Verification);
// "Step: Get the menu",
TS_GetMenu(MENU_FILE, m_le, out menu, CheckType.Verification);
// "Step: Expand the menu",
TS_ExpandMenu(menu, CheckType.Verification);
// "Step: Collapse the menu",
TS_CollapseMenu(menu, CheckType.Verification);
// "Step: Wait for one event to occur
TSC_WaitForEvents(1);
// "Verify: WindowOpenedEvent is fired",
TSC_VerifyEventListener(null, AutomationElement.MenuClosedEvent, EventFired.True, CheckType.Verification);
}
catch (Exception error)
{
cachedException = error;
}
finally
{
// "Cleanup: Close the application",
if (m_le != null)
TS_CloseWindow(m_le, CheckType.Verification);
if (cachedException != null)
throw cachedException;
}
}