Skip to content

[Testing] Feature matrix UITest Cases for WebView Control #30517

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

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

Conversation

NafeelaNazhir
Copy link
Contributor

@NafeelaNazhir NafeelaNazhir commented Jul 9, 2025

This PR includes a comprehensive set of UI test cases for the WebView control. The tests validate the WebView control, including properties such as Source, CanGoBack, CanGoForward, events such as Navigating and Navigated Events, methods like GoBack, GoForward, EvaluateJavaScriptAsync and Reload.

WebView Feature Matrix :

  • WebView Control Testing:

    • Added bindings for properties like Source, Cookies, and IsVisible, along with event handlers for Navigating, Navigated, and ProcessTerminated events. [1] [2]
  • Navigation and Content Testing:

    • Implemented buttons and JavaScript to test navigation between pages, dynamic content updates, and JavaScript evaluation.
  • Cookie Management:

    • Added functionality to add and clear cookies to test WebView's cookie handling capabilities.

Issues Identified

Screen.Recording.2025-07-10.at.9.47.32.AM.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jul 9, 2025
@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests area-controls-webview WebView labels Jul 9, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review July 10, 2025 11:32
@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 11:32
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner July 10, 2025 11:32
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.

Pull Request Overview

This PR introduces a comprehensive suite of UI tests and supporting pages for the WebView control’s feature matrix, covering properties, navigation, events, JavaScript evaluation, cookie management, visibility, shadow, and reload functionality.

  • Adds extensive NUnit/Appium tests in WebViewFeatureTests.cs to validate WebView APIs and events.
  • Implements WebViewViewModel, control page, and options page in the HostApp to drive and display WebView scenarios.
  • Registers the new WebView gallery page in the core gallery view.

Reviewed Changes

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

Show a summary per file
File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs New UI tests for WebView properties, navigation, events, JS, cookies, reload, visibility, and shadow.
src/Controls/tests/TestCases.HostApp/FeatureMatrix/WebView/WebViewViewModel.cs ViewModel that manages WebView state, commands, events, and cookie logic for tests.
src/Controls/tests/TestCases.HostApp/FeatureMatrix/WebView/WebViewOptionsPage.xaml(.cs) Options page UX for selecting sources, cookie ops, visibility, and shadow settings.
src/Controls/tests/TestCases.HostApp/FeatureMatrix/WebView/WebViewControlPage.xaml(.cs) Main control page displaying WebView and status labels with data bindings and event hooks.
src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs Added registration of “WebView Feature Matrix” in the gallery.
Comments suppressed due to low confidence (2)

src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs:14

  • The constant name and AutomationId use "Github"; the correct brand casing is "GitHub" for consistency.
	public const string GithubUrlButton = "GithubUrlButton";

src/Controls/tests/TestCases.HostApp/FeatureMatrix/WebView/WebViewControlPage.xaml:129

  • A UI element is exposed for the ProcessTerminated event, but there’s no corresponding UITest in WebViewFeatureTests.cs to verify process termination behavior.
               AutomationId="ProcessTerminatedStatusLabel"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-webview WebView area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants