Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure/pipelines/jobs/components-e2e-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
jobName: Components_E2E_Test${{ parameters.jobNameSuffix }}
jobDisplayName: "Test: Blazor E2E tests on Linux${{ parameters.displayNameSuffix }}"
agentOs: Linux
use1ESUbuntu: true
container: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-4.0-net12.0-build-aot-test-chrome-amd64
isAzDOTestingJob: true
enablePublishTestResults: false
timeoutInMinutes: 120
Expand Down
2 changes: 2 additions & 0 deletions src/Components/test/E2ETest/Tests/EventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ public void DragDrop_CanTrigger()
var output = Browser.Exists(By.Id("output"));
Assert.Equal(string.Empty, output.Text);

// Bring both elements into view before pointerdown so scrolling doesn't interrupt the drag.
new Actions(Browser).ScrollToElement(target).Perform();
var actions = new Actions(Browser).DragAndDrop(input, target);

actions.Perform();
Expand Down
30 changes: 18 additions & 12 deletions src/Components/test/E2ETest/Tests/GlobalizationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ public virtual void CanSetCultureAndParseCultureSensitiveNumbersAndDates(string
// datetime
input = Browser.Exists(By.Id("input_type_text_datetime"));
display = Browser.Exists(By.Id("input_type_text_datetime_value"));
Browser.Equal(new DateTime(1985, 3, 4).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(1985, 3, 4).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));

input.ReplaceText(new DateTime(2000, 1, 2).ToString(cultureInfo));
input.SendKeys("\t");
Browser.Equal(new DateTime(2000, 1, 2).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] [UNRESOLVED] Normalize date/time text before Selenium input

The assertion now normalizes U+00A0/U+202F spacing, but the value passed to ReplaceText at line 58 remains the raw DateTime.ToString(cultureInfo) result, and ReplaceText forwards it unchanged to Selenium SendKeys. If the new container emits either spacing character and Chrome cannot type it, the change event can retain the prior value and this post-edit assertion can still fail.

Why unresolved: Frozen source does not establish that this Azure Linux 4 image emits U+00A0/U+202F for the tested en-US value, how its Selenium/Chrome versions handle that character, or that the merge-base environment has a different observable outcome.

Minimal repro: run the en-US CanSetCultureAndParseCultureSensitiveNumbersAndDates row in the configured container, confirm the formatted 2000-01-02 value contains U+00A0/U+202F, then inspect the input/display after ReplaceText and tab.

If confirmed, normalize the typed value too, for example:

Suggested change
Browser.Equal(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
input.ReplaceText(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)));
input.SendKeys("\t");
Browser.Equal(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this against the exact configured AL4 Chrome image and the latest CI results. The proposed failure is not reproduced:

  • The exact-image formatting probe confirms ICU 77.1 formats the en-US value as 1/2/2000 12:00:00\u202FAM (U+202F before AM).
  • ReplaceText forwards the formatted string unchanged to Selenium SendKeys.
  • On head cce1d33230a28ae08dd0f7c0844c491169908864, all 12 globalization rows passed in E2E build 1695925: Server/WASM × en-US/fr-FR × the three culture-sensitive/invariant scenarios. This includes both en-US CanSetCultureAndParseCultureSensitiveNumbersAndDates rows.
  • The post-edit assertions require the bound date to change from 1985-03-04 to 2000-01-02. Normalizing only AM/PM spacing cannot make an unchanged prior date satisfy that assertion. The invariant-input scenarios additionally assert the actual input value is 2000-01-02.

This supports successful input and binding of U+202F with the configured browser/driver, not a blanket claim about U+00A0 or every browser version. The numeric-separator workaround alone does not establish that the current date/time path fails. I am leaving the typed values unchanged unless a faithful reproduction demonstrates otherwise; the current evidence does not substantiate this as a P2 blocker.


// datetimeoffset
input = Browser.Exists(By.Id("input_type_text_datetimeoffset"));
display = Browser.Exists(By.Id("input_type_text_datetimeoffset_value"));
Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));

input.ReplaceText(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo));
input.SendKeys("\t");
Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
}

private static string NormalizeWhitespace(string value)
Expand All @@ -76,6 +76,12 @@ private static string NormalizeWhitespace(string value)
return Regex.Replace(value, "\\s", " ");
}

private static string NormalizeAmPmSpacing(string value)
{
// Host and browser ICU data can use different spaces before AM/PM.
return Regex.Replace(value, @"(?<=\d)[\u00A0\u202F](?=(?:AM|PM)\b)", " ");
}

