mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Refactored scripts/hash-dist.mjs to export buildHashState and support module import. Modified scripts/build-dist.mjs to calculate the dist hash after asset rewriting and inject it along with the current date into dist/index.html below the tagline. Verified with Playwright screenshot. Co-authored-by: PR0M3TH3AN <[email protected]>
30 lines
942 B
Python
30 lines
942 B
Python
from playwright.sync_api import sync_playwright
|
|
|
|
def run():
|
|
with sync_playwright() as p:
|
|
browser = p.chromium.launch()
|
|
page = browser.new_page()
|
|
page.goto("http://localhost:3000")
|
|
|
|
# Locate the tagline
|
|
tagline = page.get_by_text("seed. zap. subscribe.")
|
|
|
|
# Locate the version info which should be nearby
|
|
# The tagline is an h2 inside a div.
|
|
container = tagline.locator("..")
|
|
|
|
# Wait for fade-in to settle or just force visibility?
|
|
# The container has "fade-in" class. It might take time.
|
|
# I'll wait for the version text to be visible.
|
|
version_locator = container.locator("div.text-xs")
|
|
version_locator.wait_for()
|
|
|
|
print("Version text found:", version_locator.inner_text())
|
|
|
|
# Screenshot the container
|
|
container.screenshot(path="verification.png")
|
|
browser.close()
|
|
|
|
if __name__ == "__main__":
|
|
run()
|