(t *testing.T, c config)
| 1367 | } |
| 1368 | |
| 1369 | func testExecuteScript(t *testing.T, c config) { |
| 1370 | wd := newRemote(t, c) |
| 1371 | defer quitRemote(t, wd) |
| 1372 | |
| 1373 | if err := wd.Get(serverURL); err != nil { |
| 1374 | t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err) |
| 1375 | } |
| 1376 | script := "return arguments[0] + arguments[1]" |
| 1377 | args := []interface{}{1, 2} |
| 1378 | reply, err := wd.ExecuteScript(script, args) |
| 1379 | if err != nil { |
| 1380 | t.Fatal(err) |
| 1381 | } |
| 1382 | |
| 1383 | result, ok := reply.(float64) |
| 1384 | if !ok { |
| 1385 | t.Fatal("Not an int reply") |
| 1386 | } |
| 1387 | |
| 1388 | if result != 3 { |
| 1389 | t.Fatalf("Bad result %d (expected 3)", int(result)) |
| 1390 | } |
| 1391 | } |
| 1392 | |
| 1393 | func testExecuteScriptWithNilArgs(t *testing.T, c config) { |
| 1394 | wd := newRemote(t, c) |
nothing calls this directly
no test coverage detected
searching dependent graphs…