/LT-golang-selenium

Primary LanguageHTMLApache License 2.0Apache-2.0

Demo-GoLang-LT


LT Status

This repository contains sample tests to run on the LT Infrastructure using Selenium and GoLang.

Setup

  • 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 tests go test -v -run TestSingle

Local Support

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.

Web

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