diff --git a/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs b/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs index 3766ac2065..a4b4d5aef3 100644 --- a/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs +++ b/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs @@ -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(); @@ -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("(function() { return document.querySelector(\"button[aria-haspopup='menu']\").innerText; })();"); + Assert.Equal("Create account", buttonText); } }