test: fix toolbar hydration test under frozen suite (#32684)

This commit is contained in:
Max Schmitt 2024-09-18 15:35:33 +02:00 committed by GitHub
parent 825df6c074
commit ec3db20743
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -1039,9 +1039,12 @@ export class Recorder {
this.highlight.install();
// some frameworks erase the DOM on hydration, this ensures it's reattached
const recreationInterval = setInterval(() => {
let recreationInterval: number | undefined;
const recreate = () => {
this.highlight.install();
}, 500);
recreationInterval = this.injectedScript.builtinSetTimeout(recreate, 500);
};
recreationInterval = this.injectedScript.builtinSetTimeout(recreate, 500);
this._listeners.push(() => clearInterval(recreationInterval));
this.overlay?.install();

View file

@ -744,7 +744,7 @@ await page.GetByLabel("Coun\\"try").ClickAsync();`);
const recorder = await openRecorder();
const hydrate = () => {
setTimeout(() => {
window.builtinSetTimeout(() => {
document.documentElement.innerHTML = '<p>Post-Hydration Content</p>';
}, 500);
};