Skip to content

Skip HybridWebView interception test on iOS/MacCatalyst#33981

Merged
rmarinho merged 3 commits intomainfrom
copilot/skip-test-on-ios-mac-catalyst
Feb 11, 2026
Merged

Skip HybridWebView interception test on iOS/MacCatalyst#33981
rmarinho merged 3 commits intomainfrom
copilot/skip-test-on-ios-mac-catalyst

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 10, 2026

Skip HybridWebView Test on iOS/MacCatalyst

Changes Completed:

Summary:

The test RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts with the app://echoservice/ test case is now skipped on iOS and MacCatalyst platforms. The test was unreliable on these platforms due to external service dependency and references issue #33927 for tracking.

Files Modified:

  • src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Interception.cs

After (final):

#if !ANDROID
#if !WINDOWS
#if IOS || MACCATALYST
	[Theory(Skip = "Flaky due to external service dependency (echo.free.beeceptor.com). See https://github.com/dotnet/maui/issues/33927")]
#else
	[Theory]
#endif
	[InlineData("app://echoservice/", "RequestsWithCustomSchemeCanBeIntercepted")]
#endif
#endif

Note: The BlazorWebView test with the same name already has a Skip attribute and was not modified as per the requirements.

Original prompt

Problem

The RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts test needs to be skipped/ignored on iOS and Mac Catalyst platforms. The test is unreliable on these platforms and needs further analysis before being re-enabled.

The test exists in two files:

1. BlazorWebView test (src/BlazorWebView/tests/DeviceTests/Elements/BlazorWebViewTests.RequestInterception.cs)

This test already has Skip = "Flaky due to external service dependency (echo.free.beeceptor.com). See https://github.com/dotnet/maui/issues/33927" on the [Theory] attribute (line 157). This one is already being skipped entirely. No changes needed here.

2. HybridWebView test (src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Interception.cs)

This is the file that needs changes. Currently at lines 146-156, the test has:

#if !ANDROID // Custom schemes are not supported on Android
#if !WINDOWS // TODO: There seems to be a bug with the implementation in the WASDK version of WebView2
	[Theory]
	[InlineData("app://echoservice/", "RequestsWithCustomSchemeCanBeIntercepted")]
#endif
#endif
#if !IOS && !MACCATALYST // Cannot intercept https requests on iOS/MacCatalyst
	[Theory(Skip = "Failing on Helix https://github.com/dotnet/maui/issues/32400")]
	[InlineData("https://echo.free.beeceptor.com/", "RequestsCanBeIntercepted")]
#endif
	public Task RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts(string uriBase, string function) =>

The app://echoservice/ variant with [Theory] (no skip) still runs on iOS and Catalyst (since the #if !ANDROID and #if !WINDOWS preprocessor directives don't exclude iOS/Catalyst).

Required change: Add a Skip reason to the [Theory] attribute inside the #if !ANDROID / #if !WINDOWS block so that it becomes:

#if !ANDROID // Custom schemes are not supported on Android
#if !WINDOWS // TODO: There seems to be a bug with the implementation in the WASDK version of WebView2
#if IOS || MACCATALYST
	[Theory(Skip = "Ignored on iOS and Catalyst. See tracking issue.")]
#else
	[Theory]
#endif
	[InlineData("app://echoservice/", "RequestsWithCustomSchemeCanBeIntercepted")]
#endif
#endif

This ensures the app://echoservice/ test case is skipped on iOS and Catalyst while still running on other applicable platforms.

A tracking issue is being created to analyze and re-enable this test later.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

The `RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts` test with the `app://echoservice/` variant is now skipped on iOS and MacCatalyst platforms to avoid flakiness. The test is unreliable on these platforms and needs further analysis before being re-enabled.

The BlazorWebView test with the same name already has a Skip attribute and remains unchanged.

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Copilot AI changed the title [WIP] Skip interception test on iOS and Mac Catalyst Skip HybridWebView interception test on iOS/MacCatalyst Feb 10, 2026
Copilot AI requested a review from rmarinho February 10, 2026 14:26
@rmarinho
Copy link
Copy Markdown
Member

@copilot can you change to reference this issue here #33927

Changed the Skip attribute message to match the pattern used in other tests and reference the specific tracking issue for the flaky external service dependency.

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 10, 2026

@copilot can you change to reference this issue here #33927

Done in 873bbcb. Updated the Skip message to reference issue #33927.

@rmarinho rmarinho marked this pull request as ready for review February 11, 2026 11:34
Copilot AI review requested due to automatic review settings February 11, 2026 11:34
@rmarinho
Copy link
Copy Markdown
Member

/azp run maui-pr-devicetests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

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

Skips the RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts HybridWebView interception test case on iOS/MacCatalyst by conditionally applying an xUnit Skip reason, aligning behavior with an existing BlazorWebView skip for a related flaky scenario.

Changes:

  • Added #if IOS || MACCATALYST conditional compilation around the [Theory] attribute.
  • Applied an iOS/MacCatalyst-only xUnit skip reason referencing issue #33927.

