Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions UITests/Tests/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public void Clear()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("fghij");
Assert.AreEqual("fghij", textBoxElement1.Text);
textBoxElement1.SendKeys("F");
Assert.AreEqual("F", textBoxElement1.Text);
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
}
Expand All @@ -57,16 +57,16 @@ public void Click()
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.Click();
Thread.Sleep(1_000);
TypeText("1234567890");
Assert.AreEqual("1234567890", textBoxElement1.Text);
TypeText("1");
Assert.AreEqual("1", textBoxElement1.Text);

// Click textBoxElement2 to set focus and arbitrarily type
textBoxElement2.Clear();
Assert.AreEqual(string.Empty, textBoxElement2.Text);
textBoxElement2.Click();
Thread.Sleep(1_000);
TypeText("1234567890");
Assert.AreEqual("1234567890", textBoxElement2.Text);
TypeText("1");
Assert.AreEqual("1", textBoxElement2.Text);
}

[TestMethod]
Expand Down Expand Up @@ -109,25 +109,25 @@ public void SendKeys()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("abc");
Assert.AreEqual("abc", textBoxElement1.Text);
textBoxElement1.SendKeys("A");
Assert.AreEqual("A", 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("efg");
Assert.AreEqual("efg", textBoxElement2.Text);
textBoxElement2.SendKeys("E");
Assert.AreEqual("E", textBoxElement2.Text);
}

[TestMethod]
public void Text()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("abc");
Assert.AreEqual("abc", textBoxElement1.Text);
textBoxElement1.SendKeys("A");
Assert.AreEqual("A", textBoxElement1.Text);
}
}