Linux example
Prepare Linux droplet on DigitalOcean#
Create and sign in to droplet on DigitalOcean
DigitalOcean Droplets are simple, scalable virtual machines.
- Start on https://www.digitalocean.com and sign up
- Create droplet Droplet is only business name for virtual machine
- Choose an image > Marketplace select
Docker 19.03.1onOS Ubuntu 18.04or newer - Choose a plan select Shared CPU - Basic
- Select 8GB a 4CPUs
- Choose a datacenter
Frankfurt 1 - Add your SSH key or choose Password option and create your root password and save it (You will not be sent an email containing the password)
- Click on Create Droplet button
Wait for your virtual machine (alias droplet) is created.

- Use your ssh client for log into droplet. For example on MacOSX - open terminal an run
ssh root@46.101.224.194.- Use password to your private key or your root password.
- Always use
rootas username.
- And check, that docker is ready
Create docker network#
User-defined bridges provide automatic DNS resolution between containers
Canarytrace and selenium will be created in the same network and they will recognize each other by their container name
Run Selenium standalone#
- Open documentation for more information.
- Open url
<ip-your-droplet:4444in your browser, for examplehttp://46.101.224.194:4444and you should see messageSelenium Standalone v.3.141.59
Create your first easy test case#
Go to your home directory and create directory with name demo
Create an empty file and open it via program vim
- press the key
ifor insert mode
Paste to smoke.js first test case.
- press the key
escapeon your keyboard, write:followed bywqand pressenterto save and exit from vim editor - this test script is based on webdriver.io v6 and you can extend the test script.
Create bash script runner#
- This file simplifies startup of Canarytrace runner.
- Create an empty file and open it via program vim
- press the key
ifor insert mode
- press the key
escapeon your keyboard, write:followed bywqand pressenterto save and exit from vim
Explanation
docker run --name canary --rm -tirun a docker container with the name canary, output will be printed to stdout and the container will be deleted at the end of the test.-e SPEC=smoke.jsdefine your test case.-e AT_DRIVER_HOST_NAME=selenname container with selenium standalone--net canary network name-v $(pwd):/tmp/canary-testsmount place when I'm now and where I have a tests to path in the docker containerquay.io/canarytrace/developer:c.2.12.2container image in formatmaintainer/name_docker_image:version. Check out repository for latest docker image https://quay.io/organization/canarytrace
Your directory looks like this
Run your first test case#
Make runner.sh executable.
Run Canarytrace with test case
Output from Canarytrace ends as follows
When you are done using Canarytrace
Stop the selen container
and remove user-defined bridge canary
- This demo is available in a git repository [https://github.com/canarytrace/canary-tests.git] - Can't find link you can checkout on aaa2790 revision
- Don't forget to delete the virtual machine (=droplet) when no longer needed
- Do you find mistake or have any questions? Please create issue, thanks 👍
- Have more questions? Contact us.