Comment on lines +148 to 153
#if IOS || MACCATALYST
[Theory(Skip = "Flaky due to external service dependency (echo.free.beeceptor.com). See https://github.com/dotnet/maui/issues/33927")]
#else
[Theory]
#endif
[InlineData("app://echoservice/", "RequestsWithCustomSchemeCanBeIntercepted")]
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The skip reason mentions an external dependency on echo.free.beeceptor.com, but this theory data is for app://echoservice/ (custom scheme). This makes the skip message potentially misleading when diagnosing failures. Consider updating the skip text to describe the actual reason this custom-scheme case is skipped on iOS/MacCatalyst (or use more generic wording like 'Flaky on iOS/MacCatalyst; tracked by ...' if the root cause is still under investigation).

Copilot uses AI. Check for mistakes.
@rmarinho rmarinho merged commit 9f83679 into main Feb 11, 2026
29 of 43 checks passed
@rmarinho rmarinho deleted the copilot/skip-test-on-ios-mac-catalyst branch February 11, 2026 12:41
TamilarasanSF4853 pushed a commit to TamilarasanSF4853/maui that referenced this pull request Mar 2, 2026
## Skip HybridWebView Test on iOS/MacCatalyst

**Changes Completed:**
- [x] Modified
`src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Interception.cs`
at lines 146-154
- [x] Added conditional Skip attribute for iOS and MacCatalyst platforms
- [x] Updated Skip message to reference issue dotnet#33927
- [x] Verified the changes are correctly formatted

**Summary:**

The test `RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts` with
the `app://echoservice/` test case is now skipped on iOS and MacCatalyst
platforms. The test was unreliable on these platforms due to external
service dependency and references issue dotnet#33927 for tracking.

**Files Modified:**
-
`src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Interception.cs`

**After (final):**
```csharp
#if !ANDROID
#if !WINDOWS
#if IOS || MACCATALYST
	[Theory(Skip = "Flaky due to external service dependency (echo.free.beeceptor.com). See dotnet#33927")]
#else
	[Theory]
#endif
	[InlineData("app://echoservice/", "RequestsWithCustomSchemeCanBeIntercepted")]
#endif
#endif
```

**Note:** The BlazorWebView test with the same name already has a Skip
attribute and was not modified as per the requirements.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> ## Problem
> 
> The `RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts` test
needs to be skipped/ignored on iOS and Mac Catalyst platforms. The test
is unreliable on these platforms and needs further analysis before being
re-enabled.
> 
> The test exists in two files:
> 
> ### 1. BlazorWebView test
(`src/BlazorWebView/tests/DeviceTests/Elements/BlazorWebViewTests.RequestInterception.cs`)
> 
> This test already has `Skip = "Flaky due to external service
dependency (echo.free.beeceptor.com). See
https://github.com/dotnet/maui/issues/33927"` on the `[Theory]`
attribute (line 157). This one is already being skipped entirely. **No
changes needed here.**
> 
> ### 2. HybridWebView test
(`src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Interception.cs`)
> 
> This is the file that needs changes. Currently at lines 146-156, the
test has:
> 
> ```csharp
> #if !ANDROID // Custom schemes are not supported on Android
> #if !WINDOWS // TODO: There seems to be a bug with the implementation
in the WASDK version of WebView2
> 	[Theory]
> [InlineData("app://echoservice/",
"RequestsWithCustomSchemeCanBeIntercepted")]
> #endif
> #endif
> #if !IOS && !MACCATALYST // Cannot intercept https requests on
iOS/MacCatalyst
> [Theory(Skip = "Failing on Helix
dotnet#32400")]
> [InlineData("https://echo.free.beeceptor.com/",
"RequestsCanBeIntercepted")]
> #endif
> public Task
RequestsCanBeInterceptedAndHeadersAddedForDifferentHosts(string uriBase,
string function) =>
> ```
> 
> The `app://echoservice/` variant with `[Theory]` (no skip) still runs
on iOS and Catalyst (since the `#if !ANDROID` and `#if !WINDOWS`
preprocessor directives don't exclude iOS/Catalyst).
> 
> **Required change:** Add a Skip reason to the `[Theory]` attribute
inside the `#if !ANDROID` / `#if !WINDOWS` block so that it becomes:
> 
> ```csharp
> #if !ANDROID // Custom schemes are not supported on Android
> #if !WINDOWS // TODO: There seems to be a bug with the implementation
in the WASDK version of WebView2
> #if IOS || MACCATALYST
> 	[Theory(Skip = "Ignored on iOS and Catalyst. See tracking issue.")]
> #else
> 	[Theory]
> #endif
> [InlineData("app://echoservice/",
"RequestsWithCustomSchemeCanBeIntercepted")]
> #endif
> #endif
> ```
> 
> This ensures the `app://echoservice/` test case is skipped on iOS and
Catalyst while still running on other applicable platforms.
> 
> A tracking issue is being created to analyze and re-enable this test
later.


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants