Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattobee committed Feb 9, 2025
1 parent c2366c5 commit 76ed7d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Run tests
env:
PLAYWRIGHT_TEST_BASE_URL: 'https://deploy-preview-${{ env.GITHUB_PR_NUMBER }}--eventua11y.netlify.app/'
DEBUG: "pw:api,pw:browser*,pw:protocol*"
DEBUG: 'pw:api,pw:browser*,pw:protocol*'
CI: 'true'
run: |
echo "Starting Playwright tests..."
Expand Down
36 changes: 23 additions & 13 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,38 @@ export default defineConfig({
waitForNavigation: 'networkidle',

// CI-specific browser launch options
launchOptions: process.env.CI ? {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
} : undefined,
launchOptions: process.env.CI
? {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
}
: undefined,

// Use persistent context in CI to reduce browser startup overhead
contextOptions: process.env.CI ? {
acceptDownloads: false,
strictSelectors: true,
} : undefined,
contextOptions: process.env.CI
? {
acceptDownloads: false,
strictSelectors: true,
}
: undefined,
},
// Configure projects for major browsers.
projects: [
{
name: 'chromium',
use: {
use: {
...devices['Desktop Chrome'],
// Additional chromium-specific settings for CI
launchOptions: process.env.CI ? {
executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu'],
headless: true
} : undefined,
launchOptions: process.env.CI
? {
executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-gpu',
],
headless: true,
}
: undefined,
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions tests/theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ test.describe('Theme Switching', () => {
// Reset system preference and load page
await page.emulateMedia({ colorScheme: 'light' });
await page.goto('/');

// Wait for critical components to be ready
await Promise.all([
page.waitForLoadState('networkidle'),
page.waitForLoadState('domcontentloaded'),
page.waitForSelector('#upcoming-events', { state: 'visible' }),
page.waitForSelector('#theme-selector-button', { state: 'visible' })
page.waitForSelector('#theme-selector-button', { state: 'visible' }),
]);

// Ensure clean state with more reasonable drawer handling
Expand Down

0 comments on commit 76ed7d5

Please sign in to comment.