// The logic is different for verifying culture-invariant fields. The problem is that the logic for what
// kinds of text a field accepts is determined by the browser and language - it's not general. So while
// type="number" and type="date" produce fixed-format and culture-invariant input/output via the "value"
Expand Down Expand Up @@ -128,24 +134,24 @@ public void CanSetCultureAndParseCultureInvariantNumbersAndDatesWithInputFields(
input = Browser.Exists(By.Id("input_type_date_datetime"));
display = Browser.Exists(By.Id("input_type_date_datetime_value"));
var extraInput = Browser.Exists(By.Id("input_type_date_datetime_extrainput"));
Browser.Equal(new DateTime(1985, 3, 4).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(1985, 3, 4).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

extraInput.ReplaceText(new DateTime(2000, 1, 2).ToString(cultureInfo));
extraInput.SendKeys("\t");
Browser.Equal(new DateTime(2000, 1, 2).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

// datetimeoffset
input = Browser.Exists(By.Id("input_type_date_datetimeoffset"));
display = Browser.Exists(By.Id("input_type_date_datetimeoffset_value"));
extraInput = Browser.Exists(By.Id("input_type_date_datetimeoffset_extrainput"));
Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

extraInput.ReplaceText(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo));
extraInput.SendKeys("\t");
Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));
}

Expand Down Expand Up @@ -209,24 +215,24 @@ public void CanSetCultureAndParseCultureInvariantNumbersAndDatesWithFormComponen
input = Browser.Exists(By.Id("inputdate_datetime"));
display = Browser.Exists(By.Id("inputdate_datetime_value"));
var extraInput = Browser.Exists(By.Id("inputdate_datetime_extrainput"));
Browser.Equal(new DateTime(1985, 3, 4).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(1985, 3, 4).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

extraInput.ReplaceText(new DateTime(2000, 1, 2).ToString(cultureInfo));
extraInput.SendKeys("\t");
Browser.Equal(new DateTime(2000, 1, 2).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTime(2000, 1, 2).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

// datetimeoffset
input = Browser.Exists(By.Id("inputdate_datetimeoffset"));
display = Browser.Exists(By.Id("inputdate_datetimeoffset_value"));
extraInput = Browser.Exists(By.Id("inputdate_datetimeoffset_extrainput"));
Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));

extraInput.ReplaceText(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo));
extraInput.SendKeys("\t");
Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo), () => display.Text);
Browser.Equal(NormalizeAmPmSpacing(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo)), () => NormalizeAmPmSpacing(display.Text));
Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value"));
}
}
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/QuickGridTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void CanCloseColumnOptionsByBlurring()
firstNameColumnOptionsButton.Click();

// Click outside the column options to close
grid.Click();
Browser.FindElement(By.Id("non-js-root-parameter")).Click();

var firstNameSearchSelector = "#grid > table > thead > tr > th:nth-child(2) input[type=search]";
Browser.DoesNotExist(By.CssSelector(firstNameSearchSelector));
Expand Down
5 changes: 5 additions & 0 deletions src/Components/test/E2ETest/Tests/RoutingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ public void NavigationLock_CanBlockNavigation_ThenContinue()
Browser.FindElement(By.Id("add-navigation-lock")).Click();
Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.block-internal-navigation")).Click();
Browser.FindElement(By.CssSelector("#navigation-lock-1 > input.block-internal-navigation")).Click();
Browser.Equal("true", () => Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.navigation-lock-ready")).GetDomProperty("value"));
Browser.Equal("true", () => Browser.FindElement(By.CssSelector("#navigation-lock-1 > input.navigation-lock-ready")).GetDomProperty("value"));

var uriBeforeBlockedNavigation = Browser.FindElement(By.Id("test-info")).Text;
var relativeUriPostNavigation = "/mytestpath";
Expand Down Expand Up @@ -885,6 +887,7 @@ public void NavigationLock_RemovesLock_WhenDisposed()
// Add a navigation lock that blocks internal navigations
Browser.FindElement(By.Id("add-navigation-lock")).Click();
Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.block-internal-navigation")).Click();
Browser.Equal("true", () => Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.navigation-lock-ready")).GetDomProperty("value"));

var uriBeforeBlockedNavigation = Browser.FindElement(By.Id("test-info")).Text;
var relativeUriPostNavigation = "/mytestpath";
Expand Down Expand Up @@ -912,6 +915,7 @@ public void NavigationLock_RemovesLock_WhenDisposed()

// Remove the navigation lock component
Browser.FindElement(By.Id("remove-navigation-lock")).Click();
Browser.DoesNotExist(By.Id("navigation-lock-0"));

SetUrlViaPushState(relativeUriPostNavigation);

Expand Down Expand Up @@ -1126,6 +1130,7 @@ public void NavigationLock_HistoryNavigationWorks_AfterRefresh()
// Add a navigation lock that blocks internal navigations
Browser.FindElement(By.Id("add-navigation-lock")).Click();
Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.block-internal-navigation")).Click();
Browser.Equal("true", () => Browser.FindElement(By.CssSelector("#navigation-lock-0 > input.navigation-lock-ready")).GetDomProperty("value"));

// We have the expected initial URI
var expectedStartingAbsoluteUri = $"{_serverFixture.RootUri}subdir/mytestpath1";
Expand Down
Loading