diff --git a/src/test-run/index.ts b/src/test-run/index.ts index 4633199847..fd15e72b89 100644 --- a/src/test-run/index.ts +++ b/src/test-run/index.ts @@ -545,8 +545,7 @@ export default class TestRun extends AsyncEventEmitter { } private async _initRequestHooks (): Promise { - if (!this.test.skip) - await Promise.all(this.test.requestHooks.map(hook => this._initRequestHook(hook))); + await Promise.all(this.test.requestHooks.map(hook => this._initRequestHook(hook))); } private _prepareSkipJsErrorsOption (): boolean | ExecuteClientFunctionCommand { @@ -1444,8 +1443,10 @@ export default class TestRun extends AsyncEventEmitter { } public async initialize (): Promise { - await this._clearCookiesAndStorages(); - await this._initRequestHooks(); + if (!this.test.skip) { + await this._clearCookiesAndStorages(); + await this._initRequestHooks(); + } } private async _clearCookiesAndStorages (): Promise {