Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,25 @@ jobs:

- name: Validate generated site
run: bundle exec htmlproofer ./_site --disable-external --no-enforce-https --allow-missing-href --ignore-urls '/^\/\//'

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install Playwright dependencies
run: npm ci

- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run Playwright smoke tests
run: npm run test:e2e

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ vendor

# Script output
tmp/pending_updates.yml
node_modules
playwright-report
test-results
76 changes: 76 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "testingconferences.github.io",
"private": true,
"scripts": {
"test:e2e": "playwright test"
},
"devDependencies": {
"@playwright/test": "1.62.1"
}
}
14 changes: 14 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { defineConfig } = require('@playwright/test');

module.exports = defineConfig({
testDir: './test/playwright',
reporter: process.env.CI ? [['html', { open: 'never' }], ['github']] : 'list',
use: {
baseURL: 'http://127.0.0.1:4173'
},
webServer: {
command: 'python3 -m http.server 4173 --bind 127.0.0.1 --directory _site',
port: 4173,
reuseExistingServer: !process.env.CI
}
});
26 changes: 26 additions & 0 deletions test/playwright/site-smoke.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { test, expect } = require('@playwright/test');

test.describe('site smoke checks', () => {
test('API: key pages return success responses', async ({ request, baseURL }) => {
for (const path of ['/', '/past/', '/subscribe/']) {
const response = await request.get(`${baseURL}${path}`);
expect(response.ok(), `${path} should return success`).toBeTruthy();
}
});

test('UI: homepage renders nav links', async ({ page }) => {
await page.goto('/');

await expect(page).toHaveTitle(/Software Testing Conferences/);
await expect(page.getByRole('link', { name: 'Upcoming' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Past' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Newsletter', exact: true })).toBeVisible();
});

test('UI: past page lists conferences', async ({ page }) => {
await page.goto('/past/');

await expect(page).toHaveURL(/\/past\/$/);
await expect(page.locator('ul.post-list li').first()).toBeVisible();
});
});