// TODO: Promote to extension method private static void WaitForLayerAndResume(AutomationRunner testRunner, PrinterConfig printer, int indexToWaitFor) { testRunner.WaitForName("Yes Button", 30); // Wait for layer testRunner.WaitFor(() => printer.Bed.ActiveLayerIndex + 1 == indexToWaitFor, 30, 500); Assert.AreEqual(indexToWaitFor, printer.Bed.ActiveLayerIndex + 1); testRunner.ClickByName("Yes Button"); testRunner.WaitForWidgetDisappear("Yes Button", 10); }
private static void WaitForLayerAndResume(AutomationRunner testRunner, int indexToWaitFor) { testRunner.WaitForName("No Button", 30); var printer = ApplicationController.Instance.ActivePrinter; // Wait for layer testRunner.WaitFor(() => printer.Bed.ActiveLayerIndex + 1 == indexToWaitFor, 30, 500); Assert.AreEqual(indexToWaitFor, printer.Bed.ActiveLayerIndex + 1); testRunner.ClickByName("No Button"); testRunner.WaitForWidgetDisappear("No Button", 10); }
/// <summary> /// Types the specified text into the dialog and sends {Enter} to complete the interaction /// </summary> /// <param name="testRunner">The TestRunner to interact with</param> /// <param name="textValue">The text to type</param> public static void CompleteDialog(this AutomationRunner testRunner, string textValue, double secondsToWait = 2) { // AutomationDialog requires no delay if (AggContext.FileDialogs is AutomationDialogProvider) { // Wait for text widget to have focus var widget = testRunner.GetWidgetByName("Automation Dialog TextEdit", out _, 5); testRunner.WaitFor(() => widget.ContainsFocus); } else { testRunner.Delay(secondsToWait); } testRunner.Type(textValue); testRunner.Type("{Enter}"); testRunner.WaitForWidgetDisappear("Automation Dialog TextEdit", 5); }