|
| 1 | +// Focused smoke coverage for /overview. In fixtures mode the page is served by |
| 2 | +// the synthetic cypress/fixtures/api/overview-rows.json through the real data |
| 3 | +// builder, so every expected value below was derived by running the assembler |
| 4 | +// over that fixture (the drift guard in overview-data.test.ts locks the same |
| 5 | +// values) — never eyeballed. The fixture exercises every 8.7 state: coverage-driven |
| 6 | +// primary precision, ranked vs coverage secondary, all not-ranked reasons, and — |
| 7 | +// uniquely — a cross-day evidence range the live dataset does not produce. |
| 8 | + |
| 9 | +const MODEL_LABELS = [ |
| 10 | + 'DeepSeek V4 Pro 1.6T', |
| 11 | + 'Kimi K2.5/2.6/2.7-Code 1T', |
| 12 | + 'MiniMax M3 428B', |
| 13 | + 'GLM5.2', |
| 14 | + 'Qwen3.5 397B', |
| 15 | +]; |
| 16 | + |
| 17 | +/** The page must never scroll sideways: the whole comparison has to fit. */ |
| 18 | +function expectNoHorizontalOverflow() { |
| 19 | + cy.document().then((doc) => { |
| 20 | + expect(doc.documentElement.scrollWidth).to.be.lte(doc.documentElement.clientWidth); |
| 21 | + }); |
| 22 | +} |
| 23 | + |
| 24 | +/** |
| 25 | + * A narrow document is not enough: a table parked in an `overflow-x` region |
| 26 | + * keeps the document narrow while still scrolling sideways, so nothing inside |
| 27 | + * the surface may be wider than its own box either. `sr-only` clips (1px) and |
| 28 | + * non-replaced inline boxes are exempt — CSSOM reports a spurious `scrollWidth` |
| 29 | + * for inline boxes in Firefox, and `overflow` cannot apply to them anyway. |
| 30 | + */ |
| 31 | +function expectNoHorizontalScroller(testId: string) { |
| 32 | + cy.get(`[data-testid="${testId}"]`).then(([surface]) => { |
| 33 | + const scrollers = [surface, ...surface.querySelectorAll('*')] |
| 34 | + .filter( |
| 35 | + (el) => |
| 36 | + !el.classList.contains('sr-only') && |
| 37 | + getComputedStyle(el).display !== 'inline' && |
| 38 | + el.scrollWidth > el.clientWidth + 1, |
| 39 | + ) |
| 40 | + .map((el) => `${el.tagName} ${el.scrollWidth}>${el.clientWidth}`); |
| 41 | + expect(scrollers, `horizontally scrollable inside ${testId}`).to.deep.equal([]); |
| 42 | + }); |
| 43 | +} |
| 44 | + |
| 45 | +function desktopModel(model: string) { |
| 46 | + return cy.get(`[data-testid="overview-desktop-model"][data-model="${model}"]`); |
| 47 | +} |
| 48 | + |
| 49 | +describe('Overview page', () => { |
| 50 | + it('summarizes every active model without interactive widgets', () => { |
| 51 | + cy.viewport(1280, 800); |
| 52 | + cy.visit('/overview'); |
| 53 | + |
| 54 | + cy.contains('h1', 'AI Inference Overview').should('exist'); |
| 55 | + cy.get('[data-testid="overview-desktop-matrix"]').should('be.visible'); |
| 56 | + cy.get('[data-testid="overview-desktop-matrix"] h2').should('have.length', MODEL_LABELS.length); |
| 57 | + for (const label of MODEL_LABELS) { |
| 58 | + cy.get('[data-testid="overview-desktop-matrix"]').should('contain.text', label); |
| 59 | + } |
| 60 | + // Database-wide freshness line + the methodology footnote's once-per-page note. |
| 61 | + cy.contains('Database snapshot through Jul 18').should('exist'); |
| 62 | + cy.contains( |
| 63 | + 'The default precision maximizes comparable hardware coverage. Not ranked does not mean slower.', |
| 64 | + ).should('exist'); |
| 65 | + // A one-glance summary, not an interactive widget. |
| 66 | + cy.get('[data-testid="overview-desktop-matrix"]').within(() => { |
| 67 | + cy.get('details, summary, button').should('not.exist'); |
| 68 | + }); |
| 69 | + }); |
| 70 | + |
| 71 | + it('ranks the primary precision, dates each read, and accounts for every hardware', () => { |
| 72 | + cy.viewport(1280, 800); |
| 73 | + cy.visit('/overview'); |
| 74 | + |
| 75 | + desktopModel('DeepSeek-V4-Pro').within(() => { |
| 76 | + // Primary precision, its leader, and the runner-up's own signed delta (ASCII minus). |
| 77 | + cy.contains('FP4 · PRIMARY @50').should('exist'); |
| 78 | + cy.contains('B300').should('exist'); |
| 79 | + cy.contains('1,122').should('exist'); |
| 80 | + cy.contains('Leader').should('exist'); |
| 81 | + cy.contains('-20%').should('exist'); |
| 82 | + // FP8 measured one platform → one compact coverage line, not a second table. |
| 83 | + cy.contains('FP8 coverage: GB200 NVL72 measured; insufficient comparable results.').should( |
| 84 | + 'exist', |
| 85 | + ); |
| 86 | + // Leader @50 is bracketed by two run days (en-dash range); same-day reads and |
| 87 | + // the @100 read (its own leader) collapse to a single date. |
| 88 | + cy.contains('Jun 24–Jul 4').should('exist'); |
| 89 | + cy.contains('Jul 18').should('exist'); |
| 90 | + cy.contains('381').should('exist'); |
| 91 | + cy.contains('Only exact result').should('exist'); |
| 92 | + // Every remaining hardware carries one reason, both clamp directions included. |
| 93 | + cy.contains('cannot reach @50').should('exist'); |
| 94 | + cy.contains('no exact @50 result').should('exist'); |
| 95 | + cy.contains('no 8K/1K data').should('exist'); |
| 96 | + cy.contains('standard decode only').should('exist'); |
| 97 | + // Each ranked value links into its own pre-filtered dashboard view. |
| 98 | + cy.get('a[href*="i_gpus="]') |
| 99 | + .first() |
| 100 | + .should('have.attr', 'href') |
| 101 | + .and('include', 'g_model=DeepSeek-V4-Pro') |
| 102 | + .and('include', 'i_gpus=b300_sglang_mtp') |
| 103 | + .and('include', 'i_spec=mtp'); |
| 104 | + }); |
| 105 | + }); |
| 106 | + |
| 107 | + it('opens a ranked secondary only when the other precision adds comparable hardware', () => { |
| 108 | + cy.viewport(1280, 800); |
| 109 | + cy.visit('/overview'); |
| 110 | + |
| 111 | + // Qwen: FP8 ranks a comparable pair AND adds MI355X, so it renders subordinate rows. |
| 112 | + desktopModel('Qwen-3.5-397B-A17B').within(() => { |
| 113 | + cy.contains('FP4 · PRIMARY @50').should('exist'); |
| 114 | + cy.contains('FP8 @50').should('exist'); |
| 115 | + cy.contains('MI355X').should('exist'); |
| 116 | + cy.contains('760').should('exist'); |
| 117 | + cy.contains('-16%').should('exist'); |
| 118 | + }); |
| 119 | + // MiniMax: wider exact-@50 FP8 coverage flips the primary precision to FP8; |
| 120 | + // FP4 falls back to a single-hardware coverage line. |
| 121 | + desktopModel('MiniMax-M3').within(() => { |
| 122 | + cy.contains('FP8 · PRIMARY @50').should('exist'); |
| 123 | + cy.contains('FP4 coverage: H200 measured; insufficient comparable results.').should('exist'); |
| 124 | + }); |
| 125 | + }); |
| 126 | + |
| 127 | + it('stacks on a 390px phone with no sideways scroll', () => { |
| 128 | + cy.viewport(390, 844); |
| 129 | + cy.visit('/overview'); |
| 130 | + |
| 131 | + cy.get('[data-testid="overview-mobile-list"]').should('be.visible'); |
| 132 | + cy.get('[data-testid="overview-desktop-matrix"]').should('not.be.visible'); |
| 133 | + cy.get('[data-testid="overview-mobile-list"]').within(() => { |
| 134 | + cy.get('details, summary, button').should('not.exist'); |
| 135 | + }); |
| 136 | + expectNoHorizontalOverflow(); |
| 137 | + expectNoHorizontalScroller('overview-mobile-list'); |
| 138 | + }); |
| 139 | + |
| 140 | + it('renders the Chinese sibling with the same hierarchy and the per-GPU unit', () => { |
| 141 | + cy.viewport(1280, 800); |
| 142 | + cy.visit('/zh/overview'); |
| 143 | + |
| 144 | + cy.contains('h1', 'AI 推理总览').should('exist'); |
| 145 | + cy.contains('输出 tok/s/GPU').should('exist'); |
| 146 | + desktopModel('DeepSeek-V4-Pro').within(() => { |
| 147 | + cy.contains('FP4 · 主排名 @50').should('exist'); |
| 148 | + }); |
| 149 | + cy.contains('默认精度优先覆盖更多可比较硬件。未参与排名不代表性能更低。').should('exist'); |
| 150 | + }); |
| 151 | +}); |
0 commit comments