/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/common/UITestAutomation/Element/Window.cs
85 строк
3 KB
Jerry Xu
[Hosts] Converting manual release-check-list tests to UI-Test Automation and Adding more UI-Test-cases (#37657)
28 фев 2025, 14:08
Не верифицирован
28 фев 2025, 14:08
22e29d1
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace Microsoft.PowerToys.UITest { /// <summary> /// Represents a window in the UI test environment. /// </summary> public class Window : Element { /// <summary> /// Maximizes the window. /// </summary> /// <param name="byClickButton">If true, clicks the Maximize button; otherwise, sets the window state.</param> /// <returns>The current Window instance.</returns> public Window Maximize(bool byClickButton = true) { if (byClickButton) { Find<Button>("Maximize").Click(); } else { // TODO: Implement maximizing the window using an alternative method } return this; } /// <summary> /// Restores the window. /// </summary> /// <param name="byClickButton">If true, clicks the Restore button; otherwise, sets the window state.</param> /// <returns>The current Window instance.</returns> public Window Restore(bool byClickButton = true) { if (byClickButton) { Find<Button>("Restore").Click(); } else { // TODO: Implement restoring the window using an alternative method } return this; } /// <summary> /// Minimizes the window. /// </summary> /// <param name="byClickButton">If true, clicks the Minimize button; otherwise, sets the window state.</param> /// <returns>The current Window instance.</returns> public Window Minimize(bool byClickButton = true) { if (byClickButton) { Find<Button>("Minimize").Click(); } else { // TODO: Implement minimizing the window using an alternative method } return this; } /// <summary> /// Closes the window. /// </summary> /// <param name="byClickButton">If true, clicks the Close button; otherwise, closes the window using an alternative method.</param> public void Close(bool byClickButton = true) { if (byClickButton) { Find<Button>("Close").Click(); } else { // TODO: Implement closing the window using an alternative method } } } }