merge: sync upstream/main into fork main (v0.15.2)

This commit is contained in:
leeguooooo
2026-03-03 09:57:17 +09:00
41 changed files with 1615 additions and 1505 deletions
+24
View File
@@ -361,6 +361,30 @@ describe('BrowserManager', () => {
});
});
describe('unnamed-button ref uniqueness', () => {
it('should click the correct unnamed button among named buttons', async () => {
const page = browser.getPage();
// 1 unnamed button among 2 named buttons
await page.setContent(`
<html><body>
<button>OK</button>
<button onclick="document.title='unnamed'"></button>
<button>Cancel</button>
</body></html>
`);
const snapshot = await browser.getSnapshot();
const refs = snapshot.refs;
const unnamedRefs = Object.entries(refs).filter(([, v]) => v.role === 'button' && !v.name);
expect(unnamedRefs.length).toBe(1);
const [refId] = unnamedRefs[0];
await executeCommand({ id: 'test', action: 'click', selector: `@${refId}` }, browser);
const title = await page.title();
expect(title).toBe('unnamed');
});
});
describe('cursor-ref selector uniqueness', () => {
it('should produce unique selectors for repeated DOM structures', async () => {
const page = browser.getPage();