(t *testing.T, c config)
| 1654 | } |
| 1655 | |
| 1656 | func 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 | |
| 1687 | const proxyPageContents = "You are viewing a proxied page" |
| 1688 |
nothing calls this directly
no test coverage detected
searching dependent graphs…