Skip to main content

Integrate Visual E2E Testing Into Your CI

Get continuous visual test automation by integrating Visual E2E tests directly into your continuous integration (CI) build.

If your tests are already integrated into CI, get visual results returned into your tests and pass or fail your builds depending on visual regressions found.

1. Return Visual results into your WebDriver test(s)

To get the test results, add the @visual.end command right before ending your test session. The returned result can then be asserted to pass or fail your test.

WebDriverIO Example:

const result = driver.execute('/*@visual.end*/')
assert.ok(result.passed, result.message)

For more details on results returned, view the Visual Commands documentation.

2. Integrate your CI Build

Associate your Visual tests with your CI build number by setting the build option in your capabilities.

Below are build number environment variables for various CI tools:

capabilities: {
...
'sauce:options': {
build: process.env.BUILD_NUMBER
}
}

Next Steps