@@ -10136,6 +10136,21 @@ def assert_element(self, selector, by="css selector", timeout=None):
1013610136 if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
1013710137 timeout = self.__get_new_timeout(timeout)
1013810138 if self.__is_cdp_swap_needed():
10139+ if self.demo_mode:
10140+ selector, by = self.__recalculate_selector(
10141+ selector, by, xp_ok=False
10142+ )
10143+ a_t = "ASSERT"
10144+ if self._language != "English":
10145+ from seleniumbase.fixtures.words import SD
10146+
10147+ a_t = SD.translate_assert(self._language)
10148+ messenger_post = "<b>%s %s</b>: %s" % (
10149+ a_t, by.upper(), selector
10150+ )
10151+ self.__highlight_with_assert_success(
10152+ messenger_post, selector, by
10153+ )
1013910154 self.cdp.assert_element(selector, timeout=timeout)
1014010155 return True
1014110156 if isinstance(selector, list):
@@ -10430,6 +10445,20 @@ def assert_text(
1043010445 messenger_post, selector, by
1043110446 )
1043210447 elif self.__is_cdp_swap_needed():
10448+ if self.demo_mode:
10449+ a_t = "ASSERT TEXT"
10450+ i_n = "in"
10451+ if self._language != "English":
10452+ from seleniumbase.fixtures.words import SD
10453+
10454+ a_t = SD.translate_assert_text(self._language)
10455+ i_n = SD.translate_in(self._language)
10456+ messenger_post = "<b>%s</b>: {%s} %s %s: %s" % (
10457+ a_t, text, i_n, by.upper(), selector
10458+ )
10459+ self.__highlight_with_assert_success(
10460+ messenger_post, selector, by
10461+ )
1043310462 self.cdp.assert_text(text, selector, timeout=timeout)
1043410463 return True
1043510464 elif self.__is_shadow_selector(selector):
0 commit comments