sailfoot

command module
v0.0.0-...-e3a65fc Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: MIT Imports: 4 Imported by: 0

README

Go Report Card CircleCI

Alt logo

Sailfoot, WIP

A software for controlling browsers for the purpose of end-to-end testing, scraping and other automation.

Design philosophies:

  • Easy to use (straightforward scripting, small learning curve)
  • Easy to install, just a single binary

Etymology

Pleopod:

  • a forked swimming limb of a crustacean, five pairs of which are typically attached to the abdomen.
  • from Greek plein ‘swim, sail’ + pous, pod- ‘foot’.

Documentation

Forewords

Too many enterprise apps have no e2e tests at all. One can't blame the users. Many testing frameworks are cumbersome to install and use, and are just 1-to-1 mappings to the WebDriver API, providing nothing more than pretty printing.

In the sea of untested enterprise web apps, one is allowed to do it quick and dirty. Hence sailfoot, a highly opinionated testing application/framework that focuses on making testing as simple as possible, in one portable binary.

Installation

Grab the binary from the release page. You will also need either a selenium server, or a webdriver like chromedriver.

One liners:

# Mac:
curl -L https://github.com/adl32x/sailfoot/releases/download/nightly/sf-darwin-amd64.tar.gz | tar xz && sudo cp sf /usr/local/bin/sf

# Linux:
curl -L https://github.com/adl32x/sailfoot/releases/download/nightly/sf-linux-amd64.tar.gz | tar xz && sudo cp sf /usr/local/bin/sf

Running

Run the binary. sf

Hello world

When you run sf it expects a start.txt in you current directory. You can use the -file flag to change the start script.

start.txt:

navigate https://url_to_hello_world

has_text 'Hello world!'

Run sf.

Built-in keywords

Here's a shortened list of the built-in keywords. Full list of keywords explained in wiki.

Keyword Arguments Example
has_text text has_text 'Hello world!'
has_text selector, text has_text '.class' 'Hello world!'
click selector click '.button'
click_on_text text click 'Log in'
click_closest_to selector, selector click_closest_to '.username' '.button'
input text input 'andy'
input selector, text input '.username' 'andy'
read selector, variable read '.username' 'USERNAME'
execute text execute 'ls -l'
Writing your own keywords

Making your keyword is as simple as putting it under a directory named keywords/ and saving it into a .txt file. The filename will be the name of the keyword.

├── keywords
│   ├── keyword1.txt
│   ├── keyword2.txt
│   └── ... .txt
└── start.txt
Arguments

Arguments end up in variables 0..9:

log 'Sample keyword with arguments'
input '.long-boring-selector > div > ... $$0$$' $$1$$

If you save this as keyword.txt you can then use it like this:

keyword '.username' 'admin'

Need to know more?

Full documentation in Wiki.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Serve is a very simple static file server in go Usage: -p="8100": port to serve on -d=".": the directory of static files to host Navigating to http://localhost:8100 will display the index.html or directory listing file.
Serve is a very simple static file server in go Usage: -p="8100": port to serve on -d=".": the directory of static files to host Navigating to http://localhost:8100 will display the index.html or directory listing file.

Jump to

Keyboard shortcuts

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