Skip to content

Commit 6d8bef8

Browse files
committed
Run Playwright smoke with devcontainer Chromium
1 parent 4acd75a commit 6d8bef8

3 files changed

Lines changed: 17 additions & 47 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ SHELL ["/bin/sh", "-o", "pipefail", "-c"]
55
RUN apk add --no-cache \
66
bash \
77
build-base \
8+
chromium \
89
curl \
910
git \
11+
harfbuzz \
1012
libxml2-dev \
1113
libxslt-dev \
1214
nodejs \
15+
nss \
1316
npm \
1417
openssl-dev \
1518
python3 \
19+
ttf-freefont \
1620
yaml-dev \
1721
tzdata
1822

frontend/e2e/smoke.spec.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@ test.describe('frontend smoke', () => {
2626
});
2727
});
2828

29-
await page.route(/\/api\/v1\/strategies$/, async (route) => {
30-
await route.fulfill({
31-
status: 200,
32-
contentType: 'application/json',
33-
body: JSON.stringify({
34-
success: true,
35-
data: {
36-
strategies: [
37-
{ id: 'faraday', name: 'faraday', display_name: 'Default' },
38-
{
39-
id: 'browserless',
40-
name: 'browserless',
41-
display_name: 'JavaScript pages (recommended)',
42-
},
43-
],
44-
},
45-
meta: { total: 2 },
46-
}),
47-
});
48-
});
49-
5029
await page.goto('/');
5130

5231
await expect(page.getByLabel('Page URL')).toBeVisible();
@@ -61,9 +40,6 @@ test.describe('frontend smoke', () => {
6140
await expect(page.getByRole('button', { name: 'Back' })).toBeVisible();
6241

6342
await page.getByRole('button', { name: 'Back' }).click();
64-
await expect(page.getByRole('button', { name: 'Generate feed URL' })).toBeVisible();
65-
66-
await page.goBack();
6743
await expect(page).toHaveURL(/\/create(?:\?.*)?$/);
6844
await expect(page.getByRole('button', { name: 'Generate feed URL' })).toBeVisible();
6945
await expect(page.locator('.form-shell')).toHaveAttribute('data-state', 'idle');
@@ -94,27 +70,6 @@ test.describe('frontend smoke', () => {
9470
});
9571
});
9672

97-
await page.route(/\/api\/v1\/strategies$/, async (route) => {
98-
await route.fulfill({
99-
status: 200,
100-
contentType: 'application/json',
101-
body: JSON.stringify({
102-
success: true,
103-
data: {
104-
strategies: [
105-
{ id: 'faraday', name: 'faraday', display_name: 'Default' },
106-
{
107-
id: 'browserless',
108-
name: 'browserless',
109-
display_name: 'JavaScript pages (recommended)',
110-
},
111-
],
112-
},
113-
meta: { total: 2 },
114-
}),
115-
});
116-
});
117-
11873
await page.addInitScript(() => {
11974
localStorage.setItem(
12075
'html2rss_feed_result_snapshot:generated-token',
@@ -125,7 +80,6 @@ test.describe('frontend smoke', () => {
12580
id: 'feed-123',
12681
name: 'Example Feed',
12782
url: 'https://example.com/articles',
128-
strategy: 'faraday',
12983
feed_token: 'generated-token',
13084
public_url: '/api/v1/feeds/generated-token',
13185
json_public_url: '/api/v1/feeds/generated-token.json',

frontend/playwright.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
import { existsSync } from 'node:fs';
12
import { defineConfig, devices } from '@playwright/test';
23

3-
const chromiumExecutablePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH;
4+
const chromiumExecutablePath =
5+
process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH || resolveChromiumExecutablePath();
6+
7+
function resolveChromiumExecutablePath(): string | undefined {
8+
const candidates = [
9+
'/usr/bin/chromium-browser',
10+
'/usr/bin/chromium',
11+
'/home/vscode/.cache/ms-playwright/chromium-1217/chrome-linux/chrome',
12+
];
13+
14+
return candidates.find((candidate) => existsSync(candidate));
15+
}
416

517
export default defineConfig({
618
testDir: './e2e',

0 commit comments

Comments
 (0)