Skip to content

Commit 7eaf84a

Browse files
committed
attempting to fix some tests on CI
1 parent 90f5f5d commit 7eaf84a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/ElectronNET.API/API/WebContents.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ public bool AudioMuted
416416
/// </summary>
417417
/// <returns></returns>
418418
public Task<bool> IsAudioMutedAsync() => InvokeAsync<bool>();
419-
419+
420420
/// <summary>
421421
/// Returns boolean - Whether audio is currently playing.
422422
/// </summary>
423423
/// <returns></returns>
424424
public Task<bool> IsCurrentlyAudibleAsync() => InvokeAsync<bool>();
425-
425+
426426
/// <summary>
427427
/// Mute the audio on the current web page.
428428
/// </summary>
@@ -431,7 +431,7 @@ public void SetAudioMuted(bool muted)
431431
{
432432
BridgeConnector.Socket.Emit("webContents-setAudioMuted", Id, muted);
433433
}
434-
434+
435435
/// <summary>
436436
/// A string property that determines the user agent for this web page.
437437
/// </summary>
@@ -446,7 +446,7 @@ public string UserAgent
446446
BridgeConnector.Socket.Emit("webContents-userAgent-set", Id, value);
447447
}
448448
}
449-
449+
450450
/// <summary>
451451
/// Returns string - The user agent for this web page.
452452
/// </summary>

src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public async Task GetSetZoomFactor_check()
8989
var ok = await fx.MainWindow.WebContents.GetZoomFactorAsync();
9090
ok.Should().BeGreaterThan(0.0);
9191
fx.MainWindow.WebContents.SetZoomFactor(2.0);
92+
await Task.Delay(500);
9293
ok = await fx.MainWindow.WebContents.GetZoomFactorAsync();
9394
ok.Should().Be(2.0);
9495
}
@@ -128,16 +129,16 @@ public async Task ZoomLevelProperty_check()
128129
[SkippableFact(Timeout = 20000)]
129130
public async Task DevTools_check()
130131
{
131-
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping printer test in CI environment.");
132+
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping test in CI environment.");
132133
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
133134
fx.MainWindow.WebContents.OpenDevTools();
134-
await Task.Delay(500);
135+
await Task.Delay(1000);
135136
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
136137
fx.MainWindow.WebContents.CloseDevTools();
137-
await Task.Delay(500);
138+
await Task.Delay(1000);
138139
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
139140
fx.MainWindow.WebContents.ToggleDevTools();
140-
await Task.Delay(500);
141+
await Task.Delay(1000);
141142
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
142143
}
143144

@@ -157,7 +158,7 @@ public async Task GetSetAudioMuted_check()
157158
ok.Should().BeFalse();
158159
}
159160

160-
[Fact(Timeout = 20000)]
161+
[SkippableFact(Timeout = 20000)]
161162
public async Task AudioMutedProperty_check()
162163
{
163164
Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Skipping test on Windows CI.");
@@ -172,7 +173,7 @@ public async Task GetSetUserAgent_check()
172173
var ok = await fx.MainWindow.WebContents.GetUserAgentAsync();
173174
ok.Should().NotBeNullOrEmpty();
174175
fx.MainWindow.WebContents.SetUserAgent("MyUserAgent/1.0");
175-
await Task.Delay(500);
176+
await Task.Delay(1000);
176177
ok = await fx.MainWindow.WebContents.GetUserAgentAsync();
177178
ok.Should().Be("MyUserAgent/1.0");
178179
}

0 commit comments

Comments
 (0)