Skip to content

Commit

Permalink
Test - Add reproduction for issue 4621
Browse files Browse the repository at this point in the history
  • Loading branch information
amaitland committed Mar 24, 2024
1 parent f5bcd01 commit 800cbcf
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions CefSharp.Test/Issues/Issue4621.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CefSharp.OffScreen;
using Xunit;
using Xunit.Abstractions;

namespace CefSharp.Test.Issues
{
//NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle
[Collection(CefSharpFixtureCollection.Key)]
public class Issue4621
{
private readonly ITestOutputHelper output;

public Issue4621(ITestOutputHelper output)
{
this.output = output;
}

[Fact(Skip = "Issue https://github.com/cefsharp/CefSharp/issues/4621")]
public async Task GoogleSearchToGoogleAccountsBreaksJS()
{
using (var browser = new ChromiumWebBrowser("https://www.google.com", useLegacyRenderHandler: false))
{
var initialResponse = await browser.WaitForInitialLoadAsync();

var response = await browser.LoadUrlAsync("https://accounts.google.com/");
var mainFrame = browser.GetMainFrame();

Assert.True(response.Success);
Assert.True(mainFrame.IsValid);
Assert.Contains("accounts.google", mainFrame.Url);
Assert.Equal(200, response.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);
}
}
}
}

0 comments on commit 800cbcf

Please sign in to comment.