Skip to content

Commit 2a7544a

Browse files
committed
Make sure the Photino dll is in correct location.
1 parent 9bba32e commit 2a7544a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/Components/WebView/test/E2ETest/Microsoft.AspNetCore.Components.WebViewE2E.Test.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
55
</PropertyGroup>
66

7+
<ItemGroup>
8+
<!-- Add project reference to ensure PhotinoTestApp is built and copied to our output directory -->
9+
<ProjectReference Include="..\..\Samples\PhotinoPlatform\testassets\PhotinoTestApp\PhotinoTestApp.csproj" />
10+
</ItemGroup>
11+
712
</Project>

src/Components/WebView/test/E2ETest/WebViewManagerE2ETests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ public class WebViewManagerE2ETests
2020
SkipReason = "On Helix/Ubuntu the native Photino assemblies can't be found, and on macOS it can't detect when the WebView is ready")]
2121
public async Task CanLaunchPhotinoWebViewAndClickButton()
2222
{
23-
// Get the path to the PhotinoTestApp instead of the current test assembly
24-
var currentAssemblyPath = typeof(WebViewManagerE2ETests).Assembly.Location;
25-
26-
// Extract the current assembly name from the path (without .dll extension)
27-
var currentAssemblyName = Path.GetFileNameWithoutExtension(currentAssemblyPath);
28-
29-
// Replace the current assembly name with "PhotinoTestApp" in the entire path
30-
var photinoTestAppPath = currentAssemblyPath.Replace(currentAssemblyName, "PhotinoTestApp");
23+
// With the project reference, PhotinoTestApp.dll should be copied to the same directory as this test assembly
24+
var testAssemblyDirectory = Path.GetDirectoryName(typeof(WebViewManagerE2ETests).Assembly.Location)!;
25+
var photinoTestAppPath = Path.Combine(testAssemblyDirectory, "PhotinoTestApp.dll");
3126

3227
if (!File.Exists(photinoTestAppPath))
3328
{
34-
throw new FileNotFoundException($"Could not find PhotinoTestApp.dll at: {photinoTestAppPath}");
29+
throw new FileNotFoundException($"Could not find PhotinoTestApp.dll at: {photinoTestAppPath}. " +
30+
"Ensure the PhotinoTestApp project reference is properly configured.");
3531
}
3632

3733
// This test launches the PhotinoTestApp sample as an executable so that the Photino UI window

0 commit comments

Comments
 (0)