The BitDatePicker look E2E test presses Escape before the year grid has the focus

Đang mở
#15,623 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@msynk đang làm issue này rồi.

Từ ngày 5/12/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

BitDatePickerLookE2ETests.Appearance_IconNameAndIconPickTheGlyphs (src/BlazorUI/Tests/E2E/Bit.BlazorUI.Tests.E2E/Inputs/BitDatePickerLookE2ETests.cs) failed on both tries in "blazorui e2e / E2E webkit / server" of All Other E2E CI run 47455950741. The next picker it opens finds the previous callout still open:

Locator expected to have count '0'
But was: '1'
  - Expect "ToHaveCountAsync" Locator(".bit-dtp-ovl:visible, .bit-dtrp-ovl:visible") with timeout 30000ms
  at BitDatePickerLookE2ETests.OpenPickerAsync(String rootId)
  at BitDatePickerLookE2ETests.Appearance_IconNameAndIconPickTheGlyphs()

That is OpenPickerAsync("dp-time-icons"), right after the Escape that should have closed the #dp-nav-icons callout.

Cause: the test. It clicks the month picker's title (.bit-dtp-mwp .bit-dtp-ptb) to show the year range, checks the range's icons and presses Escape to close the callout. The callout handles Escape in its own keydown, so it closes only when the focus is inside it. The clicked title is replaced by the year grid, and the picker gives the focus to that grid's year cell after the render. On Blazor Server that is a round trip after the click, and until then the focus is on <body>: WebKit doesn't focus a clicked button, and the other engines lose it when the title is removed. An Escape pressed in that window goes to the body, and the callout stays open. BitDatePickerE2ETests already checks that the picker hands the focus over to the year grid.

Probe run 47467932146 clicked the title and pressed Escape the way the test does, recording the focus:

  • With the circuit's server-to-page messages delayed by 150 ms (Playwright's WebSocket routing), the callout stayed open in 4 of 4 runs on each of WebKit, Chromium and Firefox. The focus was on <body> when Escape was pressed, and reached the year cell about 100 ms later.
  • With the same delay, waiting for the year cell to have the focus before pressing Escape closed the callout in 4 of 4 runs on each engine.
  • Without the delay, every run closed the callout. Even so, in 1 of 6 runs on WebKit and 2 of 6 on Firefox the focus was still on <body> just after the click.

Fix. Before it presses Escape, the test waits for the year cell to have the focus.

Ngôn ngữ chính
C#
Star
1.4k
Fork
264
Merge trung bình
5 giờ 25 phút
Pull request đã merge (30 ngày)
447

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bitfoundation/bitplatform

Tất cả issue của bitfoundation/bitplatform

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.