1
0
Fork 0
mirror of https://github.com/imjasonh/gitscrub synced 2026-07-06 18:42:21 +00:00
gitscrub/playwright.config.ts
Jason Hall 4a77cbcfb0
Switch from OAuth device flow to standard OAuth2 web flow
- Replace device flow with standard OAuth2 authorization code flow
- Add auth-start.js and auth-callback.js Netlify functions
- Create AuthSuccess page to handle OAuth callbacks
- Remove device flow UI components and polling logic
- Add CSRF protection with state parameter
- Update all documentation to reflect web flow
- Remove unauthenticated access - authentication now required
- Update tests for new authentication requirements
- Add test helper script for Netlify dev server

This provides a more familiar OAuth experience where users are
redirected to GitHub for authorization rather than entering codes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 16:05:06 -04:00

64 lines
No EOL
1.8 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
dotenv.config({ path: resolve(__dirname, '.env.test') });
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:8888',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
/* Run your local dev server before starting the tests */
webServer: {
command: 'netlify dev',
url: 'http://localhost:8888',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000, // 2 minutes - Netlify dev takes longer to start
},
});