diff --git a/packages/app/src/runner/aut-iframe.ts b/packages/app/src/runner/aut-iframe.ts index 5548802fa5c7..2e952be7e363 100644 --- a/packages/app/src/runner/aut-iframe.ts +++ b/packages/app/src/runner/aut-iframe.ts @@ -20,6 +20,9 @@ export class AutIframe { debouncedToggleSelectorPlayground: DebouncedFunc<(isEnabled: any) => void> $iframe?: JQuery _highlightedEl?: Element + // Cache the blank page content to avoid repeated generation + private _cachedTestIsolationContent?: string + private _cachedInitialContent?: string constructor ( private projectName: string, @@ -50,11 +53,21 @@ export class AutIframe { } _showInitialBlankPage () { - this._showContents(blankContents.initial()) + // Cache the content to avoid repeated HTML generation + if (!this._cachedInitialContent) { + this._cachedInitialContent = blankContents.initial() + } + + this._showContents(this._cachedInitialContent) } _showTestIsolationBlankPage () { - this._showContents(blankContents.testIsolationBlankPage()) + // Cache the content to avoid repeated HTML generation + if (!this._cachedTestIsolationContent) { + this._cachedTestIsolationContent = blankContents.testIsolationBlankPage() + } + + this._showContents(this._cachedTestIsolationContent) } showVisitFailure = (props) => { diff --git a/packages/app/src/runner/utils.ts b/packages/app/src/runner/utils.ts index d77df970fe76..86a720ef6111 100644 --- a/packages/app/src/runner/utils.ts +++ b/packages/app/src/runner/utils.ts @@ -20,11 +20,7 @@ export function getReporterElement () { } export function empty (el: HTMLElement) { - while (el.lastChild) { - if (el && el.firstChild) { - el.removeChild(el.firstChild) - } - } + el.innerHTML = '' } export const togglePlayground = (autIframe: AutIframe) => { diff --git a/packages/app/src/settings/SettingsContainer.vue b/packages/app/src/settings/SettingsContainer.vue index db6d98cde1ac..03cd3a07c2c5 100644 --- a/packages/app/src/settings/SettingsContainer.vue +++ b/packages/app/src/settings/SettingsContainer.vue @@ -1,6 +1,6 @@