I am writing a test in playwrite and have a before each. I need a value that is generated in the beforeEach function to be available in the test function itself.
test.beforeEach(async ({ page, request }) => {
const user = await createUser(request);
// pass the user variable to each test
});
test.describe('do something', () => {
test('do something 1', async ({ page }) => {
// have access to the variable here
});
});