예제 #1
0
 /// <summary>
 /// Waits for dotvvm postback to be finished.
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="timeout">Timeout in ms.</param>
 public static void WaitForPostback(this IBrowserWrapper browser, int timeout = 20000)
 {
     if (browser.IsDotvvmPage())
     {
         browser.WaitFor(() =>
                         string.Equals("false", browser.GetJavaScriptExecutor().ExecuteScript("return dotvvm.isPostbackRunning()").ToString(), StringComparison.OrdinalIgnoreCase)
                         , timeout, "DotVVM postback still running.");
     }
 }
예제 #2
0
        private static void Feature_StaticCommand_ComboBoxSelectionChangedViewModel_Core(IBrowserWrapper browser)
        {
            browser.IsDotvvmPage();

            // select second value in the first combo box, the second one should select the second value too
            browser.ElementAt("select", 0).Select(1).Wait();
            browser.ElementAt("select", 1).Select(1).Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 1));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 1));

            // select third value in the first combo box, the second one should select the third value too
            browser.ElementAt("select", 0).Select(2).Wait();
            browser.ElementAt("select", 1).Select(2).Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 2));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 2));

            // select first value in the first combo box, the second one should select the first value too
            browser.ElementAt("select", 0).Select(0).Wait();
            browser.ElementAt("select", 1).Select(0).Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 0));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 0));

            // click the first button - the second value should be selected in the first select, the second select should not change
            browser.ElementAt("input", 0).Click().Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 1));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 0));

            // click the second button - the third value should be selected in the second select, the first select should not change
            browser.ElementAt("input", 1).Click().Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 1));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 2));

            // click the third button - the first value should be selected in the second select, the first select should not change
            browser.ElementAt("input", 2).Click().Wait();
            AssertUI.IsSelected(browser.ElementAt("select", 0).ElementAt("option", 1));
            AssertUI.IsSelected(browser.ElementAt("select", 1).ElementAt("option", 0));
        }