File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ import logging
2
+
1
3
import pytest
4
+ from selenium .common .exceptions import TimeoutException
2
5
from selenium .webdriver import Firefox
3
6
from selenium .webdriver .support import expected_conditions as EC
4
7
@@ -36,10 +39,18 @@ def test_add_password_save_valid_data(driver: Firefox):
36
39
37
40
# Check password added in the listbox
38
41
logins = about_logins .get_elements ("login-list-item" )
39
- mozilla_login = any (
40
- [login for login in logins if login .get_attribute ("title" ) == WEBSITE_ADDRESS ]
41
- )
42
- assert mozilla_login
42
+ try :
43
+ about_logins .wait .until (
44
+ lambda _ : any (
45
+ [
46
+ login
47
+ for login in logins
48
+ if login .get_attribute ("title" ) == WEBSITE_ADDRESS
49
+ ]
50
+ )
51
+ )
52
+ except TimeoutException :
53
+ logging .warning ("A login was not saved." )
43
54
44
55
# Check the "Sort by:" dropdown from the top part of the Login list becomes active
45
56
login_sort = about_logins .get_element ("login-sort" )
You can’t perform that action at this time.
0 commit comments