Skip to content

Commit

Permalink
fix(selenium-testing): speed up input's "clear" method (#3555)
Browse files Browse the repository at this point in the history
  • Loading branch information
kostarev-a authored Dec 9, 2024
1 parent 4eb03b4 commit 11227a0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/react-ui-testing/SeleniumTesting/Controls/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,8 @@ public void Clear()
x =>
{
var inputElement = x.FindElement(By.CssSelector("input"));
inputElement.SendKeys(Keys.End);
var length = inputElement.GetAttribute("value").Length;
while(length > 0)
{
inputElement.SendKeys(Keys.Backspace);
length--;
}
inputElement.SendKeys(Keys.Control + "a");
inputElement.SendKeys(Keys.Delete);
},
"Clear");
}
Expand All @@ -58,4 +53,4 @@ public void Clear()

public IProp<bool> IsDisabled => ReactProperty<bool>("disabled");
}
}
}

0 comments on commit 11227a0

Please sign in to comment.