MCPcopy Index your code
hub / github.com/tebeka/selenium / TestHTMLUnit

Function TestHTMLUnit

remote_test.go:249–285  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestHTMLUnit(t *testing.T) {
250 if *useDocker {
251 t.Skip("Skipping tests because they will be run under a Docker container")
252 }
253 if _, err := os.Stat(*selenium3Path); err != nil {
254 t.Skipf("Skipping HTMLUnit tests because the Selenium WebDriver JAR was not found at path %q", *selenium3Path)
255 }
256 if _, err := os.Stat(*htmlUnitDriverPath); err != nil {
257 t.Skipf("Skipping HTMLUnit tests because the HTMLUnit Driver JAR not found at path %q", *htmlUnitDriverPath)
258 }
259
260 if testing.Verbose() {
261 SetDebug(true)
262 }
263
264 c := config{
265 browser: "htmlunit",
266 seleniumVersion: semver.MustParse("3.0.0"),
267 serviceOptions: []ServiceOption{HTMLUnit(*htmlUnitDriverPath)},
268 }
269
270 port, err := pickUnusedPort()
271 if err != nil {
272 t.Fatalf("pickUnusedPort() returned error: %v", err)
273 }
274 s, err := NewSeleniumService(*selenium3Path, port, c.serviceOptions...)
275 if err != nil {
276 t.Fatalf("Error starting the WebDriver server with binary %q: %v", *selenium3Path, err)
277 }
278 c.addr = fmt.Sprintf("http://127.0.0.1:%d/wd/hub", port)
279
280 runTests(t, c)
281
282 if err := s.Stop(); err != nil {
283 t.Fatalf("Error stopping the Selenium service: %v", err)
284 }
285}
286
287func runFirefoxTests(t *testing.T, webDriverPath string, c config) {
288 c.browser = "firefox"

Callers

nothing calls this directly

Calls 6

SetDebugFunction · 0.85
HTMLUnitFunction · 0.85
pickUnusedPortFunction · 0.85
NewSeleniumServiceFunction · 0.85
runTestsFunction · 0.85
StopMethod · 0.45

Tested by

no test coverage detected