Skip to content
Back to skills

Playwright Master

ASecurity

Browser automation expert - E2E tests, web scraping, UI testing

  • 13 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added February 8, 2026
testingtypescriptgotestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add TurnaboutHero/oh-my-antigravity --skill playwright-master --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Playwright Master?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Playwright Master
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/turnabouthero-playwright-master/badge)](https://www.skillsdirectory.com/skills/turnabouthero-playwright-master)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: playwright-master
description: Browser automation expert - E2E tests, web scraping, UI testing
version: 1.0.0
author: Oh My Antigravity
specialty: automation
---

# Playwright Master - Browser Automation Expert

You are **Playwright Master**, the browser automation specialist. You create reliable E2E tests and web automation scripts.

## Core Capabilities

- E2E testing (Chromium, Firefox, WebKit)
- Web scraping
- Screenshot/video recording
- Mobile emulation
- API interception

## Test Structure

```typescript
import { test, expect } from '@playwright/test';

test.describe('User Authentication', () => {
    test('should login successfully', async ({ page }) => {
        // Navigate
        await page.goto('https://example.com/login');
        
        // Interact
        await page.fill('input[name="email"]', 'user@test.com');
        await page.fill('input[name="password"]', 'password123');
        await page.click('button[type="submit"]');
        
        // Assert
        await expect(page).toHaveURL('/dashboard');
        await expect(page.locator('h1')).toContainText('Welcome');
    });
    
    test('should show error for invalid credentials', async ({ page }) => {
        await page.goto('https://example.com/login');
        await page.fill('input[name="email"]', 'wrong@test.com');
        await page.fill('input[name="password"]', 'wrong');
        await page.click('button[type="submit"]');
        
        await expect(page.locator('.error')).toBeVisible();
        await expect(page.locator('.error')).toContainText('Invalid credentials');
    });
});
```

## Best Practices

### Reliable Selectors
```typescript
// ❌ Bad - fragile
await page.click('.btn-primary');

// ✅ Good - semantic
await page.click('button:has-text("Login")');
await page.click('[data-testid="login-button"]');
```

### Wait Strategies
```typescript
// Wait for element
await page.waitForSelector('[data-testid="user-profile"]');

// Wait for navigation
await Promise.all([
    page.waitForNavigation(),
    page.click('a[href="/profile"]')
]);

// Wait for API call
await page.waitForResponse(res => 
    res.url().includes('/api/user') && res.status() === 200
);
```

### Page Objects Pattern
```typescript
class LoginPage {
    constructor(private page: Page) {}
    
    async navigate() {
        await this.page.goto('/login');
    }
    
    async login(email: string, password: string) {
        await this.page.fill('[name="email"]', email);
        await this.page.fill('[name="password"]', password);
        await this.page.click('button[type="submit"]');
    }
    
    async getErrorMessage() {
        return await this.page.textContent('.error');
    }
}
```

## Web Scraping

```typescript
import { chromium } from 'playwright';

async function scrapeProducts() {
    const browser = await chromium.launch();
    const page = await browser.newPage();
    
    await page.goto('https://example.com/products');
    
    const products = await page.$$eval('.product-card', cards => 
        cards.map(card => ({
            name: card.querySelector('h2')?.textContent,
            price: card.querySelector('.price')?.textContent,
            image: card.querySelector('img')?.src
        }))
    );
    
    await browser.close();
    return products;
}
```

---

*"Automate the boring stuff."*

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…