Skip to content

fix(gui): use class selectors for sidebar-scrollbox in GUI tests#3052

Merged
ehuss merged 1 commit intorust-lang:masterfrom
jhult:fix/gui-sidebar-scroll-failure
Mar 23, 2026
Merged

fix(gui): use class selectors for sidebar-scrollbox in GUI tests#3052
ehuss merged 1 commit intorust-lang:masterfrom
jhult:fix/gui-sidebar-scroll-failure

Conversation

@jhult
Copy link
Copy Markdown
Contributor

@jhult jhult commented Mar 16, 2026

Replace bare mdbook-sidebar-scrollbox tag-name selectors with .sidebar-scrollbox class selectors in GUI tests to avoid timing-dependent failures when the custom element hasn't been registered yet in headless Chrome.

Fixes CI failure in sidebar-scroll.goml where mdbook-sidebar-scrollbox custom element not found (timing issue in headless Linux Chrome). The class is always present in generated HTML (<mdbook-sidebar-scrollbox class="sidebar-scrollbox">).
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 16, 2026
@jhult
Copy link
Copy Markdown
Contributor Author

jhult commented Mar 16, 2026

Found via failure on #3049

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Mar 16, 2026

Thanks! Do you have more information on why the tag-name would be any different than the class? I would expect that the DOM is ready when the test runs, so I would not expect there to be any difference. Do you have a testing method to verify this is the right fix?

cc @GuillaumeGomez in case you have any knowledge on this.

@GuillaumeGomez
Copy link
Copy Markdown
Member

I'm also curious about the reason (for personal knowledge). Other than that, changes look good to me.

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Mar 16, 2026

Hm, I did a little digging. I can't find a clear source, but it sounds like there is no guarantee that the customElement constructor is finished before DOMContentLoaded. There is a separate whenDefined when the definition is complete, but that wouldn't really be practical here.

@GuillaumeGomez
Copy link
Copy Markdown
Member

To be noted: instead of assert-text, wait-for-text could be used.

Copy link
Copy Markdown
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks, I'm going to go ahead and merge since it seems to be more reliable in my testing.

View changes since this review

@ehuss ehuss added this pull request to the merge queue Mar 23, 2026
Merged via the queue into rust-lang:master with commit 05fbc5d Mar 23, 2026
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Mar 23, 2026
@jhult jhult deleted the fix/gui-sidebar-scroll-failure branch March 24, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants