test: fix toolbar hydration test under frozen suite

This commit is contained in:
Max Schmitt 2024-09-18 15:03:27 +02:00
parent 9fc195bff5
commit 6ed681c81e
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);
};