0.2.6-dev: the co-op browser test skips its one strategy turn only while 跳过 is enabled — since PR #546 the last player still to pick sees it disabled, which a random draft order gives the guest about one time in three; golden: unchanged
This commit is contained in:
1 parent
281cf01ff0
commit
3a6ec26127
1 file changed
+8
-1
@@ -1062,11 +1062,18 @@ describe('browser E2E against the real server', { skip: !ENABLED && 'needs Chrom
|
|||||||
if (!shotDraft.has(c.label)) { shotDraft.add(c.label); await sleep(700); await c.shot(s.draft?.turn === s.me ? 'draft-myturn' : 'draft-waiting'); }
|
if (!shotDraft.has(c.label)) { shotDraft.add(c.label); await sleep(700); await c.shot(s.draft?.turn === s.me ? 'draft-myturn' : 'draft-waiting'); }
|
||||||
if (picked.has(c.label) || s.draft?.turn !== s.me) continue;
|
if (picked.has(c.label) || s.draft?.turn !== s.me) continue;
|
||||||
if (c === guest && !guestSkipped) {
|
if (c === guest && !guestSkipped) {
|
||||||
await c.click('.draft-detail__btns .btn', '跳过');
|
|
||||||
guestSkipped = true;
|
guestSkipped = true;
|
||||||
|
// one skip — only while someone is left to pass to: the last player still to pick sees 跳过 disabled
|
||||||
|
// (PR #546), which a random draft order gives the guest about one time in three
|
||||||
|
const canSkip = await c.page.evaluate(() => [...document.querySelectorAll('.draft-detail__btns .btn')]
|
||||||
|
.some((b) => b.textContent.includes('跳过') && !b.disabled));
|
||||||
|
if (canSkip) {
|
||||||
|
await c.click('.draft-detail__btns .btn', '跳过');
|
||||||
c.note('band draft: skipped once');
|
c.note('band draft: skipped once');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
c.note('band draft: 跳过 disabled (the last player still to pick)');
|
||||||
|
}
|
||||||
if ((s.draft?.picks || 0) > 0) {
|
if ((s.draft?.picks || 0) > 0) {
|
||||||
// research 09 §5: a strategy a teammate (human or AI) picked is marked 队友已选 and cannot be chosen
|
// research 09 §5: a strategy a teammate (human or AI) picked is marked 队友已选 and cannot be chosen
|
||||||
await c.page.waitForSelector('.dband.is-taken .dband__taken', { timeout: 4000 });
|
await c.page.waitForSelector('.dband.is-taken .dband__taken', { timeout: 4000 });
|
||||||
|
|||||||
Reference in new issue
Block a user