diff --git a/src/functional_tests/test_game_my_sea.py b/src/functional_tests/test_game_my_sea.py index c5aa615..fb64d1b 100644 --- a/src/functional_tests/test_game_my_sea.py +++ b/src/functional_tests/test_game_my_sea.py @@ -565,6 +565,7 @@ class MySeaSpreadFormTest(FunctionalTest): the hidden `` 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/$" ) ) diff --git a/src/functional_tests/test_trinket_carte_blanche.py b/src/functional_tests/test_trinket_carte_blanche.py index 02edb6c..f6e271b 100644 --- a/src/functional_tests/test_trinket_carte_blanche.py +++ b/src/functional_tests/test_trinket_carte_blanche.py @@ -85,21 +85,16 @@ class CarteBlancheTest(FunctionalTest): self.browser.get(self.live_server_url + "/gameboard/") self.wait_for(lambda: self.browser.find_element(By.ID, "id_game_kit")) - # 1a. Dismiss the My-Sea sign-gate Brief that auto-fires for new users - # without a sig. The Brief slides in via `Brief.showBanner` on DOM- - # ready + obscures the create-game-btn (step 8 below). The prior - # version of the test had a 5+ second hover/wait at step 2 (Free - # Token tooltip — now removed) that masked the race; without that - # wait, we have to explicitly dismiss the banner before proceeding. - # `wait_for_slow` (60s ceiling) — under CI contention the Brief's - # DOM-ready handler can land past wait_for's 10s default; CI #345 - # hit this exact NoSuchElement timeout. - self.wait_for_slow( - lambda: self.browser.find_element(By.CSS_SELECTOR, ".my-sea-sign-gate-brief") - ) - self.browser.find_element( - By.CSS_SELECTOR, ".my-sea-sign-gate-brief .btn-cancel" - ).click() + # 1a. Clear the My-Sea sign-gate Brief that auto-fires for new users + # without a sig — it slides in via `Brief.showBanner` on DOM-ready and + # can obscure the create-game-btn (step 8 below). Earlier revisions + # hard-WAITED for the banner (wait_for, then wait_for_slow), but its + # appearance is a DOM-ready-vs-note.js-load race: under CI contention + # it sometimes never lands in-window, so the wait threw NoSuchElement + # (the recurring CI #344/#345/#346 carte fail). We don't assert the + # Brief here — we just need it gone. dismiss_brief_if_present DOM- + # removes it if present and no-ops if absent: robust to the race. + self.dismiss_brief_if_present() # 2. (REMOVED 2026-05-26) Free Token used to live in the Game Kit # applet here + served as the "non-trinket, no mini-tooltip" example. @@ -190,16 +185,18 @@ class CarteBlancheTest(FunctionalTest): def open_kit_and_select_carte(): self.browser.find_element(By.ID, "id_kit_btn").click() - self.wait_for( + token = self.wait_for( lambda: self.browser.find_element( By.CSS_SELECTOR, f'#id_kit_bag_dialog [data-token-type="{Token.CARTE}"]', ) ) - self.browser.find_element( - By.CSS_SELECTOR, - f'#id_kit_bag_dialog [data-token-type="{Token.CARTE}"]', - ).click() + # JS-click: in landscape (CI default viewport) the kit-bag dialog + # is a vertical bar that slides in via a max-width transition, so a + # Selenium .click races the animation and can't scroll the token + # into view inside the overflow container ("could not be scrolled + # into view"). execute_script fires the bound handler directly. + self.browser.execute_script("arguments[0].click()", token) def deposit_carte(): self.browser.find_element(By.CSS_SELECTOR, "button.token-rails").click() @@ -353,6 +350,9 @@ class CarteBlancheTest(FunctionalTest): self.create_pre_authenticated_session("blanche@test.io") self.browser.get(self.live_server_url + "/gameboard/") self.wait_for(lambda: self.browser.find_element(By.ID, "id_game_kit")) + # Clear the sign-gate Brief if it fired (see the multi-slot test) so it + # can't obscure the New Game applet's create-game-btn below. + self.dismiss_brief_if_present() # DON the Carte Blanche via tooltip portal carte_el = self.browser.find_element(By.ID, "id_kit_carte_blanche") @@ -379,12 +379,16 @@ class CarteBlancheTest(FunctionalTest): self.wait_for(lambda: self.assertIn("/gate/", self.browser.current_url)) self.browser.find_element(By.ID, "id_kit_btn").click() - self.wait_for( + token = self.wait_for( lambda: self.browser.find_element( By.CSS_SELECTOR, f'#id_kit_bag_dialog [data-token-type="{Token.CARTE}"]', ) - ).click() + ) + # JS-click — landscape kit-bag dialog slide-in animation (see the + # multi-slot test's open_kit_and_select_carte); bypasses the "could + # not be scrolled into view". + self.browser.execute_script("arguments[0].click()", token) self.browser.find_element(By.CSS_SELECTOR, "button.token-rails").click() self.wait_for( lambda: self.browser.find_element(By.CSS_SELECTOR, ".token-slot.claimed")