room-stage FTs: realign 4 fails to new my-sea NVM + spread-modal + landscape kit-bag UX — TDD
CI #346 test-FTs-room had 4 consistent fails (failed on both the first run AND the retry, so real, not flakes). All 4 are test-side — the shipped features are correct; the FTs lagged behind deliberate UX changes + a race they never needed to depend on. test_game_my_sea.py - test_nvm_navigates_back_to_gameboard → renamed test_nvm_navigates_back_to_ my_sea_hex; asserts /gameboard/my-sea/$ now. NVM on the gatekeeper navigates to the table hex, not out to /gameboard/ (changed5cade51: gatekeeper + picker NVM → hex; only landing + sign-gate eject to /gameboard/). Sibling test_gear_btn_opens_menu_with_nvm_only still passes (only checks the onclick contains /gameboard/). - test_default_spread_is_situation_action_outcome → add _open_spread_modal(self). The spread combobox moved into #id_sea_spread_modal (burger Sea sub-btn sprint); .sea-select-current .text returned '' while the modal was hidden. Mirrors the already-updated sibling test_picking_spread_swaps_*. test_trinket_carte_blanche.py (the recurring #344/#345/#346 carte fail) - Sign-gate Brief: replace the hard wait_for_slow(find .my-sea-sign-gate-brief) + NVM-click with dismiss_brief_if_present(). The Brief fires via Brief.showBanner on DOM-ready; its appearance is a DOM-ready-vs-note.js-load race, so under CI contention it sometimes never lands in-window and ANY hard wait throws NoSuchElement.a39053dmisdiagnosed this as a timeout (→ wait_for_slow); it is not. The test never asserts the Brief — it only clears it to unblock a later click. dismiss_brief_if_present removes it if present + no-ops if absent: robust to the race. - Kit-bag token select: JS-click the #id_kit_bag_dialog CARTE token. In landscape (CI default viewport) the kit-bag dialog is a vertical bar that slides in via a max-width transition (burger landscape refactor), so a Selenium .click races the animation + can't scroll the token into the overflow container ("could not be scrolled into view"). execute_script fires the bound handler directly. Applied in both carte tests (open_kit_and_select_carte + the in-use attribution flow); token-rails stays a normal click (it lives on the gate page, not in the dialog). Verification: all 4 methods green locally (landscape viewport) — test_carte_in_use_game_kit_shows_room_attribution 10.8s; the multi-slot carte + both my-sea methods 35.5s. Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -565,6 +565,7 @@ class MySeaSpreadFormTest(FunctionalTest):
|
||||
the hidden `<input id="id_sea_spread">` initial value + on
|
||||
`.my-sea-cross[data-spread]`."""
|
||||
picker = self._enter_picker_phase()
|
||||
_open_spread_modal(self) # .sea-select-current lives in the spread modal
|
||||
hidden = picker.find_element(By.CSS_SELECTOR, "#id_sea_spread")
|
||||
self.assertEqual(
|
||||
hidden.get_attribute("value"), "situation-action-outcome",
|
||||
@@ -1929,7 +1930,13 @@ class MySeaGearBtnTest(FunctionalTest):
|
||||
len(menu.find_elements(By.CSS_SELECTOR, ".btn-abandon")), 0,
|
||||
)
|
||||
|
||||
def test_nvm_navigates_back_to_gameboard(self):
|
||||
def test_nvm_navigates_back_to_my_sea_hex(self):
|
||||
# NVM on the my-sea gatekeeper navigates back to the my-sea table hex
|
||||
# (/gameboard/my-sea/), NOT out to /gameboard/ — changed 5cade51
|
||||
# (gatekeeper + picker NVM → table hex; only the landing + sign-gate
|
||||
# phases eject to /gameboard/). Sibling test_gear_btn_opens_menu_with_
|
||||
# nvm_only still passes since it only checks the onclick *contains*
|
||||
# /gameboard/.
|
||||
self.create_pre_authenticated_session(self.email)
|
||||
self.browser.get(self.live_server_url + "/gameboard/my-sea/gate/")
|
||||
gear = self.wait_for(
|
||||
@@ -1946,6 +1953,6 @@ class MySeaGearBtnTest(FunctionalTest):
|
||||
).click()
|
||||
self.wait_for(
|
||||
lambda: self.assertRegex(
|
||||
self.browser.current_url, r"/gameboard/$"
|
||||
self.browser.current_url, r"/gameboard/my-sea/$"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user