Wait conditions¶
Wait conditions in Selenium are mechanisms that allow to wait for certain conditions before performing the next actions. They are used for synchronization between the test and the web application to ensure that elements or pages are fully loaded and ready for interaction. This helps to avoid errors related to elements not yet appearing on the page or not being fully loaded.
Pomcorn includes several custom waiting conditions that complement the built-in Selenium waiting list. Read about Selenium wait conditions.
Package wait conditions¶
element_not_exists_in_dom(element)
¶
Represent wait condition to check that element not exists in DOM.
Source code in pomcorn/waits_conditions.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
text_in_element_changes(element, old_text)
¶
Represent wait condition to check that text doesn't match old text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
PomcornElement[TLocator_co] | TLocator_co
|
The element in which the text will be checked. |
required |
old_text
|
str
|
The old text that should disappear. |
required |
Source code in pomcorn/waits_conditions.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
text_not_to_be_present_in_element_attribute(locator, attribute_, text_)
¶
Represent wait condition that checks that text is not in attribute.
NOTE: "_" in argument names added for consistent with selenium's built-in
wait condition text_to_be_present_in_element_attribute
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
locator
|
tuple[str, str]
|
A tuple with a By instance and a string value. You can get them from the Locators classes. |
required |
attribute_
|
str
|
Attribute name. |
required |
text_
|
str
|
Text that should disappear. |
required |
Source code in pomcorn/waits_conditions.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
url_not_matches(pattern)
¶
Represent wait condition to check that url doesn't match pattern.
Source code in pomcorn/waits_conditions.py
19 20 21 22 23 24 25 | |