public void CanChangeText() { var appElement = MountTestComponent <TextEditComponent>(); var txtElement = appElement.FindElement(By.TagName("input")); txtElement.SendKeys("abc"); WaitAssert.Contains("abc", () => txtElement.GetAttribute("value")); }
public void CanChangeText() { var paragraph = Browser.FindElement(By.Id("text-basic")); var text = paragraph.FindElement(By.TagName("input")); WaitAssert.Equal(string.Empty, () => text.GetAttribute("value")); text.SendKeys("abc"); WaitAssert.Contains("abc", () => text.GetAttribute("value")); }
public void ThrowsIfRenderIsRequestedOutsideSyncContext() { var appElement = MountTestComponent <DispatchingComponent>(); var result = appElement.FindElement(By.Id("result")); appElement.FindElement(By.Id("run-without-dispatch")).Click(); WaitAssert.Contains( $"{typeof(InvalidOperationException).FullName}: The current thread is not associated with the renderer's synchronization context", () => result.Text); }
public void CanShowAndHideDropdownComponent() { var appElement = MountTestComponent <DropdownComponent>(); var drpElement = appElement.FindElement(By.ClassName("dropdown")); var btnElement = drpElement.FindElement(By.TagName("button")); var mnuElement = drpElement.FindElement(By.ClassName("dropdown-menu")); btnElement.Click(); WaitAssert.Contains("show", () => drpElement.GetAttribute("class")); WaitAssert.Contains("show", () => mnuElement.GetAttribute("class")); btnElement.Click(); WaitAssert.NotContains("show", () => drpElement.GetAttribute("class")); WaitAssert.NotContains("show", () => mnuElement.GetAttribute("class")); }
public void MouseMove_CanTrigger() { MountTestComponent <MouseEventComponent>(); var input = Browser.FindElement(By.Id("mousemove_input")); var output = Browser.FindElement(By.Id("output")); Assert.Equal(string.Empty, output.Text); // Move a little bit var actions = new Actions(Browser) .MoveToElement(input) .MoveToElement(input, 10, 10); actions.Perform(); WaitAssert.Contains("onmousemove,", () => output.Text); }