-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix Photino E2E tests #63498
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
Closed
Closed
Fix Photino E2E tests #63498
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
26eded3
Move the test logic to sample application to ensure `_framework` dir …
ilonatommy a862b73
Update src/Components/WebView/Samples/PhotinoPlatform/testassets/Phot…
ilonatommy 9bba32e
Fix copilot's suggestion.
ilonatommy 2a7544a
Make sure the Photino dll is in correct location.
ilonatommy 8edd42b
Improve logging.
ilonatommy 9cfa3be
Copy the wwwroot from E2E test project level.
ilonatommy 7a4f9f9
Extended logging in JS to track blazor startup.
ilonatommy 3897985
Avoid dobule clicks.
ilonatommy 0ae945b
Double the timeouts for webview start and div rendering.
ilonatommy e2427b8
Revert additional logging to see if webview will be able to start wit…
ilonatommy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/IExecutionMode.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
public interface IExecutionMode | ||
{ | ||
void Run(); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/LaunchSample.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Net.Http; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using Microsoft.AspNetCore.Components.WebView.Photino; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
public class LaunchSample : IExecutionMode | ||
{ | ||
public void Run() | ||
{ | ||
var serviceCollection = new ServiceCollection(); | ||
serviceCollection.AddBlazorWebView(); | ||
serviceCollection.AddSingleton<HttpClient>(); | ||
|
||
var mainWindow = new BlazorWindow( | ||
title: "Hello, world!", | ||
hostPage: "wwwroot/webviewhost.html", | ||
services: serviceCollection.BuildServiceProvider(), | ||
pathBase: "/subdir"); // The content in BasicTestApp assumes this | ||
|
||
AppDomain.CurrentDomain.UnhandledException += (sender, error) => | ||
{ | ||
Console.Write( | ||
"Fatal exception" + Environment.NewLine + | ||
error.ExceptionObject.ToString() + Environment.NewLine); | ||
}; | ||
|
||
mainWindow.RootComponents.Add<BasicTestApp.Index>("root"); | ||
mainWindow.RootComponents.RegisterForJavaScript<BasicTestApp.DynamicallyAddedRootComponent>("my-dynamic-root-component"); | ||
mainWindow.RootComponents.RegisterForJavaScript<BasicTestApp.JavaScriptRootComponentParameterTypes>( | ||
"component-with-many-parameters", | ||
javaScriptInitializer: "myJsRootComponentInitializers.testInitializer"); | ||
|
||
mainWindow.Run(); | ||
} | ||
} |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 15 additions & 28 deletions
43
src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Net.Http; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using Microsoft.AspNetCore.Components.WebView.Photino; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace PhotinoTestApp; | ||
|
||
class Program | ||
{ | ||
[STAThread] | ||
static void Main(string[] args) | ||
{ | ||
var serviceCollection = new ServiceCollection(); | ||
serviceCollection.AddBlazorWebView(); | ||
serviceCollection.AddSingleton<HttpClient>(); | ||
|
||
var mainWindow = new BlazorWindow( | ||
title: "Hello, world!", | ||
hostPage: "wwwroot/webviewhost.html", | ||
services: serviceCollection.BuildServiceProvider(), | ||
pathBase: "/subdir"); // The content in BasicTestApp assumes this | ||
|
||
AppDomain.CurrentDomain.UnhandledException += (sender, error) => | ||
if (args.Length < 1) | ||
{ | ||
Console.Write( | ||
"Fatal exception" + Environment.NewLine + | ||
error.ExceptionObject.ToString() + Environment.NewLine); | ||
}; | ||
|
||
mainWindow.RootComponents.Add<BasicTestApp.Index>("root"); | ||
mainWindow.RootComponents.RegisterForJavaScript<BasicTestApp.DynamicallyAddedRootComponent>("my-dynamic-root-component"); | ||
mainWindow.RootComponents.RegisterForJavaScript<BasicTestApp.JavaScriptRootComponentParameterTypes>( | ||
"component-with-many-parameters", | ||
javaScriptInitializer: "myJsRootComponentInitializers.testInitializer"); | ||
|
||
mainWindow.Run(); | ||
var sample = new LaunchSample(); | ||
sample.Run(); | ||
return; | ||
} | ||
var testScenario = args[0]; | ||
if (testScenario == "--basic-test") | ||
{ | ||
var basic = new BasicTest(); | ||
basic.Run(); | ||
} | ||
else | ||
{ | ||
throw new Exception($"Scenario {testScenario} is unknown."); | ||
} | ||
} | ||
} |
File renamed without changes.
17 changes: 1 addition & 16 deletions
17
src/Components/WebView/test/E2ETest/Microsoft.AspNetCore.Components.WebViewE2E.Test.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<!-- Suppress CS8002 because Photino assemblies are not signed --> | ||
<NoWarn>@(NoWarn);CS8002</NoWarn> | ||
<!-- See code comment in Program.cs/Main in this project regarding this --> | ||
<StartupObject>Microsoft.AspNetCore.Components.WebViewE2E.Test.Program</StartupObject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Samples\PhotinoPlatform\src\Microsoft.AspNetCore.Components.WebView.Photino.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Update="wwwroot\**"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ilonatommy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
ilonatommy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.