public void CanChangeText()
        {
            var appElement = MountTestComponent <TextEditComponent>();
            var txtElement = appElement.FindElement(By.TagName("input"));

            txtElement.SendKeys("abc");
            WaitAssert.Contains("abc", () => txtElement.GetAttribute("value"));
        }
Exemple #2
0
        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);
        }
Exemple #4
0
        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"));
        }
Exemple #5
0
        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);
        }