From b457e22569145e4e38b05f40609772dabaf10a73 Mon Sep 17 00:00:00 2001 From: pjay Date: Sat, 18 Apr 2026 16:41:12 +0700 Subject: [PATCH] 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. --- internal/runner/runner.go | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index 1960ebe..50a3bcc 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -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 {