mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
feat: add Playwright agent testability infrastructure
Add test harness (window.__bitvidTest__), data-testid attributes, relay override support, and Playwright fixtures so agents can programmatically login, seed relay data, and inspect app state during E2E testing. - js/testHarness.js: exposes loginWithNsec, getAppState, relay overrides - data-testid attrs on login/upload/video modals, header buttons, feed - simple-relay.mjs: HTTP seeding API (POST /seed, GET /events, /health) - bitvidTestFixture.ts: reusable Playwright fixture with mock relay - agent-testability.spec.ts: E2E tests validating the infrastructure https://claude.ai/code/session_01XnrszNmdqrAGd8g8qhAn4G
This commit is contained in:
13 files changed
+839
-29
No files matched your search
@@ -6,6 +6,7 @@
|
||||
aria-labelledby="loginModalTitle"
|
||||
aria-describedby="loginModalDescription"
|
||||
data-ds="new"
|
||||
data-testid="login-modal"
|
||||
>
|
||||
<div class="bv-modal-backdrop" data-dismiss></div>
|
||||
|
||||
@@ -91,6 +92,7 @@
|
||||
class="login-option"
|
||||
type="button"
|
||||
data-provider-button
|
||||
data-testid="login-provider-button"
|
||||
>
|
||||
<span class="login-option__header">
|
||||
<span class="login-option__copy">
|
||||
@@ -204,6 +206,7 @@
|
||||
spellcheck="false"
|
||||
autocomplete="off"
|
||||
data-nsec-secret
|
||||
data-testid="nsec-secret-input"
|
||||
></textarea>
|
||||
<label class="inline-flex items-center gap-2 text-sm text-text">
|
||||
<input type="checkbox" class="checkbox" data-nsec-remember />
|
||||
@@ -235,7 +238,7 @@
|
||||
</fieldset>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" class="btn-ghost" data-nsec-cancel>Cancel</button>
|
||||
<button type="submit" class="btn" data-nsec-submit>Continue</button>
|
||||
<button type="submit" class="btn" data-nsec-submit data-testid="nsec-submit">Continue</button>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
aria-labelledby="uploadModalTitle"
|
||||
aria-describedby="uploadModalDescription"
|
||||
data-ds="new"
|
||||
data-testid="upload-modal"
|
||||
>
|
||||
<div class="bv-modal-backdrop" data-dismiss></div>
|
||||
|
||||
@@ -192,12 +193,12 @@
|
||||
<div id="section-source-external" class="space-y-4 hidden">
|
||||
<div class="space-y-2">
|
||||
<label for="input-url" class="block text-sm font-medium text-text">Video URL</label>
|
||||
<input id="input-url" type="url" class="input" placeholder="https://example.com/video.mp4" />
|
||||
<input id="input-url" type="url" class="input" placeholder="https://example.com/video.mp4" data-testid="upload-url" />
|
||||
<p class="text-xs text-muted">Primary hosted video source (URL-first playback).</p>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<label for="input-magnet" class="block text-sm font-medium text-text">Magnet Link</label>
|
||||
<input id="input-magnet" type="text" class="input" placeholder="magnet:?xt=urn:btih:..." />
|
||||
<input id="input-magnet" type="text" class="input" placeholder="magnet:?xt=urn:btih:..." data-testid="upload-magnet" />
|
||||
<p class="text-xs text-muted">Optional WebTorrent fallback when the URL is unavailable.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,7 +209,7 @@
|
||||
<div class="space-y-4">
|
||||
<div class="space-y-2">
|
||||
<label for="input-title" class="block text-sm font-medium text-text">Title</label>
|
||||
<input id="input-title" type="text" required class="input" placeholder="Give your video a title" />
|
||||
<input id="input-title" type="text" required class="input" placeholder="Give your video a title" data-testid="upload-title" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
@@ -388,7 +389,7 @@
|
||||
|
||||
<!-- Submit -->
|
||||
<div class="pt-4">
|
||||
<button type="submit" id="btn-submit" class="btn w-full py-3 text-base font-semibold shadow-md">
|
||||
<button type="submit" id="btn-submit" class="btn w-full py-3 text-base font-semibold shadow-md" data-testid="upload-submit">
|
||||
Publish Video
|
||||
</button>
|
||||
<p id="submit-status" class="text-center text-xs text-muted mt-2"></p>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
data-ds="new"
|
||||
data-testid="video-modal"
|
||||
hidden
|
||||
>
|
||||
<div class="bv-modal-backdrop" data-dismiss></div>
|
||||
|
||||
Reference in new issue
Block a user