agouti: github.com/sclevine/agouti/matchers Index | Files | Directories

package matchers

import "github.com/sclevine/agouti/matchers"

Package matchers provides a set of Gomega-compatible matchers for use with the agouti package.

Index

Package Files

matchers.go page_matchers.go selection_matchers.go

func BeActive Uses

func BeActive() types.GomegaMatcher

BeActive passes when the selection refers to the active page element.

func BeEnabled Uses

func BeEnabled() types.GomegaMatcher

BeEnabled passes when the selection refers to form elements that are enabled. This matcher will fail if any of the selection's form elements are not enabled.

func BeFound Uses

func BeFound() types.GomegaMatcher

BeFound passes when the provided selection refers to one or more elements on the page.

func BeSelected Uses

func BeSelected() types.GomegaMatcher

BeSelected passes when the provided selection refers to form elements that are selected. Examples: a checked <input type="checkbox" />, or the selected <option> in a <select> This matcher will fail if any of the selection's form elements are not selected.

func BeVisible Uses

func BeVisible() types.GomegaMatcher

BeVisible passes when the selection refers to elements that are displayed on the page. This matcher will fail if any of the selection's elements are not visible.

func EqualElement Uses

func EqualElement(comparable interface{}) types.GomegaMatcher

EqualElement passes when the expected selection refers to the same element as the provided actual selection. This matcher will fail if either selection refers to more than one element.

func HaveAttribute Uses

func HaveAttribute(attribute string, value string) types.GomegaMatcher

HaveAttribute passes when the expected attribute and value are present on the element. This matcher will fail if the provided selection refers to more than one element.

func HaveCSS Uses

func HaveCSS(property string, value string) types.GomegaMatcher

HaveCSS passes when the expected CSS property and value are present on the element. This matcher only matches exact, calculated CSS values, though there is support for parsing colors. Example: "blue" and "#00f" will both match rgba(0, 0, 255, 1) This matcher will fail if the provided selection refers to more than one element.

func HaveCount Uses

func HaveCount(count int) types.GomegaMatcher

HaveCount passes when the expected element count is equal to the actual number of elements in the selection.

func HaveLoggedError Uses

func HaveLoggedError(messages ...string) types.GomegaMatcher

HaveLoggedError passes when all of the expected log messages are logged as errors in the browser console. If no message is provided, this matcher will pass if any error message has been logged. When negated, this matcher will only fail if all of the provided messages are logged.

func HaveLoggedInfo Uses

func HaveLoggedInfo(messages ...string) types.GomegaMatcher

HaveLoggedInfo passes when all of the expected log messages are logged in the browser console. If no messages are provided, this matcher will pass if any message has been logged. When negated, this matcher will only fail if all of the provided messages are logged. Error logs are not considered in any of these cases.

func HavePopupText Uses

func HavePopupText(text string) types.GomegaMatcher

HavePopupText passes when the expected text is equivalent to the text contents of an open alert, confirm, or prompt popup.

func HaveText Uses

func HaveText(text string) types.GomegaMatcher

HaveText passes when the expected text is equal to the actual element text. This matcher fails if the provided selection refers to more than one element.

func HaveTitle Uses

func HaveTitle(title string) types.GomegaMatcher

HaveTitle passes when the expected title is equivalent to the title of the provided page.

func HaveURL Uses

func HaveURL(url string) types.GomegaMatcher

HaveURL passes when the expected URL is equivalent to the current URL of the provided page.

func HaveWindowCount Uses

func HaveWindowCount(count int) types.GomegaMatcher

HaveWindowCount passes when the expected window count is equivalent to the number of open windows.

func MatchText Uses

func MatchText(regexp string) types.GomegaMatcher

MatchText passes when the expected regular expression matches the actual element text. This matcher will fail if the provided selection refers to more than one element.

Directories

PathSynopsis
internal
internal/colorparser
internal/mocks

Package matchers imports 2 packages (graph) and is imported by 1 packages. Updated 2016-07-21. Refresh now. Tools for package owners.