Răsfoiți Sursa

do not use page representation for user.should_see

Rodja Trappe 2 ani în urmă
părinte
comite
5b9bd9640a
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      tests/user.py

+ 1 - 1
tests/user.py

@@ -43,7 +43,7 @@ class User():
                     raise RuntimeError('The NiceGUI server has stopped running')
                     raise RuntimeError('The NiceGUI server has stopped running')
 
 
     def should_see(self, text: str) -> None:
     def should_see(self, text: str) -> None:
-        assert text in self.page(), f'Could not find "{text}" on:\n{self.page()}'
+        assert self.selenium.title == text or self.find(text).text == text
 
 
     def click(self, target_text: str) -> None:
     def click(self, target_text: str) -> None:
         self.find(target_text).click()
         self.find(target_text).click()