From 8645aff603d21faff0abe84099e28f3c97c326cf Mon Sep 17 00:00:00 2001 From: Anton Oboleninov Date: Fri, 1 Dec 2023 08:45:45 +0700 Subject: [PATCH] Add note about `check_page_is_loaded` --- demo/pages/base/base_page.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/demo/pages/base/base_page.py b/demo/pages/base/base_page.py index f13a0ad..5a8d4c3 100644 --- a/demo/pages/base/base_page.py +++ b/demo/pages/base/base_page.py @@ -66,6 +66,13 @@ def check_page_is_loaded(self) -> bool: Check that `main` tag is displayed. """ + # Be careful with the elements you use to check page load. If you only + # use them to check loading, it's better to initiate them directly in + # this method. Otherwise, it is better to define them as page + # properties or initiate them in the `__init__` method above the + # `super().__init__` call. This is necessary because the + # `wait_until_loaded` method will be called in `super().__init__`, and + # it depends on `check_page_is_loaded`. return self.init_element( locator=locators.TagNameLocator("main"), ).is_displayed