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

Function testIsSelected

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

Source from the content-addressed store, hash-verified

1532}
1533
1534func testIsSelected(t *testing.T, c config) {
1535 wd := newRemote(t, c)
1536 defer quitRemote(t, wd)
1537
1538 if err := wd.Get(serverURL); err != nil {
1539 t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err)
1540 }
1541 elem, err := wd.FindElement(ByID, "chuk")
1542 if err != nil {
1543 t.Fatal("Can't find element")
1544 }
1545 selected, err := elem.IsSelected()
1546 if err != nil {
1547 t.Fatal("Can't get selection")
1548 }
1549
1550 if selected {
1551 t.Fatal("Already selected")
1552 }
1553
1554 if err := elem.Click(); err != nil {
1555 t.Fatal("Can't click")
1556 }
1557
1558 selected, err = elem.IsSelected()
1559 if err != nil {
1560 t.Fatal("Can't get selection")
1561 }
1562
1563 if !selected {
1564 t.Fatal("Not selected")
1565 }
1566}
1567
1568func testIsDisplayed(t *testing.T, c config) {
1569 wd := newRemote(t, c)

Callers

nothing calls this directly

Calls 6

newRemoteFunction · 0.85
quitRemoteFunction · 0.85
GetMethod · 0.65
FindElementMethod · 0.65
IsSelectedMethod · 0.65
ClickMethod · 0.65

Tested by

no test coverage detected