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
2 changes: 1 addition & 1 deletion scripts/benchmark_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function workload(page, scenario) {
viewport.dispatchEvent(new MouseEvent('mousemove', { clientX: box.x + box.width / 2, clientY: box.y + box.height / 2 }));
const rotation = document.querySelector('[aria-label="Auto-rotate weekly velocity"]');
rotation.click(); rotation.click();
document.querySelector('[aria-label="Reset weekly velocity camera"]').click();
document.querySelector('[aria-label="Reset View for weekly velocity camera"]').click();
document.querySelector('#tab-prs').click();
const search = document.querySelector('#table-search');
for (const value of ['no-benchmark-match', '']) {
Expand Down
4 changes: 2 additions & 2 deletions src/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def build_html_report(analytics_data, home_href=None):
</div>
<div class="three-controls">
<button class="three-btn active" id="btn-3d-vel-autorotate" aria-label="Auto-rotate weekly velocity" aria-pressed="true" onclick="toggleAutoRotate('vel')">Auto-Rotate</button>
<button class="three-btn" aria-label="Reset weekly velocity camera" onclick="resetCamera('vel')">Reset View</button>
<button class="three-btn" aria-label="Reset View for weekly velocity camera" onclick="resetCamera('vel')">Reset View</button>
</div>
</div>
<div class="three-viewport" id="viewport-velocity">
Expand All @@ -1097,7 +1097,7 @@ def build_html_report(analytics_data, home_href=None):
</div>
<div class="three-controls">
<button class="three-btn active" id="btn-3d-cad-autorotate" aria-label="Auto-rotate day and hour cadence" aria-pressed="true" onclick="toggleAutoRotate('cad')">Auto-Rotate</button>
<button class="three-btn" aria-label="Reset day and hour cadence camera" onclick="resetCamera('cad')">Reset View</button>
<button class="three-btn" aria-label="Reset View for day and hour cadence camera" onclick="resetCamera('cad')">Reset View</button>
</div>
</div>
<div class="three-viewport" id="viewport-cadence">
Expand Down
4 changes: 4 additions & 0 deletions tests/browser/accessibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const { openReport, root } = require('./fixture');
test('nine named visualizations expose complete equivalent data and accessible structure', async ({ page }) => {
await openReport(page);
const metrics = JSON.parse(await fs.readFile(path.join(root, 'test-results/metrics.json'), 'utf8'));
for (const reset of await page.getByRole('button', { name: /^Reset View/ }).all()) {
await expect(reset).toHaveAccessibleName(new RegExp(await reset.innerText()));
}
await expect(page.getByRole('button', { name: /^Reset View/ })).toHaveCount(2);
const regions = page.locator('[data-visualization]');
await expect(regions).toHaveCount(9);
await expect(page.locator('canvas[role="img"][aria-label][aria-describedby]')).toHaveCount(9);
Expand Down
2 changes: 1 addition & 1 deletion tests/browser/controls.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('bundled OrbitControls orbits by dragging and buttons stop and reset the sc
await expect.poll(() => page.evaluate(start => velCamera.position.toArray()
.reduce((sum, value, i) => sum + Math.abs(value - start[i]), 0), before)).toBeGreaterThan(1);
// Reset while drag momentum is still decaying; it must not drift off the default view.
await page.getByRole('button', { name: 'Reset weekly velocity camera' }).click();
await page.getByRole('button', { name: 'Reset View for weekly velocity camera' }).click();
await page.waitForTimeout(300);
await expect.poll(() => page.evaluate(() => velCamera.position.toArray()
.reduce((sum, value, i) => sum + Math.abs(value - [28, 26, 36][i]), 0))).toBeLessThan(0.1);
Expand Down
Loading