Referring the documentation provided by playwright, seems like the hooks (example: afterAll / beforeAll) can be used only inside a spec/ test file as below:
// example.spec.ts
import { test, expect } from '@playwright/test';
test.beforeAll(async () => {
console.log('Before tests');
});
test.afterAll(async () => {
console.log('After tests');
});
test('my test', async ({ page }) => {
// ...
});
My question: is there any support where there can be only one AfterAll() or beforeAll() hook in one single file which will be called for every test files ? the piece of code that i want to have inside the afterAll and beforeAll is common for all the test/ specs files and i dont want to have the same duplicated in all the spec files/ test file. Any suggestion or thoughts on this?
TIA Allen