fix(gui): use class selectors for sidebar-scrollbox in GUI tests#3052
fix(gui): use class selectors for sidebar-scrollbox in GUI tests#3052ehuss merged 1 commit intorust-lang:masterfrom
Conversation
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">).
|
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. |
|
I'm also curious about the reason (for personal knowledge). Other than that, changes look good to me. |
|
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 |
|
To be noted: instead of |
Replace bare
mdbook-sidebar-scrollboxtag-name selectors with.sidebar-scrollboxclass selectors in GUI tests to avoid timing-dependent failures when the custom element hasn't been registered yet in headless Chrome.