public static void AddAndSelectPrinter(this AutomationRunner testRunner, string make = "Airwolf 3D", string model = "HD") { testRunner.GetWidgetByName("WidescreenPanel", out SystemWindow systemWindow, 10); // make sure we wait for MC to be up and running testRunner.WaitforDraw(systemWindow); // Click 'Add Printer' if not on screen if (!testRunner.NameExists("Select Make", 0.2)) { if (!testRunner.NameExists("Create Printer", 0.2)) { // go to the start page testRunner.ClickByName("Hardware Tab"); testRunner.ClickByName("Create Printer"); } else { if (testRunner.NameExists("Print Button", .2)) { testRunner.ClickByName("Print Button"); } else { testRunner.ClickByName("Create Printer"); } } } testRunner.ClickByName("Select Make"); testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>()); testRunner.Type(make); testRunner.Type("{Enter}"); testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>()); testRunner.ClickByName("Select Model"); testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>()); testRunner.Type(model); testRunner.Type("{Enter}"); testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>()); // An unpredictable period of time will pass between Clicking Save, everything reloading and us returning to the caller. // Block until ReloadAll has completed then close and return to the caller, at which point hopefully everything is reloaded. testRunner.ClickByName("Next Button"); testRunner.WaitFor(() => testRunner.WidgetExists <SetupStepComPortOne>()); testRunner.ClickByName("Cancel Wizard Button"); testRunner.WaitFor(() => !testRunner.WidgetExists <SetupStepComPortOne>()); }
public static void AddAndSelectPrinter(this AutomationRunner testRunner, string make, string model) { SystemWindow systemWindow; testRunner.GetWidgetByName("Start Tab", out systemWindow, 10); // make sure we wait for MC to be up and running testRunner.WaitforDraw(systemWindow); // If SelectMake is not visible and the ConnectionWizard is, click Skip if (!testRunner.NameExists("Select Make", 0.1)) { if (!testRunner.NameExists("Create Printer", 0.1)) { // go to the start page testRunner.ClickByName("Start Tab"); } testRunner.ClickByName("Create Printer"); } testRunner.ClickByName("Select Make"); testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>()); testRunner.Type(make); testRunner.Type("{Enter}"); testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>()); testRunner.ClickByName("Select Model"); testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>()); testRunner.Type(model); testRunner.Type("{Enter}"); testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>()); // An unpredictable period of time will pass between Clicking Save, everything reloading and us returning to the caller. // Block until ReloadAll has completed then close and return to the caller, at which point hopefully everything is reloaded. testRunner.ClickByName("Save & Continue Button"); testRunner.WaitFor(() => testRunner.WidgetExists <SetupStepComPortOne>()); testRunner.ClickByName("Cancel Wizard Button"); testRunner.WaitFor(() => !testRunner.WidgetExists <SetupStepComPortOne>()); }