Skip to content

Add Playwright E2E test suite with CI for intersection observer behavior#2

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-playwright-ci-test-suite
Open

Add Playwright E2E test suite with CI for intersection observer behavior#2
Copilot wants to merge 5 commits intomainfrom
copilot/add-playwright-ci-test-suite

Conversation

Copy link

Copilot AI commented Feb 16, 2026

Adds end-to-end testing infrastructure to validate intersection observer behavior: content loads only when scrolled into viewport and unloads when scrolled out.

Test Infrastructure

  • Playwright suite with 7 tests covering viewport-based lazy loading, content unloading, infinite scroll, and sequential loading
  • Express test server (tests/server.js) serving dynamic content via /api/load endpoint
  • Local htmx.min.js bundled for offline test execution
  • Tests use deterministic waits (waitForFunction, waitForResponse) rather than fixed timeouts

Test Page

tests/index.html demonstrates infinite scroll with:

  • Initial items with hx-trigger="intersect" and intersect-unload="content"
  • Dynamic load trigger that fires when scrolled into viewport
  • Stats dashboard tracking loaded/unloaded state
<div class="item" 
     hx-ext="intersect"
     hx-trigger="intersect"
     intersect-unload="content"
     intersect-unload-delay="500">
  <h3>Item Content</h3>
</div>

CI Integration

GitHub Actions workflow (.github/workflows/test.yml) runs on push/PR with:

  • Playwright browser installation
  • Automatic webServer startup via Playwright config
  • Explicit contents: read permission
  • Test artifact upload on completion

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:

  • unpkg.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-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=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-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=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl modules/@npmcli/run-script/lib/node-gyp-bin/node (dns block)
    • Triggering command: /usr/bin/curl curl -o tests/htmx.min.js REDACTED (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>Playwright test suite in CI</issue_title>
<issue_description>* Add github actions CI script

  • implement "infinite scroll" content web server with necessary endpoints (load, unload etc)
  • Add playwright test suite that tests basic library properties (content is loaded only when inside the viewport and unloaded otherwise)

Take inspiration from https://wanago.io/2024/04/29/react-infinite-scrolling-e2e-playwright/ for end-to-end web testing with playwright</issue_description>

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


✨ 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 AI and others added 4 commits February 16, 2026 09:21
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
…to devDependencies

Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Co-authored-by: ocramz <5902760+ocramz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Playwright test suite and CI script Add Playwright E2E test suite with CI for intersection observer behavior Feb 16, 2026
Copilot AI requested a review from ocramz February 16, 2026 09:30
@ocramz ocramz marked this pull request as ready for review February 16, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright test suite in CI

2 participants