refactor(runner): caller manages app launch/terminate

Removes Launch + Terminate from runner.Run so the CLI can launch
the app first, wait for the SDK to connect, then start the loop.
The previous shape forced runner to launch internally which fought
with the SDK-must-be-connected-first ordering.

BundleID/ClearState fields go away too since runner no longer
launches; the CLI keeps them on its testOptions struct.
This commit is contained in:
pj committed 2026-04-18 00:51:39 +07:00
1 parent 0c68e72341
commit e7b3e2ba9c
2 files changed
+4 -19

No files matched your search

-9
View File
@@ -129,7 +129,6 @@ func TestRunner_HappyPathStepsAndTraces(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
summary, err := Run(ctx, Options{
BundleID: "com.fixture",
Duration: 100 * time.Millisecond,
SnapshotTimeout: 2 * time.Second,
IdleTimeout: 50 * time.Millisecond,
@@ -149,15 +148,9 @@ func TestRunner_HappyPathStepsAndTraces(t *testing.T) {
}
actions := state.mock.Actions()
if !containsAction(actions, mockdriver.ActionLaunch, "com.fixture") {
t.Errorf("expected Launch with com.fixture, got %v", actions)
}
if !containsAction(actions, mockdriver.ActionTapSelector, "id:next") {
t.Errorf("expected TapSelector with id:next, got %v", actions)
}
if !containsAction(actions, mockdriver.ActionTerminate, "") {
t.Errorf("expected Terminate, got %v", actions)
}
}
func TestRunner_ViolationSurfacesInSummary(t *testing.T) {
@@ -173,7 +166,6 @@ func TestRunner_ViolationSurfacesInSummary(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
summary, err := Run(ctx, Options{
BundleID: "com.fixture",
Duration: 100 * time.Millisecond,
SnapshotTimeout: 2 * time.Second,
IdleTimeout: 50 * time.Millisecond,
@@ -223,7 +215,6 @@ func TestRunner_RecordsScreenFieldFromSnapshot(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if _, err := Run(ctx, Options{
BundleID: "com.fixture",
Duration: 100 * time.Millisecond,
SnapshotTimeout: 2 * time.Second,
IdleTimeout: 50 * time.Millisecond,