Skip to content

Commit

Permalink
Merge pull request #1345 from chingucoding/dev/decrease-textbox-test-…
Browse files Browse the repository at this point in the history
…flakyness

Update TextBox UI test to type less text to decrease flakyness
  • Loading branch information
karkarl committed Aug 30, 2023
2 parents 90f0882 + 41c1992 commit 1810ed0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions UITests/Tests/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,26 @@ public void SendKeys()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("abcde12345!@#$%");
Assert.AreEqual("abcde12345!@#$%", textBoxElement1.Text);
textBoxElement1.SendKeys("abc");
Assert.AreEqual("abc", textBoxElement1.Text);

// Use Ctrl + A to select all text and backspace to clear the box
textBoxElement1.SendKeys(Keys.Control + "a" + Keys.Control + Keys.Backspace);
Assert.AreEqual(string.Empty, textBoxElement1.Text);

textBoxElement2.Clear();
Assert.AreEqual(string.Empty, textBoxElement2.Text);
textBoxElement2.SendKeys("fghij67890^&*()");
Assert.AreEqual("fghij67890^&*()", textBoxElement2.Text);
textBoxElement2.SendKeys("efg");
Assert.AreEqual("efg", textBoxElement2.Text);
}

[TestMethod]
public void Text()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("abcde12345!@#$%");
Assert.AreEqual("abcde12345!@#$%", textBoxElement1.Text);
textBoxElement1.SendKeys("abc");
Assert.AreEqual("abc", textBoxElement1.Text);
}
}
}

0 comments on commit 1810ed0

Please sign in to comment.