Skip to content

Commit

Permalink
Adding test to replicate this issue: cefsharp#4621
Browse files Browse the repository at this point in the history
  • Loading branch information
nebojsasandin committed Mar 3, 2024
1 parent 9d52314 commit 995bdef
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CefSharp.Test/OffScreen/OffScreenBrowserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public OffScreenBrowserTests(ITestOutputHelper output, CefSharpFixture fixture)
[Fact]
public async Task ShouldWorkWhenLoadingGoogle()
{
using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler:false))
using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false))
{
var response = await browser.WaitForInitialLoadAsync();
var mainFrame = browser.GetMainFrame();
Expand All @@ -41,6 +41,20 @@ public async Task ShouldWorkWhenLoadingGoogle()
Assert.Equal(200, response.HttpStatusCode);

output.WriteLine("Url {0}", mainFrame.Url);

browser.Load("https://accounts.google.com/");
var nav = await browser.WaitForNavigationAsync();
mainFrame = browser.GetMainFrame();

Assert.True(nav.Success);
Assert.True(mainFrame.IsValid);
Assert.Contains("accounts.google", mainFrame.Url);
Assert.Equal(200, nav.HttpStatusCode);

output.WriteLine("Url {0}", mainFrame.Url);

var buttonText = await mainFrame.EvaluateScriptAsync<string>("(function() { return document.querySelector(\"button[aria-haspopup='menu']\").innerText; })();");
Assert.Equal("Create account", buttonText);
}
}

Expand Down

0 comments on commit 995bdef

Please sign in to comment.