-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test - Add reproduction for issue 4621
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |