- Add --swarm <count> capability to launch up to 100 agents in parallel - Support multiple providers: --claude, --openai, --gemini, --grok, --local - Implement lazy agent spawning for efficient resource usage - Add automatic authentication for all providers - Create parallel file processing with progress tracking - Migrate all tests from Jest to Vitest - Add comprehensive test coverage for swarm functionality - Support idiomatic usage: dev --claude --swarm 5 -p 'edit files...' - Version bump to 2.1.0
133 lines
4.6 KiB
TypeScript
133 lines
4.6 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Hanzo.app Landing Page', () => {
|
|
test('has correct title and heading', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Check title
|
|
await expect(page).toHaveTitle('Hanzo - AI Development Platform for Every Device');
|
|
|
|
// Check main heading
|
|
const heading = page.locator('h1');
|
|
await expect(heading).toContainText('AI Development');
|
|
await expect(heading).toContainText('Everywhere You Code');
|
|
});
|
|
|
|
test('displays all platform download cards', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Check all download cards are present
|
|
const downloadCards = page.locator('.download-card');
|
|
await expect(downloadCards).toHaveCount(9);
|
|
|
|
// Check specific platforms
|
|
await expect(page.locator('text=Desktop App')).toBeVisible();
|
|
await expect(page.locator('text=Mobile Apps')).toBeVisible();
|
|
await expect(page.locator('text=Browser Extension')).toBeVisible();
|
|
await expect(page.locator('text=VS Code Extension')).toBeVisible();
|
|
await expect(page.locator('text=JetBrains Plugin')).toBeVisible();
|
|
await expect(page.locator('text=Dev CLI')).toBeVisible();
|
|
await expect(page.locator('text=MCP Server')).toBeVisible();
|
|
await expect(page.locator('text=Cloud Platform')).toBeVisible();
|
|
});
|
|
|
|
test('copy command buttons work', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Test CLI copy button
|
|
const cliButton = page.locator('button:has-text("npm install -g @hanzo/dev")');
|
|
await cliButton.click();
|
|
|
|
// Check clipboard was written (button text changes)
|
|
await expect(cliButton).toContainText('Copied!');
|
|
|
|
// Wait for button to reset
|
|
await page.waitForTimeout(2500);
|
|
await expect(cliButton).toContainText('npm install -g @hanzo/dev');
|
|
});
|
|
|
|
test('navigation links work', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Check header links
|
|
await expect(page.locator('a[href="https://docs.hanzo.ai"]')).toBeVisible();
|
|
await expect(page.locator('a[href="https://github.com/hanzoai"]')).toBeVisible();
|
|
await expect(page.locator('a[href="https://cloud.hanzo.ai/login"]')).toBeVisible();
|
|
});
|
|
|
|
test('quick start section displays correctly', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Check quick start section
|
|
await expect(page.locator('text=Quick Start in 30 Seconds')).toBeVisible();
|
|
|
|
// Check code block
|
|
const codeBlock = page.locator('.code-block');
|
|
await expect(codeBlock).toBeVisible();
|
|
await expect(codeBlock).toContainText('npm install -g @hanzo/dev');
|
|
await expect(codeBlock).toContainText('dev login');
|
|
});
|
|
|
|
test('responsive design works', async ({ page }) => {
|
|
// Test mobile viewport
|
|
await page.setViewportSize({ width: 375, height: 667 });
|
|
await page.goto('/');
|
|
|
|
// Check mobile menu behavior
|
|
const navLinks = page.locator('.nav-links');
|
|
await expect(navLinks).toBeHidden();
|
|
|
|
// Check cards stack on mobile
|
|
const downloadGrid = page.locator('.download-grid');
|
|
await expect(downloadGrid).toBeVisible();
|
|
});
|
|
});
|
|
|
|
test.describe('Dev Landing Page', () => {
|
|
test('has correct content', async ({ page }) => {
|
|
await page.goto('/src/dev.html');
|
|
|
|
// Check title
|
|
await expect(page).toHaveTitle('Dev - Ship 100X Faster with Parallel AI Agents');
|
|
|
|
// Check main heading
|
|
await expect(page.locator('h1')).toContainText('Ship 100X Faster');
|
|
|
|
// Check demo terminal
|
|
const terminal = page.locator('.demo-terminal');
|
|
await expect(terminal).toBeVisible();
|
|
await expect(terminal).toContainText('dev enhance');
|
|
});
|
|
|
|
test('pricing cards are displayed', async ({ page }) => {
|
|
await page.goto('/src/dev.html');
|
|
|
|
// Check pricing cards
|
|
const pricingCards = page.locator('.pricing-card');
|
|
await expect(pricingCards).toHaveCount(3);
|
|
|
|
// Check prices
|
|
await expect(page.locator('text=$0/month')).toBeVisible();
|
|
await expect(page.locator('text=$49/month')).toBeVisible();
|
|
await expect(page.locator('text=$199/month')).toBeVisible();
|
|
});
|
|
|
|
test('subscribe buttons redirect correctly', async ({ page, context }) => {
|
|
await page.goto('/src/dev.html');
|
|
|
|
// Listen for new pages (popups/tabs)
|
|
const pagePromise = context.waitForEvent('page');
|
|
|
|
// Click subscribe button
|
|
await page.locator('button:has-text("Start Pro Trial")').click();
|
|
|
|
// Get the new page
|
|
const newPage = await pagePromise;
|
|
await newPage.waitForLoadState();
|
|
|
|
// Check URL
|
|
expect(newPage.url()).toContain('cloud.hanzo.ai/signup');
|
|
expect(newPage.url()).toContain('plan=pro');
|
|
expect(newPage.url()).toContain('product=dev');
|
|
});
|
|
}); |