console fill play-app-record: read the real account chooser, match names loosely
With the copied Chrome profile, `console fill play-app-record` stopped with "no developer account named "<name>" (play.developerAccount) on the chooser" although the name was there: the real "Choose developer account" rows are not plain /developers/<id> text links (nested spans, icon-font glyphs, role=button rows with the id in a data attribute, an avatar row whose id only its click reveals). - readChooser: every visible clickable row in the page content (header and navigation left out); the name is the first visible line (icon fonts, images and aria-hidden parts skipped); the id comes from /developers/<id> in any attribute, else a data-*id attribute, else '' (the row is then opened through the account-switch gate and the id is read from the URL). "Create a new developer account" is not an account. - matchAccount: exact spelling, then spaces and case aside (Turkish I/ı folded), then a unique prefix. A case pair (ACME / Acme) needs the exact spelling; otherwise it stops and lists both with their ids. - One developer account: picked (a different play.developerAccount is said). Not found: every visible account is listed with its id. - The resolved developerId is remembered as before. Fixtures play-chooser-real.html (the owner's chooser shape, placeholder names) and play-chooser-one.html; tests for exact, case pair, prefix, single account and not found.
This commit is contained in:
parent
81313b6fa4
commit
8b669f5c86
5 changed files with 244 additions and 32 deletions
14
tests/fixtures/console/play-chooser-one.html
vendored
Normal file
14
tests/fixtures/console/play-chooser-one.html
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<!-- MODELED: Play Console's "Choose developer account" for a Google login with ONE developer account (an avatar row
|
||||
whose id only its click shows) plus "Create a new developer account", which is not an account. Placeholder data. -->
|
||||
<html lang="en"><head><meta charset="utf-8"><title>Choose developer account - Play Console</title><script src="/_common.js"></script></head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Choose developer account</h1>
|
||||
<div role="list">
|
||||
<div role="listitem"><div role="button" tabindex="0" id="only"><img alt="Example AI" width="24" height="24" src="data:image/gif;base64,R0lGODlhAQABAAAAACw="><span>Example AI</span></div></div>
|
||||
<div role="listitem"><a href="/signup"><span class="material-icons">add</span><span>Create a new developer account</span></a></div>
|
||||
</div>
|
||||
</main>
|
||||
<script>document.getElementById('only').addEventListener('click', () => { location.href = './developers/7000000005/app-list'; });</script>
|
||||
</body></html>
|
||||
30
tests/fixtures/console/play-chooser-real.html
vendored
Normal file
30
tests/fixtures/console/play-chooser-real.html
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<!-- MODELED from an owner's screenshot of Play Console's account chooser (the account names replaced by placeholders, the
|
||||
shape kept): a page titled "Choose developer account" whose rows are NOT plain text links.
|
||||
Rows mix the shapes seen in Material lists: an icon font glyph (its ligature text, e.g. "account_circle", sits in
|
||||
the row's text), nested spans with a second line, a role=button row with the id in a data attribute, and one row
|
||||
with an avatar image and no id at all (only its click shows where it goes). Two accounts differ only in case
|
||||
(NORTHWIND / Northwind). "Create a new developer account" must never be read as an account nor clicked. A header with
|
||||
its own buttons sits above. Ids are placeholders. -->
|
||||
<html lang="en"><head><meta charset="utf-8"><title>Choose developer account - Play Console</title><script src="/_common.js"></script>
|
||||
<style>.material-icons { font-family: monospace; } .sub { display: block; color: #666; font-size: 12px; } .row { display: flex; gap: 8px; align-items: center; padding: 6px; cursor: pointer; }</style></head>
|
||||
<body>
|
||||
<header><button type="button" aria-label="Help">?</button> <button type="button">Example Owner</button></header>
|
||||
<main>
|
||||
<h1>Choose developer account</h1>
|
||||
<div role="list">
|
||||
<div role="listitem"><a class="row" href="./developers/7000000001/app-list"><span class="material-icons" aria-hidden="true">account_circle</span><span><span>Studio's Apps</span><span class="sub">Developer account</span></span></a></div>
|
||||
<div role="listitem"><a class="row" href="./developers/7000000002/app-list"><span class="material-icons">account_circle</span><span><span>NORTHWIND</span></span></a></div>
|
||||
<div role="listitem"><div class="row" role="button" tabindex="0" data-developer-id="7000000003"><mat-icon class="material-icons">account_circle</mat-icon><span>Northwind</span></div></div>
|
||||
<div role="listitem"><div class="row" role="button" tabindex="0" data-account-id="7000000004"><mat-icon class="material-icons">account_circle</mat-icon><span><span>Example Org</span> <span class="sub">Organization</span></span></div></div>
|
||||
<div role="listitem"><div class="row" role="button" tabindex="0" id="avatar-row"><img alt="Example AI" width="24" height="24" src="data:image/gif;base64,R0lGODlhAQABAAAAACw="><span><span>Example</span> <span>AI</span></span></div></div>
|
||||
<div role="listitem"><a class="row" href="/signup"><span class="material-icons">add</span><span>Create a new developer account</span></a></div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
document.querySelectorAll('[data-developer-id], [data-account-id]').forEach(r => r.addEventListener('click', () => {
|
||||
location.href = `./developers/${r.getAttribute('data-developer-id') || r.getAttribute('data-account-id')}/app-list`;
|
||||
}));
|
||||
document.getElementById('avatar-row').addEventListener('click', () => { location.href = './developers/7000000005/app-list'; });
|
||||
</script>
|
||||
</body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue