Categorygithub.com/lexlibrary/sequence
modulepackage
0.0.7
Repository: https://github.com/lexlibrary/sequence.git
Documentation: pkg.go.dev

# README

sequence

Sequence is a frontend for Webdriver testing. It's main goal are to be easy to use and to make writing frontend tests easier in Go.

Overview

A sequence is a chain of functions that test a web page. If any item in the sequence fails, it drops out early and returns the error. Compare the test example from the Go Selenium webdriver to Sequence:

err = sequence.Start(wd).
    Get("http://play.golang.org/?simple=1").
    Find("#code").Clear().SendKeys(`
        package main
        import "fmt"

        func main() {
            fmt.Println("Hello WebDriver!\n")
        }
    `).
    Find("#run").Click().
    Find("#output").Text().Contains("Hello WebDriver").Eventually().
    End()
if err != nil {
    panic(err)
}

The underlying WebDriver library does all the work. Sequence simply presents a easier API to work with.

See the documentation for more details.

# Functions

Start starts a new sequence of tests.

# Structs

Elements is a collections of web elements.
Error describes an error that occured during the sequence processing.
Sequence is a helper structs of chaining selecting elements and testing them if any part of the sequence fails the sequence ends and returns the error built to make writing tests easier.
StringMatch is for testing the value of strings in elements.
TitleMatch is for testing the value of the title.
URLMatch is for testing the value of the page's URL.

# Type aliases

Errors is multiple sequence errors.