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

[Hosts] Converting manual release-check-list tests to UI-Test Automation and Adding more UI-Test-cases #37657

Merged
merged 16 commits into from
Feb 28, 2025

Conversation

jamrobot
Copy link
Contributor

@jamrobot jamrobot commented Feb 27, 2025

Summary of the Pull Request

  • Adding more UI-Test cases for Hosts File Editor module
  • Adding Release-Test-Checklist-Migration-Progress.md to track manual-to-automation migration progress

PR Checklist

Detailed Description of the Pull Request / Additional comments

Converted manual validation-cases

  • Launch Host File Editor:
    • Verify the application exits if "Quit" is clicked on the initial warning. (HostsSettingTests.TestWarningDialog)
    • Launch Host File Editor again and click "Accept". The module should not close. (HostModuleTests.TestEmptyView)
    • Try to filter for lines and verify you can find them. (HostModuleTests.TestFilterControl)
  • Test the different settings and verify they are applied:
    • Show a warning at startup. (HostsSettingTests.TestWarningDialog)

UI-Tests:

  • Validating Empty-view is shown if no entries in the list.
  • Validating Empty-view is NOT shown if 1 or more entries in the list.
  • Validating Add-an-entry HyperlinkButton in Empty-view works correctly.
  • Validating Adding-entry Button works correctly.
  • Validating the Add button should be Disabled if more than 9 hosts in one entry.
  • Validating the Add button should be Enabled if less or equal 9 hosts in one entry.
  • Validating error message should be shown if not run as admin.
  • Validating Warning-Dialog will be shown if 'Show a warning at startup' toggle is On.
  • Validating Warning-Dialog will NOT be shown if 'Show a warning at startup' toggle is Off.
  • Validating click 'Quit' button in Warning-Dialog, the Hosts File Editor window would be closed.
  • Validating click 'Accept' button in Warning-Dialog, the Hosts File Editor window would NOT be closed.

Validation Steps Performed

All UI-Test cases passed

@jamrobot jamrobot marked this pull request as draft February 27, 2025 01:17
@jamrobot jamrobot changed the title Dev/nxu/add host save error UI test [Hosts] Converting manual release-check-list tests to UI-Test Automation and Adding more UI-Test-cases Feb 27, 2025
@jamrobot jamrobot marked this pull request as ready for review February 27, 2025 07:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR migrates manual tests for the Hosts File Editor module to UI-test automation and adds extra UI-test cases to cover various user interactions and error conditions. Key changes include:

  • Adding and updating UI-test cases in Hosts.UITests (e.g., Warning dialog, Empty view, and Validation for multiple hosts).
  • Creating a migration progress tracking markdown file.
  • Enhancing UITestAutomation components with updated element classes and improved find methods.

Reviewed Changes

File Description
src/common/UITestAutomation/SessionHelper.cs Updated session initialization and cleanup logic for UI tests.
src/modules/Hosts/Hosts.UITests/Release-Test-Checklist-Migration-Progress.md Added a migration tracking document for UI-tests conversion.
src/modules/Hosts/Hosts.UITests/HostsSettingTests.cs Introduced tests for warning dialog behavior and window state after user actions.
src/common/UITestAutomation/Element/* and Session.cs General updates and improvements to UI element wrappers and element lookup functions.
src/modules/Hosts/Hosts.UITests/HostModuleTests.cs Added new tests covering empty view, adding entries, and host-validation scenarios.

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

@jamrobot jamrobot requested a review from Copilot February 27, 2025 13:47

Choose a reason for hiding this comment

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

PR Overview

This pull request converts manual release check-list tests for the Hosts File Editor module into automated UI tests and adds additional UI test cases. It also includes updates in the UI test automation framework to support consistent element lookup and interaction.

  • Added UI tests in HostsSettingTests.cs and HostModuleTests.cs for various Hosts File Editor scenarios.
  • Introduced a migration progress tracking markdown file for the manual-to-automation conversion.
  • Updated common UI test automation elements (e.g., NavigationViewItem, Button, TextBox, Window) and session management.

Reviewed Changes

File Description
src/common/UITestAutomation/SessionHelper.cs New session helper for UI tests initialization and cleanup
src/modules/Hosts/Hosts.UITests/HostsSettingTests.cs Added tests for warning dialogs and window state validations
src/modules/Hosts/Hosts.UITests/Release-Test-Checklist-Migration-Progress.md Migration progress tracking for manual-to-automation conversion
src/common/UITestAutomation/Element/*.cs New and revised UI element implementations for consistent control type matching
src/modules/Hosts/Hosts.UITests/HostModuleTests.cs Added tests for empty view, adding entries, and multiple-host validation
src/common/UITestAutomation/Session.cs, Element.cs, FindHelper.cs, UITestBase.cs Refactors and improvements to support updated element lookup and actions

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

Comments suppressed due to low confidence (1)

src/modules/Hosts/Hosts.UITests/HostsSettingTests.cs:82

  • The assertion message contradicts the test scenario. Since the check verifies that the Hosts File Editor is not closed, the error message should be updated to "Hosts File Editor should NOT be closed".
Assert.IsFalse(this.IsHostsFileEditorClosed(), "Hosts File Editor should be closed");

This comment has been minimized.

@jamrobot jamrobot merged commit 22e29d1 into main Feb 28, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants