This repository contains sample tests to run on the LT Infrastructure using Selenium and GoLang.
-
Install the following necessary packages using command line (refer below for performing local testing):
# install selenium client bindings for go-lang go get github.com/tebeka/selenium # install asserters go get github.com/stretchr/testify # OR install all the dependencies using go get -v ./... go install ./...
Note: This step is entirely optional as go automatically downloads missing dependencies while running or building the programs
-
Export the environment variables for the Username and Access Key of your LT account
export LT_USERNAME=<LT-username> && export LT_ACCESS_KEY=<LT-access-key>
NOTE: If you are not using *nix based systems you may also need to install
make
command to run the commands given below from here. You can also refer to the make file and directly copy test commands for eg command to run single web testsgo test -v -run TestSingle
You will need to download the local binary from here, install it and ensure it is the PATH on your machine as there is no local binding specifically for golang.
To run tests on a website run anyone of the following commands:
# run single test
make single
# run multiple tests in parallel
make parallel
# run local test on desktop and mobile browsers
make local # it will start a local file server, serving the web pages hosted in website folder
# run tests single and parallel tests on mobile browsers
make mobile
# run all tests
make all
# run a failed test
make fail