diff --git a/src/Runner.ts b/src/Runner.ts index ec27f956..178b9549 100644 --- a/src/Runner.ts +++ b/src/Runner.ts @@ -48,6 +48,14 @@ export class Runner { this.#flow = flow; } + async runBeforeAllSteps(flow?: UserFlow): Promise { + await this.#extension.beforeAllSteps?.(flow); + } + + async runAfterAllSteps(flow?: UserFlow): Promise { + await this.#extension.afterAllSteps?.(flow); + } + /** * Runs the provided `step` with `beforeEachStep` and `afterEachStep` hooks. * Parameters from the `flow` apply if the `flow` is set. diff --git a/test/runner.test.ts b/test/runner.test.ts index 8509a710..e34092b9 100644 --- a/test/runner.test.ts +++ b/test/runner.test.ts @@ -817,6 +817,12 @@ describe('Runner', () => { extension.getLog(), 'beforeAll,beforeStep0,runStep0,afterStep0,afterAll' ); + await runner.runBeforeAllSteps(); + await runner.runAfterAllSteps(); + assert.strictEqual( + extension.getLog(), + 'beforeAll,beforeStep0,runStep0,afterStep0,afterAll,beforeAll,afterAll' + ); }); it('should record interactions with OOPIFs', async () => {