MCPcopy
hub / github.com/httprunner/httprunner / TestDriver_NewSession

Function TestDriver_NewSession

hrp/pkg/uixt/android_test.go:25–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestDriver_NewSession(t *testing.T) {
26 driver, err := NewUIADriver(nil, uiaServerURL)
27 if err != nil {
28 t.Fatal(err)
29 }
30
31 firstMatchEntry := make(map[string]interface{})
32 firstMatchEntry["package"] = "com.android.settings"
33 firstMatchEntry["activity"] = "com.android.settings/.Settings"
34 caps := Capabilities{
35 "firstMatch": []interface{}{firstMatchEntry},
36 "alwaysMatch": struct{}{},
37 }
38 session, err := driver.NewSession(caps)
39 if err != nil {
40 t.Fatal(err)
41 }
42 if len(session.SessionId) == 0 {
43 t.Fatal("should not be empty")
44 }
45}
46
47func TestNewDriver(t *testing.T) {
48 driver, err := NewUIADriver(nil, uiaServerURL)

Callers

nothing calls this directly

Calls 2

NewUIADriverFunction · 0.85
NewSessionMethod · 0.65

Tested by

no test coverage detected