- WXT + React 18 + TypeScript setup - Background service worker (LLM API proxy) - Content script (floating toolbar + text selection) - Options page (provider/model/API key config) - Popup UI - Gitea Actions workflows (CI, preview, release) - Vitest unit tests + Playwright E2E setup - Supports: OpenAI, Anthropic, Groq, OpenRouter
29 lines
881 B
TypeScript
29 lines
881 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test('LexAI popup opens correctly', async ({ page }) => {
|
|
// Navigate to extension popup
|
|
await page.goto('chrome-extension://[EXTENSION_ID]/popup/index.html');
|
|
|
|
// Check LexAI branding is present
|
|
await expect(page.locator('text=LexAI')).toBeVisible();
|
|
|
|
// Check settings button is present
|
|
await expect(page.locator('button:has-text("Open Settings")')).toBeVisible();
|
|
});
|
|
|
|
test('Options page saves API key', async ({ page }) => {
|
|
await page.goto('chrome-extension://[EXTENSION_ID]/options/index.html');
|
|
|
|
// Fill in API key
|
|
await page.fill('input[type="password"]', 'sk-test-key');
|
|
|
|
// Select provider
|
|
await page.selectOption('select:first-of-type', 'openai');
|
|
|
|
// Save
|
|
await page.click('button:has-text("Save Settings")');
|
|
|
|
// Confirm saved
|
|
await expect(page.locator('text=Saved!')).toBeVisible();
|
|
});
|