mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
- Updates Upload Modal UI labels to be provider-agnostic (e.g., 'Storage Credentials', 'Endpoint'). - Implements a read-only 'Summary View' for configured storage connections, collapsing the editable form by default. - Adds 'Manage Storage' button that navigates to the Profile Modal's storage pane. - Updates `initUploadModal.js` to inject the navigation callback. - Updates `r2Service.js` status messages to be generic. - Fixes unlock flow to ensure UI updates after storage unlock.
46 lines
1.6 KiB
Python
46 lines
1.6 KiB
Python
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
def run():
|
|
with sync_playwright() as p:
|
|
browser = p.chromium.launch(headless=True)
|
|
page = browser.new_page()
|
|
|
|
# Load the HTML template file directly by fetching it and injecting it
|
|
# effectively unit-testing the template structure in a browser
|
|
page.goto("http://localhost:8080")
|
|
|
|
# Inject the modal HTML manually to verify the static changes
|
|
page.evaluate("""async () => {
|
|
const response = await fetch("/components/upload-modal.html");
|
|
const html = await response.text();
|
|
document.body.innerHTML = html;
|
|
document.getElementById("uploadModal").classList.remove("hidden");
|
|
document.getElementById("section-storage-settings").classList.remove("hidden");
|
|
}""")
|
|
|
|
# Wait for rendering
|
|
page.wait_for_selector("#uploadModal", state="visible")
|
|
|
|
# Check text
|
|
button_text = page.inner_text("#btn-storage-settings")
|
|
print(f"Button Text: {button_text}")
|
|
|
|
content = page.content()
|
|
if "Storage Configuration" in button_text:
|
|
print("Verified: Button text updated.")
|
|
|
|
if "Account ID / Endpoint" in content:
|
|
print("Verified: Account label updated.")
|
|
|
|
if "Public URL" in content:
|
|
print("Verified: Public URL label updated.")
|
|
|
|
page.screenshot(path="verification/upload_modal_static.png")
|
|
print("Screenshot saved to verification/upload_modal_static.png")
|
|
|
|
browser.close()
|
|
|
|
if __name__ == "__main__":
|
|
run()
|