Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UITest Cases for Hosts Module and Improve UITestAutomation #37546

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jamrobot
Copy link
Contributor

@jamrobot jamrobot commented Feb 20, 2025

Add UITest cases for Hosts module, and Improve UITestAutomation framework by adding more features, fixing bugs.

Please take a look screen-recording here for reference:
https://github.com/user-attachments/assets/49b5b611-3dc7-43fd-ae6a-185ea8bc7e9b

PR Checklist

Detailed Description of the Pull Request / Additional comments

Changes including:

Add UITests for Hosts module

a. Add test for Adding-entry function
b. Add test for Empty-View

Update UITestAutomation Framework

a. Add Pre/Post timeout for Click action.
b. Add TextBox control which allow get/set Text
c. Add more properties in Element Control.
d. Remove unnecessary Assert in FindAll
e. Add Shortcut (Find/FindAll) in TestBase to keep test-code shorter.
f. Move FindHelper to root folder of UIAutomation project.
g. Add ToggleSwitch control

Update PowerToys solution file to address inconsistent naming convention

Validation Steps Performed

a. Adding Entry
b. Empty View

- Update UITest Framework, including:
a. Add Pre/Post timeout for Click action.
b. Add TextBox control which allow get/set Text
c.  Add more properties in Element Control.
d. Remove unnecessary Assert in FindAll
e. Add Shortcut (Find/FindAll) in TestBase to keep test-code shorter.
f. Move FindHelper to root folder of UIAutomation project.
g. Add ToggleSwitch control

- Update PowerToys solution file to address inconsistent naming convention
@jamrobot jamrobot self-assigned this Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • PowerToys.sln: Language not supported
  • src/common/UITestAutomation/UITestAutomation.csproj: Language not supported
  • src/modules/Hosts/Hosts.UITests/Hosts.UITests.csproj: Language not supported
  • src/common/UITestAutomation/Element/Window.cs: Evaluated as low risk
  • src/common/UITestAutomation/UITestBase.cs: Evaluated as low risk
  • src/common/UITestAutomation/Session.cs: Evaluated as low risk
  • src/common/UITestAutomation/FindHelper.cs: Evaluated as low risk

This comment has been minimized.

{
if (clearText)
{
PerformAction((actions, window) =>
Copy link
Contributor

@urnotdfs urnotdfs Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current PerformAction method may not be suitable for SetText because it is designed for click actions and only calls MoveToElement. For TextBox, to simulate manual operation, it should move the mouse to the element and then click it. There are may two possible ways:

  1. Call the click function, and then directly call sendKeys.
  2. Create a new PerformAction method specifically for SetText

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have preTimeout, Operations & postTimeout pattern setup, which is something like PerformAction.

design it only for click is not idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it would also be better to rename the 'window' here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants