mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(ioscompanion): reinstall via simctl and sanitize companion env
This commit is contained in:
1 parent
5ab2991dd0
commit
93b62d4aa5
2 files changed
+34
-6
No files matched your search
@@ -108,6 +108,7 @@ func newTestDriver(companion transport.Companion) *Driver {
|
||||
screenHeight: 844,
|
||||
}
|
||||
d.resetContainer = func(context.Context) error { return nil }
|
||||
d.reinstallApp = func(context.Context) error { return nil }
|
||||
return d
|
||||
}
|
||||
|
||||
@@ -140,14 +141,16 @@ func TestLaunchClearStateReinstallsWithAppPath(t *testing.T) {
|
||||
companion := &fakeCompanion{accessibilityJSON: "[]"}
|
||||
d := newTestDriver(companion)
|
||||
d.appPath = "/tmp/Sample.app"
|
||||
reinstalls := 0
|
||||
d.reinstallApp = func(context.Context) error { reinstalls++; return nil }
|
||||
if err := d.Launch(context.Background(), "", true, nil); err != nil {
|
||||
t.Fatalf("Launch: %v", err)
|
||||
}
|
||||
if indexOf(companion.calls, "uninstall") < 0 || indexOf(companion.calls, "install") < 0 {
|
||||
t.Fatalf("clear-state with app path must uninstall then install; got %v", companion.calls)
|
||||
if reinstalls != 1 {
|
||||
t.Fatalf("clear-state with app path must reinstall exactly once; got %d", reinstalls)
|
||||
}
|
||||
if indexOf(companion.calls, "uninstall") > indexOf(companion.calls, "install") {
|
||||
t.Fatalf("uninstall must precede install; got %v", companion.calls)
|
||||
if indexOf(companion.calls, "launch") < indexOf(companion.calls, "terminate") {
|
||||
t.Fatalf("launch must still follow terminate; got %v", companion.calls)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user