Description
If you're interested in taking over this package, please contact me (@tebeka). There's no active development other than accepting patches currently.
Looking for Maintainer alternatives and similar packages
Based on the "Testing Frameworks" category.
Alternatively, view Looking for Maintainer alternatives based on common mentions on social networks and blogs.
-
Testify
A toolkit with common assertions and mocks that plays nicely with the standard library -
GoConvey
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go. -
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work. -
gnomock
Test your code without writing mocks with ephemeral Docker containers ๐ฆ Setup popular services with just a couple lines of code โฑ๏ธ No bash, no yaml, only code ๐ป -
go-vcr
Record and replay your HTTP interactions for fast, deterministic and accurate tests -
testfixtures
Ruby on Rails like test fixtures for Go. Write tests against a real database -
goc
A Comprehensive Coverage Testing System for The Go Programming Language -
embedded-postgres
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test -
baloo
Expressive end-to-end HTTP API testing made easy in Go -
gotest.tools
A collection of packages to augment the go testing package and support common patterns. -
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! ๐ -
go-testdeep
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite -
go-carpet
Tool for show test coverage in terminal for Go source files -
dbcleaner
Clean database for testing, inspired by database_cleaner for Ruby -
GoSpec
Testing framework for Go. Allows writing self-documenting tests/specifications, and executes them concurrently and safely isolated. [UNMAINTAINED] -
jsonassert
A Go test assertion library for verifying that two representations of JSON are semantically equal -
wstest
go websocket client for unit testing of a websocket handler -
testcase
testcase is an opinionated testing framework to support test driven design. -
assert
:exclamation:Basic Assertion Library used along side native go testing, with building blocks for custom assertions -
restit
A Go library help testing your RESTful API application -
gherkingen
Behaviour Driven Development tests generator for Golang -
gomatch
Library created for testing JSON against patterns. -
Hamcrest
Hamcrest matchers for the Go programming language -
fluentassert
Extensible, type-safe, fluent assertion Go library. -
gogiven
gogiven - BDD testing framework for go that generates readable output directly from source code
WorkOS - The modern identity platform for B2B SaaS
Do you think we are missing an alternative of Looking for Maintainer or a related project?
README
The most complete, best-tested WebDriver client for Go
About
This is a WebDriver client for Go. It supports the WebDriver protocol and has been tested with various versions of Selenium WebDriver, Firefox and Geckodriver, and Chrome and ChromeDriver,
selenium
is currently maintained by Eric Garrido (@minusnine).
Installing
Run
go get -t -d github.com/tebeka/selenium
to fetch the package.
The package requires a working WebDriver installation, which can include recent versions of a web browser being driven by Selenium WebDriver.
Downloading Dependencies
We provide a means to download the ChromeDriver binary, the Firefox binary, the Selenium WebDriver JARs, and the Sauce Connect proxy binary. This is primarily intended for testing.
$ cd vendor
$ go run init.go --alsologtostderr --download_browsers --download_latest
$ cd ..
Re-run this periodically to get up-to-date versions of these binaries.
Documentation
The API documentation is at https://godoc.org/github.com/tebeka/selenium. See the example and unit tests(for sauce, selenium and service) for better usage information.
Known Issues
Any issues are usually because the underlying browser automation framework has a bug or inconsistency. Where possible, we try to cover up these underlying problems in the client, but sometimes workarounds require higher-level intervention.
Please feel free to file an issue if this client doesn't work as expected.
Below are known issues that affect the usage of this API. There are likely others filed on the respective issue trackers.
Selenium 2
No longer supported.
Selenium 3
Geckodriver (Standalone)
- Geckodriver does not support the Log API because it hasn't been defined in the spec yet.
- Firefox via Geckodriver (and also through Selenium) doesn't handle clicking on an element.
- Firefox via Geckodriver doesn't handle sending control characters without appending a terminating null key.
Chromedriver
Breaking Changes
There are a number of upcoming changes that break backward compatibility in an effort to improve and adapt the existing API. They are listed here:
22 August 2017
The Version
constant was removed as it is unused.
18 April 2017
The Log method was changed to accept a typed constant for the type of log to retrieve, instead of a raw string. The return value was also changed to provide a more idiomatic type.
Hacking
Patches are encouraged through GitHub pull requests. Please ensure that:
- A test is added for anything more than a trivial change and that the existing tests pass. See below for instructions on setting up your test environment.
Please ensure that
gofmt
has been run on the changed files before committing. Install a pre-commit hook with the following command:$ ln -s ../../misc/git/pre-commit .git/hooks/pre-commit
See the issue tracker for features that need implementing.
Testing Locally
Install xvfb
and Java if they is not already installed, e.g.:
sudo apt-get install xvfb openjdk-11-jre
Run the tests:
$ go test
- There is one top-level test for each of:
1. Chromium and ChromeDriver.
2. A new version of Firefox and Selenium 3.
3. HTMLUnit, a Java-based lightweight headless browser implementation.
4. A new version of Firefox directly against Geckodriver.
There are subtests that are shared between both top-level tests.
To run only one of the top-level tests, pass one of:
-
-test.run=TestFirefoxSelenium3
, -
-test.run=TestFirefoxGeckoDriver
, -
-test.run=TestHTMLUnit
, or -
-test.run=TestChrome
.
To run a specific subtest, pass
-test.run=Test<Browser>/<subtest>
as appropriate. This flag supports regular expressions.-
If the Chrome or Firefox binaries, the Selenium JAR, the Geckodriver binary, or the ChromeDriver binary cannot be found, the corresponding tests will be skipped.
The binaries and JAR under test can be configured by passing flags to
go test
. See the available flags withgo test --arg --help
.Add the argument
-test.v
to see detailed output from the test automation framework.
Testing With Docker
To ensure hermeticity, we also have tests that run under Docker. You will need an installed and running Docker system.
To run the tests under Docker, run:
$ go test --docker
This will create a new Docker container and run the tests in it. (Note: flags
supplied to this invocation are not curried through to the go test
invocation
within the Docker container).
For debugging Docker directly, run the following commands:
$ docker build -t go-selenium testing/
$ docker run --volume=$(pwd):/code --workdir=/code -it go-selenium bash
root@6c7951e41db6:/code# testing/docker-test.sh
... lots of testing output ...
Testing With Sauce Labs
Tests can be run using a browser located in the cloud via Sauce Labs.
To run the tests under Sauce, run:
$ go test --test.run=TestSauce --test.timeout=20m \
--experimental_enable_sauce \
--sauce_user_name=[username goes here] \
--sauce_access_key=[access key goes here]
The Sauce access key can be obtained via the Sauce Labs user settings page.
Test results can be viewed through the Sauce Labs Dashboard.
License
This project is licensed under the MIT license.
*Note that all licence references and agreements mentioned in the Looking for Maintainer README section above
are relevant to that project's source code only.