Linux example
#
Prepare Linux droplet on DigitalOceanCreate 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.1
onOS Ubuntu 18.04
or 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
root
as username.
- And check, that docker is ready
#
Create docker networkUser-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:4444
in your browser, for examplehttp://46.101.224.194:4444
and you should see messageSelenium Standalone v.3.141.59
#
Create your first easy test caseGo to your home directory and create directory with name demo
Create an empty file and open it via program vim
- press the key
i
for insert mode
Paste to smoke.js
first test case.
- press the key
escape
on your keyboard, write:
followed bywq
and pressenter
to 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
i
for insert mode
- press the key
escape
on your keyboard, write:
followed bywq
and pressenter
to save and exit from vim
Explanation
docker run --name canary --rm -ti
run 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.js
define your test case.-e AT_DRIVER_HOST_NAME=selen
name container with selenium standalone--net canary network name
-v $(pwd):/tmp/canary-tests
mount place when I'm now and where I have a tests to path in the docker containerquay.io/canarytrace/developer:c.2.12.2
container 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 caseMake 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.