|
8 | 8 |
|
9 | 9 | from PIL import Image |
10 | 10 | from lxml import etree |
11 | | -from selenium import webdriver |
12 | | -from selenium.common.exceptions import NoAlertPresentException |
13 | 11 | from selenium.common.exceptions import NoSuchElementException |
14 | | -from selenium.common.exceptions import NoSuchWindowException |
15 | 12 | from selenium.common.exceptions import TimeoutException |
16 | 13 |
|
17 | 14 | from autowebcompat import utils |
@@ -98,6 +95,22 @@ def get_elements_with_properties(driver, elem_properties, children): |
98 | 95 | return elems_with_same_properties |
99 | 96 |
|
100 | 97 |
|
| 98 | +def get_element_properties(driver, child): |
| 99 | + child_properties = driver.execute_script(""" |
| 100 | + let elem_properties = { |
| 101 | + tag: '', |
| 102 | + attributes: {}, |
| 103 | + }; |
| 104 | + for (let i = 0; i < arguments[0].attributes.length; i++) { |
| 105 | + elem_properties.attributes[arguments[0].attributes[i].name] = arguments[0].attributes[i].value; |
| 106 | + } |
| 107 | + elem_properties.tag = arguments[0].tagName; |
| 108 | + return elem_properties; |
| 109 | + """, child) |
| 110 | + |
| 111 | + return child_properties |
| 112 | + |
| 113 | + |
101 | 114 | def was_visited(current_path, visited_paths, elem_properties): |
102 | 115 | current_path_elements = [element for element, _, _ in current_path] |
103 | 116 | current_path_elements.append(elem_properties) |
@@ -378,7 +391,6 @@ def run_tests(firefox_driver, chrome_driver, bugs): |
378 | 391 | firefox_driver.quit() |
379 | 392 | chrome_driver.quit() |
380 | 393 |
|
381 | | -dd_argument('--user-agent=Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/M4B30Z) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36') |
382 | 394 |
|
383 | 395 | def main(bugs): |
384 | 396 | driver = Driver() |
|
0 commit comments