refactor(runner): drop hardcoded per-app selectors from step log (#10)

interestingTags hardcoded selectors from a specific app (etMobileNumber,
customer_row_, supplier_row_, etc.) inside the generic runner. None of
these selectors exist in the checked-in sample spec. Debug log now just
reports screen + hierarchy size; specs that want richer visibility can
log from state.ax.find themselves.
This commit is contained in:
pj authored and GitHub committed 2026-04-18 16:41:12 +07:00
1 parent 3b0393c2bb
commit b457e22569
1 file changed
+2 -29
+2 -29
View File
@@ -79,8 +79,8 @@ func Run(ctx context.Context, options Options) (Summary, error) {
if err := options.Verifier.PushSnapshot(verifier.Snapshots(snapshot.Snapshots), tree); err != nil {
return summary, fmt.Errorf("step %d push: %w", stepIndex, err)
}
fmt.Printf("step %d: screen=%q hierarchy=%d nodes tags=%v\n",
stepIndex, screenFromSnapshot(snapshot.Snapshots), treeSize, interestingTags(tree))
fmt.Printf("step %d: screen=%q hierarchy=%d nodes\n",
stepIndex, screenFromSnapshot(snapshot.Snapshots), treeSize)
verdicts := options.Verifier.EvaluateProperties()
violations := violationNames(verdicts)
@@ -231,33 +231,6 @@ func fetchHierarchy(ctx context.Context, drv driver.Driver) (*hierarchy.Tree, er
return hierarchy.Parse(xmlText)
}
// interestingTags collects a short summary of which selectors the current
// spec cares about are present, so we can read the log and see which
// generator gates will fire.
func interestingTags(tree *hierarchy.Tree) []string {
if tree == nil {
return nil
}
selectors := []string{
"id:select_language",
"id:etMobileNumber",
"id:otp",
"text:Sign Out Other Devices",
"text:Sign Out",
"text:Cancel",
"text:Skip",
"descPrefix:customer_row_",
"descPrefix:supplier_row_",
}
var hits []string
for _, selector := range selectors {
if elements := tree.FindAll(selector); len(elements) > 0 {
hits = append(hits, fmt.Sprintf("%s=%d", selector, len(elements)))
}
}
return hits
}
func traceActionFor(action verifier.Action) *trace.Action {
traceAction := &trace.Action{Kind: string(action.Kind)}
switch action.Kind {