Skip to content

Commit

Permalink
Add note about check_page_is_loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
M1troll committed Dec 1, 2023
1 parent d8ac7d8 commit 8645aff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions demo/pages/base/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8645aff

Please sign in to comment.