Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 132 additions & 1 deletion packages/app/cypress/e2e/overview.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function expectNoVisibleDatesOrSnapshot() {
// Next.js RSC payload scripts retain evidence dates for reproducibility.
// Assert only against rendered page text, not serialized script/style data.
const clone = body.cloneNode(true) as HTMLElement;
clone.querySelectorAll('script, style').forEach((node) => node.remove());
clone.querySelectorAll('script, style, .sr-only').forEach((node) => node.remove());
return clone.textContent ?? '';
})
.should((text) => {
Expand Down Expand Up @@ -114,6 +114,137 @@ function textRect(element: Element) {
}

describe('Overview page', () => {
it('switches between B200 and 30-day comparison without losing page state', () => {
cy.viewport(1280, 900);
cy.visit('/overview');

cy.get('[data-testid="overview-page"]')
.children('[data-testid="overview-comparison-switcher"]')
.should('have.length', 1)
.and('have.class', 'justify-center');
cy.get('[data-testid="overview-comparison-switcher"]')
.should('have.attr', 'aria-label', 'Compare')
.within(() => {
cy.get('[data-overview-comparison="hardware"]')
.should('have.attr', 'aria-current', 'true')
.and('match', 'span')
.and('have.text', 'vs B200')
.then(([active]) => {
const style = getComputedStyle(active);
expect(style.borderBottomWidth).to.equal('2px');
expect(style.backgroundColor).to.match(/rgba\(0, 0, 0, 0\)|transparent/);
});
cy.get('[data-overview-comparison="history"]')
.should('have.attr', 'href', '/overview?compare=30d')
.and('have.text', '30-day change')
.click();
});

cy.location('search').should('eq', '?compare=30d');
cy.get('[data-testid="overview-comparison-switcher"]')
.find('[data-overview-comparison="history"]')
.should('have.attr', 'aria-current', 'true')
.and('match', 'span');
cy.get('[data-testid="overview-desktop-matrix"] thead').should('contain.text', 'B200');
cy.get('[data-testid="overview-desktop-matrix"] thead').should('not.contain.text', 'Reference');

cy.get('[data-testid="overview-tier-switcher"]')
.contains('a', '100')
.should('have.attr', 'href', '/overview?tier=100&compare=30d');
cy.get('[data-testid="overview-engine-scope-switcher"]')
.find('[data-overview-engine-scope="all"]')
.should('have.attr', 'href', '/overview?engine=all&compare=30d');
cy.get('[data-testid="language-toggle"]')
.should('have.attr', 'href', '/zh/overview?compare=30d')
.click();
cy.location('pathname').should('eq', '/zh/overview');
cy.location('search').should('eq', '?compare=30d');
cy.get('[data-testid="overview-comparison-switcher"]')
.should('have.attr', 'aria-label', '对比方式')
.within(() => {
cy.get('[data-overview-comparison="hardware"]').should('have.text', '对比 B200');
cy.get('[data-overview-comparison="history"]')
.should('have.attr', 'aria-current', 'true')
.and('have.text', '30 天变化');
});
cy.contains('当前成本及其相对 30–60 天前最近一次有效平台结果的变化。').should('exist');
cy.contains('缺少有效 30 天对比的平台仅显示当前成本。').should('exist');
});

it('compares each platform with its own validated result from 30–60 days earlier', () => {
cy.viewport(1280, 900);
cy.visit('/overview?compare=30d');

desktopModel('Qwen-3.5-397B-A17B', SINGLE_TURN).within(() => {
// Unlike the hardware view, B200 is a normal platform in the historical
// view and receives its own change badge and heat-map tint.
platform('b200')
.find('[data-testid="overview-cost-delta"]')
.as('b200HistoryDelta')
.should('have.attr', 'data-history-status', 'comparable')
.and('have.attr', 'data-cost-polarity', 'cheaper')
.and('contain.text', '-17%');
cy.get('@b200HistoryDelta')
.should(($badge) => {
expect($badge).not.to.have.attr('aria-label');
})
.find('.sr-only')
.should('have.text', '17% cheaper than this platform’s Jun 10 result');
platform('mi355x')
.find('[data-testid="overview-cost-delta"]')
.should('have.attr', 'data-history-status', 'comparable')
.and('have.attr', 'data-cost-polarity', 'cheaper')
.and('contain.text', '-25%');
platform('b300').find('[data-testid="overview-cost-delta"]').should('not.exist');
platform('b300').then(([cell]) => {
expect(getComputedStyle(cell.closest('td')!).backgroundColor).to.match(
/rgba\(0, 0, 0, 0\)|transparent/,
);
});
platform('gb200').find('[data-testid="overview-cost-delta"]').should('not.exist');
});

desktopModel('DeepSeek-V4-Pro', AGENTX).within(() => {
platform('b200')
.find('[data-testid="overview-cost-delta"]')
.should('have.attr', 'data-history-status', 'comparable');
platform('mi355x')
.find('[data-testid="overview-cost-delta"]')
.should('have.attr', 'data-history-status', 'comparable');
});

cy.contains(
'Current cost and change versus the latest validated platform result 30–60 days earlier.',
).should('exist');
cy.get('[data-testid="overview-cost-delta"]').should('not.contain.text', '∞');
cy.contains('Platforms without a valid 30-day comparison show current cost only.').should(
'exist',
);
expectNoVisibleDatesOrSnapshot();
});

it('keeps the historical comparison complete and non-scrolling across desktop, tablet and phone', () => {
for (const width of [320, 390, 768, 1024, 1279, 1280, 1440]) {
cy.viewport(width, 900);
cy.visit('/overview?compare=30d');

cy.get('[data-testid="overview-comparison-switcher"]')
.should('be.visible')
.find('[data-overview-comparison]')
.each(($option) => {
expect($option[0].getBoundingClientRect().height).to.be.at.least(44);
});
cy.get('[data-testid="overview-cost-delta"][data-hardware="b200"]').should('exist');
expectNoHorizontalOverflow();
if (width < 1280) {
expectNoHorizontalScroller('overview-mobile-list');
expectNoHorizontalScroller('overview-comparison-switcher');
} else {
expectNoHorizontalScroller('overview-desktop-matrix');
}
}
});

it('defaults to community engine scope and switches with canonical links preserving tier and locale', () => {
cy.viewport(1280, 900);
cy.visit('/overview');
Expand Down
206 changes: 206 additions & 0 deletions packages/app/cypress/fixtures/api/overview-history-rows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{
"Qwen-3.5-397B-A17B": [
{
"id": 1001,
"hardware": "b200",
"framework": "sglang",
"model": "qwen3.5",
"precision": "fp4",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "single_turn",
"isl": 8192,
"osl": 1024,
"conc": 8,
"offload_mode": "off",
"image": null,
"metrics": {
"median_intvty": 40,
"tput_per_gpu": 6000,
"output_tput_per_gpu": 667
},
"date": "2026-06-10",
"run_url": null
},
{
"id": 1002,
"hardware": "b200",
"framework": "sglang",
"model": "qwen3.5",
"precision": "fp4",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "single_turn",
"isl": 8192,
"osl": 1024,
"conc": 24,
"offload_mode": "off",
"image": null,
"metrics": {
"median_intvty": 80,
"tput_per_gpu": 4500,
"output_tput_per_gpu": 500
},
"date": "2026-06-10",
"run_url": null
},
{
"id": 1003,
"hardware": "mi355x",
"framework": "sglang",
"model": "qwen3.5",
"precision": "fp8",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "single_turn",
"isl": 8192,
"osl": 1024,
"conc": 12,
"offload_mode": "off",
"image": null,
"metrics": {
"median_intvty": 50,
"tput_per_gpu": 5000,
"output_tput_per_gpu": 568
},
"date": "2026-06-12",
"run_url": null
},
{
"id": 1004,
"hardware": "mi355x",
"framework": "sglang",
"model": "qwen3.5",
"precision": "fp8",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "single_turn",
"isl": 8192,
"osl": 1024,
"conc": 24,
"offload_mode": "off",
"image": null,
"metrics": {
"median_intvty": 120,
"tput_per_gpu": 3900,
"output_tput_per_gpu": 443
},
"date": "2026-06-12",
"run_url": null
}
],
"DeepSeek-V4-Pro": [
{
"id": 1005,
"hardware": "b200",
"framework": "sglang",
"model": "dsv4",
"precision": "fp4",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "agentic_traces",
"isl": null,
"osl": null,
"conc": 8,
"offload_mode": "off",
"image": null,
"metrics": {
"p90_itl": 0.02,
"p90_ttlt": 120,
"tput_per_gpu": 6000,
"output_tput_per_gpu": 667
},
"date": "2026-06-10",
"run_url": null
},
{
"id": 1006,
"hardware": "mi355x",
"framework": "sglang",
"model": "dsv4",
"precision": "fp4",
"spec_method": "mtp",
"disagg": false,
"is_multinode": false,
"prefill_tp": 8,
"prefill_ep": 1,
"prefill_dp_attention": false,
"prefill_num_workers": 1,
"decode_tp": 8,
"decode_ep": 1,
"decode_dp_attention": false,
"decode_num_workers": 1,
"num_prefill_gpu": 8,
"num_decode_gpu": 8,
"benchmark_type": "agentic_traces",
"isl": null,
"osl": null,
"conc": 8,
"offload_mode": "off",
"image": null,
"metrics": {
"p90_itl": 0.02,
"p90_ttlt": 130,
"tput_per_gpu": 5000,
"output_tput_per_gpu": 556
},
"date": "2026-06-10",
"run_url": null
}
]
}
Loading