Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
karkarl committed Oct 5, 2021
1 parent f8a8734 commit 8c0dcda
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions dev/Expander/InteractionTests/ExpanderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,30 @@ public void ExpandCollapseAutomationTests()
Verify.AreEqual(expander.ExpandCollapseState, ExpandCollapseState.Expanded);
}
}

[TestMethod]
public void AutomationPeerTest()
{
using (var setup = new TestSetupHelper("Expander Tests"))
{
Expander expander = FindElement.ByName<Expander>("ExpandedExpander");
expander.SetFocus();
Wait.ForIdle();

// Verify ExpandedExpander header content AutomationProperties.Name properties are set
VerifyElement.Found("This expander is expanded by default.", FindBy.Name);
VerifyElement.Found("This is the second line of text.", FindBy.Name);

// Verify ExpandedExpander content AutomationProperties.Name property is set
VerifyElement.Found("Content", FindBy.Name);

Log.Comment("Collapse using keyboard space key.");
KeyboardHelper.PressKey(Key.Space);
Verify.AreEqual(expander.ExpandCollapseState, ExpandCollapseState.Collapsed);

// Verify ExpandedExpander content AutomationProperties.Name property is not visible once collapsed
VerifyElement.NotFound("Content", FindBy.Name);
}
}
}
}

0 comments on commit 8c0dcda

Please sign in to comment.