@@ -5,33 +5,30 @@ import { test, expect } from '@playwright/test';
55 * real-backend browser verification that closed objectui#2546 (PR4: legacy
66 * monolith detail renderer + `renderViaSchema` kill-switch removed).
77 *
8- * Three shapes, all through the single SchemaRenderer /
9- * `buildDefaultPageSchema` path the console now has. The default record page
10- * draws no stage bar (`record:path`) and no key-field strip
11- * (`record:highlights`) — objectstack#35891 — so every case asserts both
12- * absent: the stage is the status tag beside the record's name, and
13- * `highlightFields` leaves every field in its group.
14- * - grouped → fieldGroup sections render, highlighted members
15- * included; `collapse: 'collapsed'` actually collapses
16- * (Money hides `amount` and `budget` until opened); the
17- * header's stage tag reads `stageField: 'status'`
18- * - stageField:false → NO stage tag despite a `status` field named to bait
19- * the heuristic
8+ * Four shapes, one invariant each, all through the single SchemaRenderer /
9+ * `buildDefaultPageSchema` path the console now has:
10+ * - grouped → fieldGroup sections render; `collapse: 'collapsed'`
11+ * actually collapses (Money hides `budget` until opened)
12+ * - ungrouped → flat details body, no section cards
13+ * - stageField:false → NO `record:path` stepper despite a `status` field
14+ * named to bait the heuristic
2015 * - related-heavy → related lists surface by prominence (ADR-0085), in the
2116 * one-column stack tier (objectstack#27524): a
2217 * `relatedList: 'primary'` list is a body table in the
23- * details (objectstack#27055, Target 8) and takes no tab;
24- * the rest are tabs of the tab row (objectstack#35595),
25- * and one with records is a card of the 概览 tab's rail
26- * below the details (objectstack#35596)
18+ * details (objectstack#27055, Target 8), the rest are
19+ * panels of the right column below them and read their
20+ * rows when they come into view
2721 *
2822 * Runs against the console the backend serves at /_console (baseURL from
2923 * playwright.config.ts; storageState carries the admin session). The
3024 * semantic-zoo fixtures are objects but not seeded records — each run
3125 * creates its own rows via the REST API.
3226 *
33- * The grouped case also pins objectui#2577's UX contract: group
34- * icon/description render, and currencyConfig money shows its symbol.
27+ * Assertions are scoped to what the *pinned* console build supports
28+ * (.objectui-sha). The fb35e48 bump brought in objectui#2577, so the grouped
29+ * case also pins the follow-up UX contract: highlight strip drops the record
30+ * title, group icon/description render, and currencyConfig money shows its
31+ * symbol.
3532 */
3633
3734// Ambient `process` for the env reads below — the showcase tsconfig doesn't pull
@@ -47,9 +44,6 @@ const recordUrl = (object: string, id: string) =>
4744 `/_console/apps/${ APP } /${ object } /record/${ encodeURIComponent ( id ) } ` ;
4845
4946const PATH_STEPPER = '[aria-label="Record path"]' ;
50- const HIGHLIGHT_STRIP = 'section[aria-label="Record highlights"]' ;
51- /** The header's stage tag, plain or as its menu, carries the field it reads. */
52- const stageTag = ( field : string ) => `[data-record-stage-tag="${ field } "]:visible` ;
5347
5448let zooId = '' ;
5549let zooLegacyId = '' ;
@@ -101,20 +95,24 @@ async function openRecord(page: import('@playwright/test').Page, url: string) {
10195test ( 'grouped: fieldGroup sections render and Money starts collapsed' , async ( { page } ) => {
10296 const errors = await openRecord ( page , recordUrl ( 'showcase_semantic_zoo' , zooId ) ) ;
10397
104- // objectstack#35891: no stage bar and no key-field strip. The stage
105- // (stageField: 'status') is the header's tag beside the record's name.
106- await expect ( page . locator ( PATH_STEPPER ) ) . toHaveCount ( 0 ) ;
107- await expect ( page . locator ( HIGHLIGHT_STRIP ) ) . toHaveCount ( 0 ) ;
108- await expect ( page . locator ( stageTag ( 'status' ) ) . first ( ) ) . toHaveText ( / A c t i v e / ) ;
109-
110- // Declared groups render as titled sections, every member in its own
111- // group: the highlighted ones (status in Basics, amount in Money) are not
112- // taken out of them.
113- const details = page . locator ( '[data-record-column="details"]' ) ;
114- await expect ( details . getByText ( 'Basics' , { exact : true } ) ) . toBeVisible ( ) ;
115- await expect ( details . getByText ( 'Money' , { exact : true } ) ) . toBeVisible ( ) ;
116- await expect ( details . getByText ( 'ZG-1' ) ) . toBeVisible ( ) ;
117- await expect ( details . getByText ( 'Status' , { exact : true } ) ) . toBeVisible ( ) ;
98+ // Stepper from stageField: 'status'.
99+ // record:path renders a desktop + a mobile variant — assert the visible one.
100+ await expect ( page . locator ( PATH_STEPPER ) . first ( ) ) . toBeVisible ( ) ;
101+
102+ // objectui#2577: the record title is the page H1 — it must NOT repeat as a
103+ // (truncated) chip in the highlight strip; status/amount still do.
104+ const strip = page . locator ( 'section[aria-label="Record highlights"]' ) ;
105+ await expect ( strip ) . toBeVisible ( ) ;
106+ const stripText = ( await strip . innerText ( ) ) . replace ( / \s + / g, ' ' ) ;
107+ expect ( stripText , 'strip repeats the record title' ) . not . toContain ( 'E2E Zoo' ) ;
108+ expect ( stripText ) . toContain ( '4,200' ) ;
109+
110+ // Declared groups render as titled sections. Their highlighted members
111+ // (status/amount) are hoisted to the strip; the non-highlighted members
112+ // (code/budget) keep the groups visible in the body.
113+ await expect ( page . getByText ( 'Basics' , { exact : true } ) ) . toBeVisible ( ) ;
114+ await expect ( page . getByText ( 'Money' , { exact : true } ) ) . toBeVisible ( ) ;
115+ await expect ( page . getByText ( 'ZG-1' ) ) . toBeVisible ( ) ;
118116
119117 // objectui#2577: fieldGroups[].icon renders as a real (Lucide svg) icon in
120118 // the section header — not as literal icon-name text.
@@ -132,13 +130,10 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
132130 ) . toBeVisible ( ) ;
133131 await expect ( page . getByText ( 'banknote' , { exact : true } ) ) . toHaveCount ( 0 ) ;
134132
135- // collapse: 'collapsed' — Amount and Budget stay hidden until the header is
136- // opened; then both are in the Money group.
137- await expect ( details . getByText ( 'Budget' , { exact : true } ) ) . toHaveCount ( 0 ) ;
138- await expect ( details . getByText ( '4,200' ) ) . toHaveCount ( 0 ) ;
133+ // collapse: 'collapsed' — Budget stays hidden until the header is opened.
134+ await expect ( page . getByText ( 'Budget' , { exact : true } ) ) . toHaveCount ( 0 ) ;
139135 await page . getByText ( 'Money' , { exact : true } ) . click ( ) ;
140- await expect ( details . getByText ( 'Budget' , { exact : true } ) ) . toBeVisible ( ) ;
141- await expect ( details . getByText ( '4,200' ) ) . toBeVisible ( ) ;
136+ await expect ( page . getByText ( 'Budget' , { exact : true } ) ) . toBeVisible ( ) ;
142137 // objectui#2577: fieldGroups[].description renders under the expanded
143138 // header, and the fixed-mode currencyConfig.defaultCurrency (USD) drives a
144139 // real $ symbol.
@@ -148,31 +143,28 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
148143 expect ( errors , 'uncaught page errors on grouped detail' ) . toEqual ( [ ] ) ;
149144} ) ;
150145
151- test ( 'stageField:false: status renders as a plain field, no stage tag ' , async ( { page } ) => {
146+ test ( 'stageField:false: status renders as a plain field, no stepper ' , async ( { page } ) => {
152147 const errors = await openRecord (
153148 page ,
154149 recordUrl ( 'showcase_semantic_zoo_legacy' , zooLegacyId ) ,
155150 ) ;
156151
157152 // The whole point of `stageField: false`: the status-named select must NOT
158- // become the header's stage tag. (objectui#2168 pinned strict-false
159- // handling.) No stage bar or strip either, as on every default page.
160- await expect ( page . locator ( '[data-record-stage-tag]' ) ) . toHaveCount ( 0 ) ;
153+ // become a chevron path. (objectui#2168 pinned strict-false handling.)
161154 await expect ( page . locator ( PATH_STEPPER ) ) . toHaveCount ( 0 ) ;
162- await expect ( page . locator ( HIGHLIGHT_STRIP ) ) . toHaveCount ( 0 ) ;
163155 // …but the field itself still renders (as a value, not a lifecycle).
164156 await expect ( page . getByText ( 'Green' ) . first ( ) ) . toBeVisible ( ) ;
165157
166158 expect ( errors , 'uncaught page errors on stageField:false detail' ) . toEqual ( [ ] ) ;
167159} ) ;
168160
169- test ( 'related-heavy: body tables, the tab row and the rail on Contoso' , async ( { page } ) => {
161+ test ( 'ungrouped + related-heavy: flat details and the related panels on Contoso' , async ( { page } ) => {
170162 // The synthesized record page lays itself out by the width of the view it
171163 // occupies, by one rule (objectstack#26678, objectstack#27524): details |
172164 // the right column from `RECORD_PAGE_TWO_COLUMN_MIN_WIDTH` (760 px,
173165 // `@object-ui/plugin-detail`), and ONE column below it — the details, then
174- // the 概览 tab 's rail. The tab row (objectstack#35595) is drawn in every
175- // tier. The case stays in that stack tier on purpose: the column tiers are what every
166+ // the right column 's panels in their order. No tier draws a tab strip. The
167+ // case stays in that stack tier on purpose: the column tiers are what every
176168 // other page of this smoke draws at the Desktop Chrome viewport, and the
177169 // stack is also what the split pane (720 px) and a phone draw.
178170 //
@@ -203,24 +195,21 @@ test('related-heavy: body tables, the tab row and the rail on Contoso', async ({
203195 await page . getByTestId ( 'sidebar-keep-open' ) . click ( ) ;
204196 await expect ( page . getByTestId ( 'sidebar-keep-open' ) ) . toHaveAttribute ( 'aria-pressed' , 'true' ) ;
205197
206- // objectstack#35891: no stage bar, no key-field strip; the heuristic stage
207- // (account.status is a select named "status") is the header's tag.
208- await expect ( page . locator ( PATH_STEPPER ) ) . toHaveCount ( 0 ) ;
209- await expect ( page . locator ( HIGHLIGHT_STRIP ) ) . toHaveCount ( 0 ) ;
210- await expect ( page . locator ( stageTag ( 'status' ) ) . first ( ) ) . toBeVisible ( ) ;
198+ // Heuristic stepper (account.status is a select named "status").
199+ // record:path renders a desktop + a mobile variant — assert the visible one.
200+ await expect ( page . locator ( PATH_STEPPER ) . first ( ) ) . toBeVisible ( ) ;
211201
212- // One column: the details, then the rail. The tab row opens on 概览 .
202+ // One column and no tab strip : the details, then the right column .
213203 await expect ( page . locator ( '[data-record-page-tier]' ) ) . toHaveAttribute ( 'data-record-page-tier' , 'stack' ) ;
214204 await expect ( page . locator ( '[data-record-columns]' ) ) . toHaveAttribute ( 'data-record-columns-shown' , 'details' ) ;
215- await expect ( page . locator ( '[data-record- tab="overview"]' ) ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
205+ await expect ( page . getByRole ( ' tab' , { name : / D e t a i l s | R e l a t e d | I n v o i c e s | P r o j e c t s / i } ) ) . toHaveCount ( 0 ) ;
216206
217207 // Related lists surface by prominence (ADR-0085), as record page v3 draws
218208 // them (objectstack#27055, Target 8): Invoices and Projects are
219209 // `relatedList: 'primary'` (CORE relationships), so each is a body table in
220- // the details, with its rows read at open, and takes no tab of its own; the
221- // rest of Contoso's lists (Contacts and the Field Zoo lookups) are tabs, and
222- // one with records is a card of the rail (objectstack#35596).
223- await expect ( page . locator ( '[data-record-tab^="showcase_invoice."], [data-record-tab^="showcase_project."]' ) ) . toHaveCount ( 0 ) ;
210+ // the details, with its rows read at open; the rest of Contoso's lists
211+ // (Contacts and the Field Zoo lookups) are panels of the right column,
212+ // before its last panel, 动态 (objectstack#34590).
224213 const details = page . locator ( '[data-record-column="details"]' ) ;
225214 const invoicesTable = details
226215 . getByRole ( 'table' )
@@ -231,27 +220,29 @@ test('related-heavy: body tables, the tab row and the rail on Contoso', async ({
231220 await expect ( invoicesTable . getByRole ( 'cell' , { name : 'INV-1002' , exact : true } ) ) . toBeVisible ( ) ;
232221 await expect ( projectsTable . getByRole ( 'cell' , { name : 'Data Platform' , exact : true } ) ) . toBeVisible ( ) ;
233222 const rightColumn = page . locator ( '[data-record-column="right"]' ) ;
223+ // objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
224+ await expect ( rightColumn . locator ( ':scope > *' ) . last ( ) ) . toHaveAttribute ( 'data-record-timeline-panel' , '' ) ;
234225 await expect ( rightColumn . getByRole ( 'region' , { name : / ^ ( I n v o i c e s | P r o j e c t s ) $ / } ) ) . toHaveCount ( 0 ) ;
235226
236- // Contoso's own groups render in the details (ADR-0085 §5), its highlighted
237- // fields among their members.
238- await expect ( details . getByText ( 'Profile ' , { exact : true } ) ) . toBeVisible ( ) ;
227+ // Ungrouped shape: the details body is flat — no fieldGroup section cards.
228+ // (Contoso declares no fieldGroups; spot-check a body field label.)
229+ await expect ( page . getByText ( 'Basics ' , { exact : true } ) ) . toHaveCount ( 0 ) ;
239230
240- // objectui#2577 + currencyConfig: annual revenue (a highlighted field, left
241- // in its Profile group) renders with its symbol in the details, and the
242- // meta footer doesn't dangle "Created by" on the actor-less seeded row.
243- await expect ( details . getByText ( '$25,000,000' , { exact : false } ) . first ( ) ) . toBeVisible ( ) ;
231+ // objectui#2577 + currencyConfig: annual revenue renders with its symbol
232+ // in the strip, and the meta footer doesn't dangle "Created by" on the
233+ // actor-less seeded row.
234+ await expect ( page . getByText ( '$25,000,000' , { exact : false } ) . first ( ) ) . toBeVisible ( ) ;
244235 const footer = page . locator ( '[data-testid="record-meta-footer"]' ) ;
245236 await expect ( footer ) . toBeVisible ( ) ;
246237 const footerText = ( await footer . innerText ( ) ) . replace ( / \s + / g, ' ' ) ;
247238 expect ( footerText , 'footer dangles "Created by" without an actor' ) . not . toMatch ( / C r e a t e d b y / ) ;
248239 expect ( footerText ) . toMatch ( / C r e a t e d / ) ;
249240
250- // The rail's Contacts card summarizes the Contacts tab: its first rows,
251- // Contoso's seeded contacts among them .
252- const contactsCard = rightColumn . getByRole ( 'region' , { name : 'Contacts' , exact : true } ) ;
253- await contactsCard . scrollIntoViewIfNeeded ( ) ;
254- await expect ( contactsCard . locator ( '[data-record-summary -row]' ) . filter ( { hasText : 'Carl Fox' } ) ) . toBeVisible ( ) ;
241+ // A panel reads its rows once it is in view: below the details here, so
242+ // the Contacts panel reads Contoso's seeded contacts when scrolled to .
243+ const contactsPanel = rightColumn . getByRole ( 'region' , { name : 'Contacts' , exact : true } ) ;
244+ await contactsPanel . scrollIntoViewIfNeeded ( ) ;
245+ await expect ( contactsPanel . locator ( '[data-related-card -row]' ) . filter ( { hasText : 'Carl Fox' } ) ) . toBeVisible ( ) ;
255246
256247 expect ( errors , 'uncaught page errors on related-heavy detail' ) . toEqual ( [ ] ) ;
257248} ) ;
0 commit comments