10. Project: Test Data Management Utility

Capstone Project: Test Data Management Utility

In real Playwright projects, tests should never hardcode credentials or test email addresses directly inside test files. We build a Test Data Utility:

1. Typed Interfaces: TestUser and TestProduct.
2. Random Generator: generateRandomUser() generating unique emails.
3. Validation: verifies data integrity before passing to Playwright scripts.

Task

  • Complete the `TestDataManager` utility:
  • 1. Implement `generateRandomUser` to return a `TestUser` with dynamic email `user_${Date.now()}@targetqa.com`.
  • 2. Set default `role: "tester"`.
πŸ’‘Common doubts
Did you like the problem?
Lesson 10 of 36
TypeScript
Loading code editor…
Next