diff --git a/example-data/characters.json b/example-data/characters.json index 50035b2..283f693 100644 --- a/example-data/characters.json +++ b/example-data/characters.json @@ -19,4 +19,4 @@ "path": "01KHNYBPY85F6BZAJXZDSKBQY7.webp" } } -] \ No newline at end of file +] diff --git a/example-data/equipments.json b/example-data/equipments.json index 7dba3b6..712bcf8 100644 --- a/example-data/equipments.json +++ b/example-data/equipments.json @@ -107,4 +107,4 @@ "path": "01KHQ66H2X62ZFQ8E1WHK0DSFE.webp" } } -] \ No newline at end of file +] diff --git a/example-data/expressions.json b/example-data/expressions.json index b8ce734..d4e7f5d 100644 --- a/example-data/expressions.json +++ b/example-data/expressions.json @@ -80,4 +80,4 @@ "path": "01KHNY8VTPEQMHJ7X0C31F6YA6.webp" } } -] \ No newline at end of file +] diff --git a/example-data/looks.json b/example-data/looks.json index b1a945a..248e598 100644 --- a/example-data/looks.json +++ b/example-data/looks.json @@ -69,4 +69,4 @@ "01KHQ66H318BPBAE4ZFBY7JHBD" ] } -] \ No newline at end of file +] diff --git a/example-data/poses.json b/example-data/poses.json index 082467c..0937e9e 100644 --- a/example-data/poses.json +++ b/example-data/poses.json @@ -80,4 +80,4 @@ "path": "01KHNY603BYFF3M1RA5AWYHCD2.webp" } } -] \ No newline at end of file +] diff --git a/src/ui/pages/FittingRoom.tsx b/src/ui/pages/FittingRoom.tsx index f8c2b59..ee5fb50 100644 --- a/src/ui/pages/FittingRoom.tsx +++ b/src/ui/pages/FittingRoom.tsx @@ -122,7 +122,7 @@ export default function FittingRoom() { {character.name}

{character.name}

@@ -143,21 +143,21 @@ export default function FittingRoom() { {generations.length} LOOKS
- - {generations.length === 0 ? ( -
-
- -
-
-

No looks generated yet.

-

Create your first look to get started.

-
- + {generations.length === 0 ? ( +
+
+
- ) : ( +
+

No looks generated yet.

+

Create your first look to get started.

+
+ +
+ ) : ( +
{generations.map((gen) => (
))}
- )} - + + )}
diff --git a/verification/fitting_room_v2.png b/verification/fitting_room_v2.png new file mode 100644 index 0000000..ddf8fc7 Binary files /dev/null and b/verification/fitting_room_v2.png differ diff --git a/verification/verify_fitting_room_v2.py b/verification/verify_fitting_room_v2.py new file mode 100644 index 0000000..acf0c93 --- /dev/null +++ b/verification/verify_fitting_room_v2.py @@ -0,0 +1,49 @@ +from playwright.sync_api import Page, expect, sync_playwright + +def test_fitting_room_layout(page: Page): + print("Navigating to Characters page...") + # 1. Navigate to the Characters page (home) + page.goto("http://localhost:3000/characters") + + # 2. Click the character card named "Momo" + # Wait for network idle to ensure data is loaded + print("Waiting for network idle...") + page.wait_for_load_state("networkidle") + + # Locate and click Momo + print("Looking for Momo...") + # Using locator ensures we wait for it to appear + momo_locator = page.get_by_text("Momo", exact=True).first + if momo_locator.count() == 0: + # Fallback to loose match if exact fails + momo_locator = page.get_by_text("Momo").first + + momo_locator.click() + print("Clicked Momo.") + + # 3. Wait for Fitting Room to load + # Expect "Fitting Room" text or "Momo" (since name is displayed) + print("Waiting for Fitting Room...") + expect(page.get_by_text("Fitting Room")).to_be_visible() + + # Wait a bit for images to load + page.wait_for_timeout(1000) + + # 4. Take Screenshot of Fitting Room + print("Taking screenshot...") + page.screenshot(path="verification/fitting_room_v2.png") + print("Screenshot saved to verification/fitting_room_v2.png") + +if __name__ == "__main__": + with sync_playwright() as p: + browser = p.chromium.launch(headless=True) + # Set viewport to verify overflow behavior (standard desktop size) + context = browser.new_context(viewport={'width': 1280, 'height': 800}) + page = context.new_page() + try: + test_fitting_room_layout(page) + except Exception as e: + print(f"Error: {e}") + page.screenshot(path="verification/error_v2.png") + finally: + browser.close()