coed icon indicating copy to clipboard operation
coed copied to clipboard

Add Playwright tests for all examples using gweld server

Open Copilot opened this issue 3 months ago • 0 comments

Converts all 10 examples in the examples folder into automated Playwright tests, replacing Parcel with @eeue56/gweld as the server.

Changes

  • Replaced Parcel with gweld: Updated all example package.json files to use npx @eeue56/gweld ./ 3000 for serving
  • Added esbuild bundling: Examples now bundle with esbuild (--bundle src/index.ts --outfile=src/index.js --format=esm) to resolve browser module imports
  • Playwright infrastructure:
    • Added playwright.config.ts with gweld webServer configuration
    • Created 10 test specs in tests/ directory validating each example's core functionality
    • Added test:playwright and test:serve npm scripts
  • Updated .gitignore: Excludes Playwright test results and generated JS bundles

Example Test

test("counter example loads and works", async ({ page }) => {
    await page.goto("/examples/counter/");
    await page.waitForSelector("#root button", { timeout: 10000 });
    
    const initialText = await page.locator("#root").textContent();
    expect(initialText).toContain("0");
    
    await page.click(".button-add");
    const afterAddText = await page.locator("#root").textContent();
    expect(afterAddText).toContain("1");
});

Run tests with npm run test:playwright.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.giphy.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderD (dns block)
  • elm-lang.org
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderD (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Turn all the examples into automated tests</issue_title> <issue_description>- Make every example in the examples folder a test via Playwright

  • Ensure each example uses @eeue56/gweld as the server rather than parcel or other tools </issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes eeue56/coed#6

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Nov 24 '25 00:11 Copilot