Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

works around issues with the webdriver spec #92

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 45 additions & 0 deletions src/FlaUI.WebDriver.UITests/ElementTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,51 @@ public void SendKeys_ShiftedCharacter_ShiftIsReleased()
Assert.That(element.Text, Is.EqualTo("!1Test TextBox"));
}

[Test]
public void SendKeys_Qwerty()
bmarroquin marked this conversation as resolved.
Show resolved Hide resolved
{
var driverOptions = FlaUIDriverOptions.TestApp();
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
var qwerty = "qwertyuiopasdfghjklzxcvbnm";
var qwertyS = "QWERTYUIOPASDFGHJKLZXCVBNM";
var all = qwerty + qwertyS;
element.Clear();
element.SendKeys(all);

Assert.That(element.Text, Is.EqualTo(all));
}

[Test]
public void SendKeys_NumberRow()
bmarroquin marked this conversation as resolved.
Show resolved Hide resolved
{
var driverOptions = FlaUIDriverOptions.TestApp();
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
var numberRow = "`1234567890-=";
var numberRowS = "~!@#$%^&*()_+";
var all = numberRow + numberRowS;
element.Clear();
element.SendKeys(all);

Assert.That(element.Text, Is.EqualTo(all));
}

[Test]
public void SendKeys_Others()
bmarroquin marked this conversation as resolved.
Show resolved Hide resolved
{
var driverOptions = FlaUIDriverOptions.TestApp();
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
var others = "[]\\;',./";
var othersS = "{}|:\"<>?";
var all = others + othersS;
element.Clear();
element.SendKeys(all);

Assert.That(element.Text, Is.EqualTo(all));
}

[Test]
public void SendKeys_DownArrow_IsSupported()
{
Expand Down
6 changes: 3 additions & 3 deletions src/FlaUI.WebDriver/Keys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal class Keys
{ '8', "Digit8" },
{ '9', "Digit9" },
{ '=', "Equal" },
{ '<', "IntlBackslash" },
//{ '<', "IntlBackslash" },
bmarroquin marked this conversation as resolved.
Show resolved Hide resolved
{ 'a', "KeyA" },
{ 'b', "KeyB" },
{ 'c', "KeyC" },
Expand Down Expand Up @@ -207,7 +207,7 @@ internal class Keys
{ '*', "Digit8" },
{ '(', "Digit9" },
{ '+', "Equal" },
{ '>', "IntlBackslash" },
//{ '>', "IntlBackslash" },
bmarroquin marked this conversation as resolved.
Show resolved Hide resolved
{ 'A', "KeyA" },
{ 'B', "KeyB" },
{ 'C', "KeyC" },
Expand Down Expand Up @@ -235,7 +235,7 @@ internal class Keys
{ 'Y', "KeyY" },
{ 'Z', "KeyZ" },
{ '_', "Minus" },
{ '.', "Period" },
{ '>', "Period" },
{ '"', "Quote" },
{ ':', "Semicolon" },
{ '?', "Slash" },
Expand Down
Loading