Playwright + TS · Lesson 7 of 36
Module 7: Modules & Project Structure
Your task
Write an export statement exporting a constant named API_TIMEOUT set to 10000.
Write it in the editor, then press Check answer (Ctrl + Enter).
// Named export (constants.ts):
export const DEFAULT_TIMEOUT = 30000;
export const BASE_URL = "https://targetqa.com";
// Importing named exports:
import { DEFAULT_TIMEOUT, BASE_URL } from "./constants";
// Default export (LoginPage.ts):
export default class LoginPage { ... }
// Importing default export:
import LoginPage from "./LoginPage";In automation, URLs and credentials vary across environments (dev, staging, prod):
const targetEnv = process.env.TEST_ENV || "staging";A well-structured automation project is easy to maintain and scale. In this lesson, we will cover ES modules with import and export, package.json configurations, tsconfig settings, and how to organize your folders cleanly. Let's explore how real-world test repositories are structured!
Part of the Playwright + TS course (Playwright with TypeScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
Named exports enforce consistent naming across all test files and make refactoring and auto-imports reliable in IDEs.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___