Windows 10Pro example
If you have Windows with Docker Desktop installed, skip the first and second step
#
Prepare Windows on AzureCreate and sign in to virtual machine on Azure Cloud
In this first step we create a virtual machine with Windows 10 Pro and install Docker.
- Start on https://portal.azure.com/ and sign up
- Create a virtual machine
- Click on
+ Add
button - Select or create a new subscription and select this options
- Virtual machine name
canarytrace
- Region
Germany West Central
- Image
Windows 10 Pro
- Size
2 vcpus, 8GiB memory
- Username
AzureUser
- Password
AzureUser123
- Select inbount port
RDP
- Virtual machine name
- Click on
Review + create
button and next click onCreate
button
Wait for validation passed message
Click on
Create
button and wait on Your deployment is complete messageShow detail of deploy and click on
Connect
button.Select RDP and download configuration file. Use the configuration file for your favorite RDP client application.
To login form username
AzureUser
and passwordAzureUser123
Your Windows 10 Pro is ready 👏🏻
#
Install Docker CE Desktop for Windows- Download and install Docker from this page https://hub.docker.com/editions/community/docker-ce-desktop-windows/ the operation requires restart Windows.
- Docker is starting after Windows restart.
- Wait for Docker is launched.
#
Work with Docker- Open Windows PowerShell as admin (not Windows PowerShell ISE)
- or install git and open program Git Bash
- check if Docker is ready
- In case you get
AH0058: apache2: Could not reliably determine the server’s fully ……
do not care about that.
#
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
localhost:4444
in your browser, for examplehttp://localhost: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 a new file
smoke.js
and open it. - Paste text bellow into file
smoke.js
and save it.
- 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 a new file
runner.sh
and open it. - Paste text bellow into file
runner.sh
and save it.
- In some cases when you are not using TTY replace
-i
toti
in first line likedocker run --name canary --rm -ti \
Your directory now looks like
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 C:/Users/AzureUser/demo:/tmp/canary-tests
mount place when I have the test case (=smoke.js) and the runner (=runner.sh) to the 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
#
Run your first test caseRun Canarytrace with test case
either via built-in PowerShell as admin (preferred way):
or via Git Bash
allow sharing of C:\Users\AzureUser\demo directory when asked for
Output from Canarytrace ends as follows
When you are done using Canarytrace
- 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 with windows when no longer needed
- Do you find mistake or have any questions? Please create issue, thanks 👍
- Have more questions? Contact us.