MCPcopy Create free account
hub / github.com/tebeka/selenium / testCSSProperty

Function testCSSProperty

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

Source from the content-addressed store, hash-verified

1654}
1655
1656func testCSSProperty(t *testing.T, c config) {
1657 if c.browser == "htmlunit" {
1658 t.Skip("Skipping on htmlunit")
1659 }
1660 wd := newRemote(t, c)
1661 defer quitRemote(t, wd)
1662
1663 if err := wd.Get(serverURL); err != nil {
1664 t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err)
1665 }
1666
1667 e, err := wd.FindElement(ByLinkText, "other page")
1668 if err != nil {
1669 t.Fatalf("error finding other page link: %v", err)
1670 }
1671
1672 color, err := e.CSSProperty("color")
1673 if err != nil {
1674 t.Fatalf(`e.CSSProperty("color") returned error: %v`, err)
1675 }
1676
1677 // Later versions of Firefox and HTMLUnit return the "rgb" version.
1678 wantColors := []string{"rgba(0, 0, 238, 1)", "rgb(0, 0, 238)"}
1679 for _, wantColor := range wantColors {
1680 if color == wantColor {
1681 return
1682 }
1683 }
1684 t.Fatalf(`e.CSSProperty("color") = %q, want one of %q`, color, wantColors)
1685}
1686
1687const proxyPageContents = "You are viewing a proxied page"
1688

Callers

nothing calls this directly

Calls 5

newRemoteFunction · 0.85
quitRemoteFunction · 0.85
GetMethod · 0.65
FindElementMethod · 0.65
CSSPropertyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…