mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
feat(hierarchy): descPrefix selector for Compose testTag + UUID suffixes
This commit is contained in:
1 parent
fb6c3ca517
commit
eea9a0067a
2 files changed
+19
-3
No files matched your search
@@ -3,9 +3,10 @@
|
||||
//
|
||||
// Selector grammar (v0.1):
|
||||
//
|
||||
// id:<suffix> — match resource-id ending with ":id/<suffix>" or equal to <suffix>
|
||||
// text:<value> — exact match on the node's text
|
||||
// desc:<value> — exact match on the node's content-desc
|
||||
// id:<suffix> — match resource-id ending with ":id/<suffix>" or equal to <suffix>
|
||||
// text:<value> — exact match on the node's text
|
||||
// desc:<value> — exact match on the node's content-desc
|
||||
// descPrefix:<prefix> — startsWith match on the node's content-desc (e.g. Compose testTag + UUID)
|
||||
package hierarchy
|
||||
|
||||
import (
|
||||
@@ -133,6 +134,8 @@ func match(element *Element, kind, value string) bool {
|
||||
return element.Text == value
|
||||
case "desc":
|
||||
return element.Description == value
|
||||
case "descPrefix":
|
||||
return strings.HasPrefix(element.Description, value)
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user