Skip to main content

Local Worker

If you have a project locally and would like to take screenshots from it -- there is a possibility to use our local worker.

The worker will connect to Diffy, read your project settings and create screenshots from your local environment and then upload screenshots back to Diffy. So then you can compare screenshots with production.

 

Download the worker based on your OS from the Google Drive folder.

 

Run the worker

 

Run the script 

./diffy_local-linux create-screenshots --project_id=123 --url="http://site.com"

Where you need to specify project id from your settings and the local URL of the site

 

 

Settings

 

All settings can be configured in .env file. Put the .env file right next to the worker file. Default content:


DEBUG=true 
CHROME_DEBUG=false 
API_KEY="your-key" 
TMP_PATH="/tmp" 
LOCAL_CHROME_PATH="should-be-populated-for-macos-only" 
ATTEMPTS_NUMBER=2 
DEFAULT_SCREENSHOT_NAME="local_worker" 
UPLOAD_SCREENSHOT_TIMEOUT=600000 
DEFAULT_REQUEST_TIMEOUT=30000 
BROWSER_NAVIGATION_TIMEOUT=90000 
CHECK_URL_TIMEOUT=30000 

 

Env variable Value Description
DEBUG true / false Turn on/off script debug
CHROME_DEBUG true / false Turn on/off chrome dumpio debug
API_KEY "cbcbcbcbcbcbcbcbcbcbcbe6" Your API key from diffy.website
TMP_PATH "/custom_temp_path/dir1/dir2" Path to temp files. Default is /tmp
LOCAL_CHROME_PATH "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" MacOS users need to set real path to Chrome. Built package compiled for debian / ubuntu. For debian /ubuntu OS left this variable empty.
ATTEMPTS_NUMBER 1 The number of attempts to take a screenshot when an error occurs.
DEFAULT_SCREENSHOT_NAME "local_worker" Default screenshot name. The timestamp will be added to this name. (Result example: local_worker_1579256525468)
UPLOAD_SCREENSHOT_TIMEOUT 600000 in milliseconds. (default 10 minutes)
DEFAULT_REQUEST_TIMEOUT 30000 in milliseconds. (default 30 seconds)
BROWSER_NAVIGATION_TIMEOUT 90000 in milliseconds. (default 90 seconds)
CHECK_URL_TIMEOUT 30000 in milliseconds. (default 30 seconds)