Skip to content

Commit

Permalink
chore: Fix TextBox_DeleteButton to use inner content
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jul 10, 2024
1 parent 929073d commit 6f512af
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,28 @@ public void TextBox_DeleteButton()
Run("UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_DeleteButton_Automated");

var textBox1 = _app.Marked("textBox1");

// Select the inner content to avoid the browser tapping the header
// and incorrectly focus the inner input control but not the TextBox.
var textBoxInner1 = textBox1.Descendant("ScrollContentPresenter");
var textBox2 = _app.Marked("textBox2");
var textBoxInner2 = textBox2.Descendant("ScrollContentPresenter");

textBox1.FastTap();
textBox1.EnterText("hello 01");
textBoxInner1.FastTap();
textBoxInner1.EnterText("hello 01");

_app.WaitForText(textBox1, "hello 01");

textBox2.FastTap();
textBox2.EnterText("hello 02");
textBoxInner2.FastTap();
textBoxInner2.EnterText("hello 02");

_app.WaitForText(textBox2, "hello 02");

var textBox1Result = _app.Query(textBox1).First();
var textBox2Result = _app.Query(textBox2).First();

// Focus the first textbox
textBox1.FastTap();
// Focus the firs t textbox
textBoxInner1.FastTap();

var deleteButton1 = FindDeleteButton(textBox1Result);

Expand All @@ -159,7 +164,7 @@ public void TextBox_DeleteButton()
_app.WaitForText(textBox1, "");

// Focus the first textbox
textBox2.FastTap();
textBoxInner2.FastTap();

var deleteButton2 = FindDeleteButton(textBox2Result);

Expand Down

0 comments on commit 6f512af

Please sign in to comment.