diff --git a/packages/config/test/index.test.js b/packages/config/test/index.test.js index c870bd9e5..8213d4c55 100644 --- a/packages/config/test/index.test.js +++ b/packages/config/test/index.test.js @@ -1202,7 +1202,8 @@ describe('PercyConfig', () => { 'disable-shadow-dom': true, 'cli-enable-javascript': true, 'ignore-region-xpaths': [''], - 'enable-layout': false + 'enable-layout': false, + 'full-page': false })).toEqual({ fooBar: 'baz', foo: { barBaz: 'qux' }, @@ -1213,7 +1214,8 @@ describe('PercyConfig', () => { disableShadowDOM: true, cliEnableJavaScript: true, ignoreRegionXpaths: [''], - enableLayout: false + enableLayout: false, + fullPage: false }); }); @@ -1227,7 +1229,8 @@ describe('PercyConfig', () => { disableShadowDOM: true, cliEnableJavaScript: true, ignoreRegionXpaths: [''], - enableLayout: false + enableLayout: false, + fullPage: false }, { kebab: true })).toEqual({ 'foo-bar': 'baz', foo: { 'bar-baz': 'qux' }, @@ -1237,7 +1240,8 @@ describe('PercyConfig', () => { 'disable-shadow-dom': true, 'cli-enable-javascript': true, 'ignore-region-xpaths': [''], - 'enable-layout': false + 'enable-layout': false, + 'full-page': false }); }); @@ -1251,7 +1255,8 @@ describe('PercyConfig', () => { disableShadowDOM: true, cliEnableJavaScript: true, ignoreRegionXpaths: [''], - enableLayout: false + enableLayout: false, + fullPage: false }, { snake: true })).toEqual({ foo_bar: 'baz', foo: { bar_baz: 'qux' }, @@ -1261,7 +1266,8 @@ describe('PercyConfig', () => { disable_shadow_dom: true, cli_enable_javascript: true, ignore_region_xpaths: [''], - enable_layout: false + enable_layout: false, + full_page: false }); }); diff --git a/packages/core/src/config.js b/packages/core/src/config.js index f90dfc068..773606d14 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -68,6 +68,10 @@ export const configSchema = { } } }, + fullPage: { + type: 'boolean', + onlyAutomate: true + }, freezeAnimation: { // for backward compatibility type: 'boolean', onlyAutomate: true diff --git a/packages/core/src/utils.js b/packages/core/src/utils.js index 0c69c213b..fe6183b07 100644 --- a/packages/core/src/utils.js +++ b/packages/core/src/utils.js @@ -41,6 +41,7 @@ export function percyAutomateRequestHandler(req, percy) { }); req.body.options = merge([{ + fullPage: percy.config.snapshot.fullPage, percyCSS: percy.config.snapshot.percyCSS, freezeAnimatedImage: percy.config.snapshot.freezeAnimatedImage || percy.config.snapshot.freezeAnimation, freezeImageBySelectors: percy.config.snapshot.freezeAnimatedImageOptions?.freezeImageBySelectors, diff --git a/packages/core/test/api.test.js b/packages/core/test/api.test.js index 8a3f6493b..914119b38 100644 --- a/packages/core/test/api.test.js +++ b/packages/core/test/api.test.js @@ -274,6 +274,7 @@ describe('API Server', () => { await percy.start(); + percy.config.snapshot.fullPage = false; percy.config.snapshot.percyCSS = '.global { color: blue }'; percy.config.snapshot.freezeAnimatedImage = false; percy.config.snapshot.freezeAnimatedImageOptions = { freezeImageByXpaths: ['/xpath-global'] }; @@ -286,6 +287,7 @@ describe('API Server', () => { client_info: 'client', environment_info: 'environment', options: { + fullPage: true, percyCSS: '.percy-screenshot: { color: red }', freeze_animated_image: true, freezeImageBySelectors: ['.selector-per-screenshot'], @@ -301,6 +303,7 @@ describe('API Server', () => { environmentInfo: 'environment', buildInfo: { id: '123', url: 'https://percy.io/test/test/123', number: 1 }, options: { + fullPage: true, freezeAnimatedImage: true, freezeImageBySelectors: ['.selector-per-screenshot'], freezeImageByXpaths: ['/xpath-global'],