diff --git a/addon-test-support/helpers.js b/addon-test-support/helpers.js index 1f0ef31..0db2772 100644 --- a/addon-test-support/helpers.js +++ b/addon-test-support/helpers.js @@ -45,6 +45,12 @@ export async function capture(assert, fileName, { selector = null, fullPage = tr }); } + // if skipvisual QUnit param is true, do nothing + if (queryParams.includes('skipvisual')) { + assert.ok(true, `visual-test: ${fileName} skipped`); + return; + } + // If not in capture mode, make a request to the middleware to capture a screenshot in node let urlQueryParams = [ `testId=${testId}`, diff --git a/index.js b/index.js index 91431cc..2ebb43e 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,11 @@ module.exports = { this.import('vendor/visual-test.css', { type: 'test' }); + + this.import('vendor/qunit/qunit.js', { type: 'test' }); + this.import('vendor/ember-visual-test/qunit-configuration.js', { + type: 'test' + }); }, async _getBrowser() { diff --git a/vendor/ember-visual-test/qunit-configuration.js b/vendor/ember-visual-test/qunit-configuration.js new file mode 100644 index 0000000..46c5075 --- /dev/null +++ b/vendor/ember-visual-test/qunit-configuration.js @@ -0,0 +1,9 @@ +/* globals QUnit */ + +(function() { + QUnit.config.urlConfig.push({ + id: 'skipvisual', + label: 'Skip visual tests', + tooltip: 'Pass all capture calls without performing them' + }); +})();