Playwright / Quiz
Configuration Across Environments
Separate safe defaults from secrets and validate environment-driven Playwright configuration before a test reaches the wrong target.
- Difficulty
- Easy
- Format
- Quiz
- Points
- 100
- Estimate
- 6 min
// MISSION BRIEF
Your Mission
The same suite runs against local, staging, and production-like environments. Read the configuration and CI injection points, then identify which values are safe to version and which need validation and secret handling.
// FIRST CONTACT
Battle teaser
A config contains: const baseURL = process.env.BASE_URL; if (!baseURL) throw new Error("BASE_URL is required"); export default defineConfig({ use: { baseURL } }); What does this buy the suite?
- AIt supplies baseURL for relative navigation and fails fast when the value is missing
- BPlaywright automatically encrypts BASE_URL and safely writes it into every trace, as long as the value arrived through process.env rather than a literal
- CThe variable is written back to the operating system after the run
- DEvery test gets a different random URL
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
playwright-configenvironment-variablessecretsplaywright