@@ -151,16 +151,16 @@ def _check_elements_displayed(
151151 if index is None :
152152 return all (e .is_displayed () == expected for e in elements )
153153 return elements [index ].is_displayed () == expected
154-
154+
155155 def is_displayed (
156- self ,
157- locator : Locator ,
158- expected : bool = True ,
159- n : int = 3 ,
160- condition : Literal ["clickable" , "visible" , "present" ] = "visible" ,
161- wait_type : Optional [WaitType ] = None ,
156+ self ,
157+ locator : Locator ,
158+ expected : bool = True ,
159+ n : int = 3 ,
160+ condition : Literal ["clickable" , "visible" , "present" ] = "visible" ,
161+ wait_type : Optional [WaitType ] = None ,
162162 ) -> None :
163- """ Checks for an element to be displayed or not, and asserts the visibility.
163+ """Checks for an element to be displayed or not, and asserts the visibility.
164164
165165 :param locator: A tuple containing the strategy and value of the element locator.
166166 :param expected: The expected visibility status of the element (True or False).
@@ -172,12 +172,14 @@ def is_displayed(
172172 wait_type = wait_type or WaitType .DEFAULT
173173 for _ in range (n ):
174174 try :
175- element = self .wait_for (locator , condition = condition , waiter = self ._get_waiter (wait_type ))
176- assert element .is_displayed ()== expected
175+ element = self .wait_for (
176+ locator , condition = condition , waiter = self ._get_waiter (wait_type )
177+ )
178+ assert element .is_displayed () == expected
177179 return
178180 except Exception :
179181 time .sleep (0.5 )
180- assert False == expected
182+ assert False == expected
181183
182184 def is_exist (
183185 self ,
0 commit comments