TargetQA
JavaScript
Lesson 1 of 1 · 5 min

1.1 Setting Up Your First JavaScript Spec

AI

Lesson Audio Narration

### JavaScript Playwright Syntax In standard JavaScript, we import `test` and `expect` using ES module syntax: ```javascript import { test, expect } from '@playwright/test'; test('search for courses', async ({ page }) => { await page.goto('https://targetqa.com/courses'); const searchBox = page.getByPlaceholder('Search courses...'); await searchBox.fill('Selenium'); await expect(page.locator('.course-card')).toHaveCount(2); }); ```
Your Task

Fill the search input with placeholder `'Search courses...'` with `'Playwright'` and submit.

Common doubts
Did you find this lesson helpful?
solution.js
Loading code editor…
Execution Console

Click "Run Code" to test your implementation.