mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-21 14:35:16 +00:00
attempting to fix some tests on CI
This commit is contained in:
@@ -416,13 +416,13 @@ public class WebContents : ApiBase
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<bool> IsAudioMutedAsync() => InvokeAsync<bool>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns boolean - Whether audio is currently playing.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<bool> IsCurrentlyAudibleAsync() => InvokeAsync<bool>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Mute the audio on the current web page.
|
||||
/// </summary>
|
||||
@@ -431,7 +431,7 @@ public class WebContents : ApiBase
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContents-setAudioMuted", Id, muted);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A string property that determines the user agent for this web page.
|
||||
/// </summary>
|
||||
@@ -446,7 +446,7 @@ public class WebContents : ApiBase
|
||||
BridgeConnector.Socket.Emit("webContents-userAgent-set", Id, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns string - The user agent for this web page.
|
||||
/// </summary>
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace ElectronNET.IntegrationTests.Tests
|
||||
var ok = await fx.MainWindow.WebContents.GetZoomFactorAsync();
|
||||
ok.Should().BeGreaterThan(0.0);
|
||||
fx.MainWindow.WebContents.SetZoomFactor(2.0);
|
||||
await Task.Delay(500);
|
||||
ok = await fx.MainWindow.WebContents.GetZoomFactorAsync();
|
||||
ok.Should().Be(2.0);
|
||||
}
|
||||
@@ -128,16 +129,16 @@ namespace ElectronNET.IntegrationTests.Tests
|
||||
[SkippableFact(Timeout = 20000)]
|
||||
public async Task DevTools_check()
|
||||
{
|
||||
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping printer test in CI environment.");
|
||||
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping test in CI environment.");
|
||||
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
|
||||
fx.MainWindow.WebContents.OpenDevTools();
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(1000);
|
||||
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
|
||||
fx.MainWindow.WebContents.CloseDevTools();
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(1000);
|
||||
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
|
||||
fx.MainWindow.WebContents.ToggleDevTools();
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(1000);
|
||||
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -157,7 +158,7 @@ namespace ElectronNET.IntegrationTests.Tests
|
||||
ok.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact(Timeout = 20000)]
|
||||
[SkippableFact(Timeout = 20000)]
|
||||
public async Task AudioMutedProperty_check()
|
||||
{
|
||||
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Skipping test on Windows CI.");
|
||||
@@ -172,7 +173,7 @@ namespace ElectronNET.IntegrationTests.Tests
|
||||
var ok = await fx.MainWindow.WebContents.GetUserAgentAsync();
|
||||
ok.Should().NotBeNullOrEmpty();
|
||||
fx.MainWindow.WebContents.SetUserAgent("MyUserAgent/1.0");
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(1000);
|
||||
ok = await fx.MainWindow.WebContents.GetUserAgentAsync();
|
||||
ok.Should().Be("MyUserAgent/1.0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user