diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs b/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs index cf5866d582c30697faaf7afbc2cc6b09f0969f7e..ddc09d9e2b1550e00f2a59468c091499aed6699e 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs @@ -435,5 +435,42 @@ public void PressDialogButton(string dialogAutomationName, string buttonAutomati var buttonAutomationElement = dialogAutomationElement.FindDescendantByAutomationId(buttonAutomationName); buttonAutomationElement.Invoke(); } + + public void PressDialogButtonWithName(string dialogAutomationName, string buttonName) + { + var dialogAutomationElement = DialogHelpers.GetOpenDialog(GetDTE().MainWindow.HWnd, dialogAutomationName); + + var buttonAutomationElement = dialogAutomationElement.FindDescendantByName(buttonName); + buttonAutomationElement.Invoke(); + } + + public void DialogSelectComboBoxItem(string dialogAutomationName, string comboBoxAutomationName, string itemText) + { + var dialogAutomationElement = DialogHelpers.GetOpenDialog(GetDTE().MainWindow.HWnd, dialogAutomationName); + + var comboBoxAutomationElement = dialogAutomationElement.FindDescendantByAutomationId(comboBoxAutomationName); + comboBoxAutomationElement.Expand(); + + var comboBoxItemAutomationElement = comboBoxAutomationElement.FindDescendantByName(itemText); + comboBoxItemAutomationElement.Select(); + + comboBoxAutomationElement.Collapse(); + } + + public void DialogSelectRadioButton(string dialogAutomationName, string radioButtonAutomationName) + { + var dialogAutomationElement = DialogHelpers.GetOpenDialog(GetDTE().MainWindow.HWnd, dialogAutomationName); + + var radioButton = dialogAutomationElement.FindDescendantByAutomationId(radioButtonAutomationName); + radioButton.Select(); + } + + public void DialogSetElementValue(string dialogAutomationName, string elementAutomationName, string value) + { + var dialogAutomationElement = DialogHelpers.GetOpenDialog(GetDTE().MainWindow.HWnd, dialogAutomationName); + + var control = dialogAutomationElement.FindDescendantByAutomationId(elementAutomationName); + control.SetValue(value); + } } } diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs index 2ebdf39772c44f06be1eece1c5f41991a3dd1ba7..5635f73a694a0c87511fe2e656a0abd2990e0e93 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.VisualStudio.IntegrationTest.Utilities.Common; using Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess; @@ -73,6 +74,8 @@ public Signature GetCurrentSignature() return _inProc.GetCurrentSignature(); } + + public void ShowLightBulb() => _inProc.ShowLightBulb(); @@ -114,7 +117,19 @@ public void VerifyDialog(string dialogName, bool isOpen) public void PressDialogButton(string dialogAutomationName, string buttonAutomationName) => _inProc.PressDialogButton(dialogAutomationName, buttonAutomationName); + public void PressDialogButtonWithName(string dialogAutomationName, string buttonName) + => _inProc.PressDialogButtonWithName(dialogAutomationName, buttonName); + public void DialogSendKeys(string dialogAutomationName, string keys) => _inProc.DialogSendKeys(dialogAutomationName, keys); + + public void DialogSelectComboBoxItem(string dialogAutomationName, string comboBoxAutomationName, string itemText) + => _inProc.DialogSelectComboBoxItem(dialogAutomationName, comboBoxAutomationName, itemText); + + public void DialogSelectRadioButton(string dialogAutomationName, string radioButtonAutomationName) + => _inProc.DialogSelectRadioButton(dialogAutomationName, radioButtonAutomationName); + + public void DialogSetElementValue(string dialogAutomationName, string elementAutomationName, string value) + => _inProc.DialogSetElementValue(dialogAutomationName, elementAutomationName, value); } } \ No newline at end of file