Skip to content

Commit 3ae6183

Browse files
rdhyeeclaude
andauthored
Fix last 3 xfail tests — all 52 now pass (#107)
- Homepage showcase: use .quarto-layout-cell img[data-group='showcase'] selector to match Quarto's layout-ncol rendering - Vocabulary detail: correct URL to models/generated/vocabularies/ material_type.html and match section headings + Definition paragraphs Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 191c5ec commit 3ae6183

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

tests/test_homepage_features.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,22 @@
66
77
Wireframe ref: Figma frame [33:425] Home
88
"""
9-
import pytest
109
from conftest import SITE_URL
1110

1211

1312
class TestHomepageShowcase:
1413
"""Scenario: Showcase gallery displays real sample images."""
1514

16-
@pytest.mark.xfail(reason="Not yet tested: #104 P0 — showcase gallery")
1715
def test_showcase_has_four_images(self, page):
1816
"""Given I am on the homepage, Then I should see 4 showcase images."""
1917
page.goto(SITE_URL, wait_until="domcontentloaded")
20-
images = page.locator(".quarto-figure img, .lightbox img")
18+
images = page.locator(".quarto-layout-cell img[data-group='showcase']")
2119
assert images.count() >= 4
2220

2321
def test_showcase_images_have_alt_text(self, page):
2422
"""And each showcase image should have alt text."""
2523
page.goto(SITE_URL, wait_until="domcontentloaded")
26-
images = page.locator(".quarto-figure img, .lightbox img")
24+
images = page.locator(".quarto-layout-cell img[data-group='showcase']")
2725
for i in range(images.count()):
2826
alt = images.nth(i).get_attribute("alt")
2927
assert alt and len(alt) > 0, f"Image {i} missing alt text"

tests/test_vocabularies.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
77
Wireframe ref: Figma frame [130:1300] Architecture & Vocabularies
88
"""
9-
import pytest
109
from conftest import SITE_URL
1110

1211

1312
VOCAB_URL = f"{SITE_URL}/models/index.html"
13+
MATERIAL_TYPE_URL = f"{SITE_URL}/models/generated/vocabularies/material_type.html"
1414

1515

1616
class TestVocabularyIndex:
@@ -41,17 +41,16 @@ def test_vocabulary_links_resolve(self, page):
4141
class TestVocabularyDetail:
4242
"""Scenario: Individual vocabulary pages show concept hierarchy."""
4343

44-
@pytest.mark.xfail(reason="Not yet tested: #104 P1 — vocabulary detail page")
4544
def test_material_type_has_hierarchy(self, page):
46-
"""Given I navigate to a vocabulary detail page, Then I see a concept tree."""
47-
page.goto(f"{SITE_URL}/models/materialType.html", wait_until="domcontentloaded")
48-
# SKOS concepts should render as nested lists or tree
49-
concepts = page.locator("li a, .concept-label")
45+
"""Given I navigate to a vocabulary detail page, Then I see concept sections."""
46+
page.goto(MATERIAL_TYPE_URL, wait_until="domcontentloaded")
47+
# Vocabulary pages render concepts as numbered sections (h2, h3, h4)
48+
concepts = page.locator("section[id] h2, section[id] h3, section[id] h4")
5049
assert concepts.count() >= 5
5150

52-
@pytest.mark.xfail(reason="Not yet tested: #104 P1 — vocabulary definitions")
5351
def test_concepts_have_definitions(self, page):
54-
"""And each concept should have a definition or description."""
55-
page.goto(f"{SITE_URL}/models/materialType.html", wait_until="domcontentloaded")
56-
definitions = page.locator("dd, .concept-definition, blockquote")
52+
"""And each concept should have a definition."""
53+
page.goto(MATERIAL_TYPE_URL, wait_until="domcontentloaded")
54+
# Definitions rendered as <p><strong>Definition: </strong>...</p>
55+
definitions = page.locator("p:has(strong:has-text('Definition'))")
5756
assert definitions.count() >= 3

0 commit comments

Comments
 (0)