wired PICK SKY server-side polarity countdown via threading.Timer (tasks.py); fixed polarity_done overlay gating on refresh; cleared sig-select floats on overlay dismiss; filtered Redact events from Most Recent applet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -372,15 +372,15 @@ class SigSelectThemeTest(FunctionalTest):
|
||||
self.assertEqual(corr.text, "")
|
||||
|
||||
|
||||
# ── TAKE SIG / WAIT NO — ready gate ──────────────────────────────────────────
|
||||
# ── TAKE SIG / WAIT NVM — ready gate ──────────────────────────────────────────
|
||||
#
|
||||
# TAKE SIG (.btn.btn-primary) appears at the bottom-left corner of the card
|
||||
# stage preview once a gamer has clicked OK on a card (SigReservation exists).
|
||||
# Clicking it sets the gamer's status to ready and changes the btn to WAIT NO.
|
||||
# WAIT NO cancels the ready status and reverts back to TAKE SIG.
|
||||
# Clicking it sets the gamer's status to ready and changes the btn to WAIT NVM.
|
||||
# WAIT NVM cancels the ready status and reverts back to TAKE SIG.
|
||||
#
|
||||
# When all three gamers in a polarity WS room are ready, a 12-second countdown
|
||||
# starts. Any WAIT NO during the countdown cancels it; the saved remaining time
|
||||
# starts. Any WAIT NVM during the countdown cancels it; the saved remaining time
|
||||
# is resumed when all three are ready again. When the countdown completes
|
||||
# (client POSTs sig_confirm) the polarity group returns to the table hex.
|
||||
# When both polarity groups have confirmed, PICK SKY btn appears in the hex
|
||||
@@ -390,7 +390,7 @@ class SigSelectThemeTest(FunctionalTest):
|
||||
|
||||
|
||||
class SigReadyGateTest(FunctionalTest):
|
||||
"""Single-browser tests for TAKE SIG / WAIT NO btn."""
|
||||
"""Single-browser tests for TAKE SIG / WAIT NVM btn."""
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
@@ -450,7 +450,7 @@ class SigReadyGateTest(FunctionalTest):
|
||||
)
|
||||
self.assertIn("TAKE SIG", take_sig_btn.text.upper())
|
||||
|
||||
# ── SRG3: TAKE SIG → WAIT NO ─────────────────────────────────────── #
|
||||
# ── SRG3: TAKE SIG → WAIT NVM ─────────────────────────────────────── #
|
||||
|
||||
def test_take_sig_btn_becomes_wait_no_after_click(self):
|
||||
room = self._setup_sig_room()
|
||||
@@ -467,9 +467,16 @@ class SigReadyGateTest(FunctionalTest):
|
||||
wait_no_btn = self.wait_for(
|
||||
lambda: self.browser.find_element(By.ID, "id_take_sig_btn")
|
||||
)
|
||||
self.assertIn("WAIT NO", wait_no_btn.text.upper())
|
||||
self.assertIn("WAIT NVM", wait_no_btn.text.upper())
|
||||
|
||||
# ── SRG4: WAIT NO → TAKE SIG ─────────────────────────────────────── #
|
||||
# WAIT NVM pulses a --terOr glow: btn-cancel class appears within one tick
|
||||
self.wait_for(
|
||||
lambda: "btn-cancel" in self.browser.find_element(
|
||||
By.ID, "id_take_sig_btn"
|
||||
).get_attribute("class")
|
||||
)
|
||||
|
||||
# ── SRG4: WAIT NVM → TAKE SIG ─────────────────────────────────────── #
|
||||
|
||||
def test_wait_no_reverts_to_take_sig(self):
|
||||
room = self._setup_sig_room()
|
||||
@@ -481,8 +488,8 @@ class SigReadyGateTest(FunctionalTest):
|
||||
btn = self.wait_for(
|
||||
lambda: self.browser.find_element(By.ID, "id_take_sig_btn")
|
||||
)
|
||||
btn.click() # → WAIT NO
|
||||
self.wait_for(lambda: "WAIT NO" in self.browser.find_element(
|
||||
btn.click() # → WAIT NVM
|
||||
self.wait_for(lambda: "WAIT NVM" in self.browser.find_element(
|
||||
By.ID, "id_take_sig_btn").text.upper()
|
||||
)
|
||||
btn = self.browser.find_element(By.ID, "id_take_sig_btn")
|
||||
@@ -562,20 +569,21 @@ class SigReadyCountdownChannelsTest(ChannelsFunctionalTest):
|
||||
)
|
||||
b.find_element(By.ID, "id_take_sig_btn").click()
|
||||
|
||||
# All three browsers should now see the countdown
|
||||
# All three browsers should now see the countdown button (numeral text)
|
||||
for b in browsers:
|
||||
self.wait_for(
|
||||
lambda: b.find_element(By.ID, "id_sig_countdown"), browser=b
|
||||
lambda: b.find_element(By.ID, "id_take_sig_btn").text.isdigit(),
|
||||
browser=b,
|
||||
)
|
||||
finally:
|
||||
for b in browsers:
|
||||
b.quit()
|
||||
|
||||
# ── SRG6: countdown disappears when WAIT NO clicked ──────────────── #
|
||||
# ── SRG6: countdown disappears when WAIT NVM clicked ──────────────── #
|
||||
|
||||
@tag("channels")
|
||||
def test_countdown_disappears_when_any_levity_gamer_clicks_wait_no(self):
|
||||
"""Any WAIT NO during the countdown cancels it for all three browsers."""
|
||||
"""Any WAIT NVM during the countdown cancels it for all three browsers."""
|
||||
room, emails = self._setup_sig_select_room()
|
||||
levity_emails = [emails[0], emails[1], emails[3]]
|
||||
browsers = []
|
||||
@@ -600,19 +608,20 @@ class SigReadyCountdownChannelsTest(ChannelsFunctionalTest):
|
||||
)
|
||||
b.find_element(By.ID, "id_take_sig_btn").click()
|
||||
|
||||
# Confirm countdown started for all
|
||||
# Confirm countdown started for all (button text is a numeral)
|
||||
for b in browsers:
|
||||
self.wait_for(
|
||||
lambda: b.find_element(By.ID, "id_sig_countdown"), browser=b
|
||||
lambda: b.find_element(By.ID, "id_take_sig_btn").text.isdigit(),
|
||||
browser=b,
|
||||
)
|
||||
|
||||
# PC clicks WAIT NO
|
||||
# PC clicks the countdown button to cancel
|
||||
browsers[0].find_element(By.ID, "id_take_sig_btn").click()
|
||||
|
||||
# Countdown element should disappear for all three
|
||||
# Countdown should cancel for all three (button back to WAIT NVM)
|
||||
for b in browsers:
|
||||
self.wait_for(
|
||||
lambda: len(b.find_elements(By.ID, "id_sig_countdown")) == 0,
|
||||
lambda: b.find_element(By.ID, "id_take_sig_btn").text == "WAIT NVM",
|
||||
browser=b,
|
||||
)
|
||||
finally:
|
||||
@@ -666,8 +675,9 @@ class SigReadyCountdownChannelsTest(ChannelsFunctionalTest):
|
||||
b.find_element(By.ID, "id_take_sig_btn").click()
|
||||
|
||||
# Wait for countdown to expire or be confirmed; PICK SKY appears in hex
|
||||
# countdown is 12 s so use wait_for_slow (MAX_WAIT=10 is not enough)
|
||||
for b in browsers:
|
||||
self.wait_for(
|
||||
self.wait_for_slow(
|
||||
lambda: b.find_element(By.ID, "id_pick_sky_btn"), browser=b
|
||||
)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user