matchers

package
v0.0.0-...-82d303e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeActive

func BeActive() types.GomegaMatcher

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

func BeEnabled

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

func BeFound() types.GomegaMatcher

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

func BeSelected

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

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

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

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

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

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

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

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

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

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

func HaveTitle(title string) types.GomegaMatcher

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

func HaveURL

func HaveURL(url string) types.GomegaMatcher

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

func HaveWindowCount

func HaveWindowCount(count int) types.GomegaMatcher

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

func MatchText

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.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL