ipfs / service-worker-gateway

[WIP EXPERIMENT] IPFS Gateway implemented in Service Worker
https://inbrowser.link
Other
17 stars 8 forks source link

test: sw.sgtpooki.com passes e2e tests #221

Closed SgtPooki closed 2 months ago

SgtPooki commented 2 months ago

Title

test: more robust e2e tests for deployed envs

Description

Notes & open questions

╰─ ✘ 1 ❯ BASE_URL="https://sw.sgtpooki.com" npm run test:deployed

> helia-service-worker-gateway@1.1.0 test:deployed
> playwright test -c playwright.config.js --project deployed

Running 17 tests using 5 workers

  -  1 [deployed] › byte-range.test.ts:5:3 › byte-ranges › should be able to get a single character
  -  2 [deployed] › byte-range.test.ts:13:3 › byte-ranges › can get 0-0 byte range from car with missing data
  ✓  3 [deployed] › first-hit.test.ts:114:5 › first-hit direct-hosted › subdomain-routing › requests to new pages are redirected (5.8s)
  -  4 [deployed] › byte-range.test.ts:20:3 › byte-ranges › can get trailing byte range from car with missing data
  ✓  5 [deployed] › first-hit.test.ts:45:5 › first-hit ipfs-hosted › subdomain-routing › redirects to ?helia-sw=<path> are handled (2.1s)
  -  6 [deployed] › first-hit.test.ts:87:5 › first-hit direct-hosted › path-routing › requests to new pages are redirected
  -  7 [deployed] › first-hit.test.ts:14:5 › first-hit ipfs-hosted › path-routing › redirects to ?helia-sw=<path> are handled
  -  8 [deployed] › hamt-dir.test.ts:4:3 › hamt-dir › can open UnixFS file from HAMT-sharded directory
  ✓  9 [deployed] › layout.test.ts:10:5 › smoketests › landing page › header visibility (1.8s)
  ✓  10 [deployed] › layout.test.ts:20:5 › smoketests › config page › opens when clicked (1.6s)
  ✓  11 [deployed] › layout.test.ts:27:5 › smoketests › config page › has multiple inputs and submit button (2.1s)
  -  12 [deployed] › path-routing.test.ts:4:3 › path-routing › can load identity CID via path
  ✓  13 [deployed] › subdomain-detection.test.ts:6:3 › subdomain-detection › path requests are redirected to subdomains (4.6s)
  ✓  14 [deployed] › subdomain-detection.test.ts:26:3 › subdomain-detection › enabling autoreload automatically loads the subdomain (3.5s)
  ✓  15 [deployed] › subdomain-detection.test.ts:37:3 › subdomain-detection auto fixture › loads subdomains easily (4.2s)
  -  16 [deployed] › website-loading.test.ts:4:3 › website-loading › ensure unixfs directory trailing slash is added
  -  17 [deployed] › website-loading.test.ts:12:3 › website-loading › ensure that index.html is returned for the root path

  9 skipped
  8 passed (24.9s)

Change checklist

SgtPooki commented 2 months ago

cc @aschmahmann. FYI that "allows users to load HTML page via filesystem in browser" that was added a long time ago is now unsupported. We can look into enabling later once we get our ideal envs working consistently.