0

I tried

const randomName = (Math.random() + 1).toString(36).substring(2);
export const NEW_PERSONALIZATION_NAME = randomName;

If the test is passed, everything is fine. If the test fails, the constant is generated again. Look at my screen How can I solve this problem?

Screen

Leonid
  • 1
  • 2

1 Answers1

0

Workers are shutdown on a test failure, see here: https://playwright.dev/docs/next/test-parallel#worker-processes

Thats the reason why a new random value gets calculated on a test failure.

Max Schmitt
  • 2,529
  • 1
  • 12
  • 26