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

Function testNewSession

remote_test.go:598–630  ·  view source on GitHub ↗
(t *testing.T, c config)

Source from the content-addressed store, hash-verified

596}
597
598func testNewSession(t *testing.T, c config) {
599 // Bypass NewRemote which itself calls NewSession internally.
600 wd := &remoteWD{
601 capabilities: newTestCapabilities(t, c),
602 urlPrefix: c.addr,
603 }
604 defer func() {
605 if err := wd.Quit(); err != nil {
606 t.Errorf("wd.Quit() returned error: %v", err)
607 }
608 }()
609
610 sid, err := wd.NewSession()
611 if err != nil {
612 t.Fatalf("error in new session - %s", err)
613 }
614
615 if len(sid) == 0 {
616 t.Fatal("Empty session id")
617 }
618
619 if wd.id != sid {
620 t.Fatal("Session id mismatch")
621 }
622
623 if wd.SessionID() != sid {
624 t.Fatalf("Got session id mismatch %s != %s", sid, wd.SessionID())
625 }
626
627 if c.browser != "htmlunit" && wd.browserVersion.Major == 0 {
628 t.Fatalf("wd.browserVersion.Major = %d, expected > 0", wd.browserVersion.Major)
629 }
630}
631
632func testDeleteSession(t *testing.T, c config) {
633 wd := newRemote(t, c)

Callers

nothing calls this directly

Calls 4

QuitMethod · 0.95
NewSessionMethod · 0.95
SessionIDMethod · 0.95
newTestCapabilitiesFunction · 0.85

Tested by

no test coverage detected