mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(runner): surface focus-tap errors in InputText (#12)
* fix(runner): surface focus-tap errors in InputText action A failed Tap/TapSelector before InputText was swallowed, so text typed into the wrong field (or no field) still reported success. Return the error so the step fails explicitly. * feat(sample-app): add username EditText and snapshot Gives the spec a real EditText target (content-desc: username_field) so the InputText action path can be exercised end-to-end. The typed value is mirrored into MainActivity.username and surfaced as the "username" snapshot for spec assertions. * feat(sample-app): exercise InputText action against username field Adds typeUsername action and usernameNeverShrinks property to the sample spec, and extends the integration test to assert the bundled spec emits an InputText(desc:username_field, "alice") action and that the property correctly violates when a snapshot reports a shorter string.
This commit is contained in:
6 files changed
+101
-8
No files matched your search
@@ -198,9 +198,13 @@ func applyAction(ctx context.Context, drv driver.Driver, action verifier.Action,
|
||||
return drv.Tap(ctx, x, y)
|
||||
case verifier.ActionKindInputText:
|
||||
if x, y, ok := resolveCoordinates(action, tree); ok {
|
||||
_ = drv.Tap(ctx, x, y)
|
||||
if err := drv.Tap(ctx, x, y); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if action.On != "" {
|
||||
_ = drv.TapSelector(ctx, action.On)
|
||||
if err := drv.TapSelector(ctx, action.On); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return drv.InputText(ctx, action.Text)
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user