Skip to main content

Working With AppVeyor

Configuring the Applitools CI/CD Integration

  1. In the appveyor.yml file, add the following line in the init section:

    init:
    -ps: $env: APPLITOOLS_BATCH_ID =
    if ($env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT) {
    $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT
    }
    else {
    $env: APPVEYOR_REPO_COMMIT
    }
  2. On your project page, click SETTINGS.

  3. On the left panel, select Environment, and in the Environment Variables section click Add Variable.

  4. In the Name field, enter APPLITOOLS_API_KEY.

  5. In the Value field, enter the value of your API key. To obtain the value of your API key, see How to obtain your API key.

  6. Click Save.

Enabling Applitools logs in AppVeyor

To capture Applitools SDK logs during your AppVeyor build, set the log environment variables and publish the logs folder as an artifact:

environment:
APPLITOOLS_SHOW_LOGS: true
APPLITOOLS_LOG_DIR: logs
artifacts:
- path: logs
name: applitools-logs
note

If your AppVeyor build step runs inside Docker, the log files are written inside the container and can disappear when the container exits. Mount the container log directory to the host workspace so the files are preserved.

Example Docker command:

docker run \
-e APPLITOOLS_SHOW_LOGS=true \
-e APPLITOOLS_LOG_DIR=/usr/src/app/logs \
-v ${WORKSPACE}/applitools-logs:/usr/src/app/logs \
your-image-name

Adjust ${WORKSPACE} to your AppVeyor workspace path.