In the doc, it's say that "For testing purposes we assume the app is running locally." . Did you run the app before? in the example, they try to connect to the local app http://127.0.0.1:6012.
The full content of foc :
We have a context of “basic” for the tests in this file. The test “can connect to app” simply navigates to the app URL and attempts to get the page title. If the page title is “Shiny Test App” the test is deemed successful. For testing purposes we assume the app is running locally. The easiest way to do this is open a second R session and issue the command: runApp(paste0(find.package("RSelenium"), "/apps/shinytestapp"), port = 6012). The second R session will listen for connection on port 6012 and return the Shiny Test App. If we ran this basic test we would expect the following output: