mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 03:27:10 +00:00
refactor(chrome): split tag (HTML name) from class (CSS classList)
Hierarchy attributes now expose HTML tag under 'tag' and CSS classes under 'class', stopping the conflation of the two.
This commit is contained in:
1 parent
f850e573f8
commit
b213f2470b
1 file changed
+4
-1
@@ -206,7 +206,10 @@ func (d *Driver) Hierarchy(_ context.Context) (string, error) {
|
||||
if (el.id) attrs['resource-id'] = el.id;
|
||||
const label = el.getAttribute('aria-label') || el.getAttribute('alt') || el.getAttribute('title') || '';
|
||||
if (label) attrs['content-desc'] = label;
|
||||
if (el.tagName) attrs['class'] = el.tagName.toLowerCase();
|
||||
if (el.tagName) attrs['tag'] = el.tagName.toLowerCase();
|
||||
if (el.className && typeof el.className === 'string' && el.className.trim()) {
|
||||
attrs['class'] = el.className.trim();
|
||||
}
|
||||
if (isRoot) attrs['sanderling-screen'] = route;
|
||||
const isClickable = !!(el.onclick || el.tagName === 'A' || el.tagName === 'BUTTON' ||
|
||||
el.tagName === 'INPUT' || el.tagName === 'SELECT' ||
|
||||
|
||||
Reference in new issue
Block a user