Running a Screenshot Test With a Git Commit or Push

Applies to CrossBrowserTesting SaaS, last modified on January 10, 2023

We have added a new feature for all of you GitHub.com users. You can now run a screenshot using a GitHub Webhook. GitHub Webhooks are powerful and now in combination with CrossBrowserTesting you have the ability to run a Screenshot Test for your awesome website on every push to GitHub.

  1. From your repository Settings page, select Webhooks and services.

  2. Select Add Webhook.

  3. Set the Payload URL to http://crossbrowsertesting.com/api/v3/screenshots/.

  4. Set the Content type to application/json.

  5. Select which event that you want to trigger the Screenshot Webhook.

  6. Set it to Active.

  7. Finally, select Add Webhook.

Webhook and services settings

Click the image to enlarge it.

Our Screenshots API accepts the parameters for GitHub Webhooks as query parameters. For example:

curl --user USERNAME:AUTHKEY --data "browser_list_name=THELIST&url=http://website.com&send_email=true&[email protected],[email protected]" https://crossbrowsertesting.com/api/v3/screenshots/

Note: Some characters may need to be URL encoded (for example, @=%40).

In addition to the Screenshots GitHub Webhook, we have also added "send_email" and "email_list" options.

The "send_email" option will send you an email once the Screenshot Test is finished.

You can provide an "email_list" to notify other people, otherwise the email will send to the account holder's email address.

See Also

Visual Testing

Highlight search results