vitest-plugin-vis 3.5.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asserts--HSSlgPD.mjs +8 -0
- package/dist/asserts--HSSlgPD.mjs.map +1 -0
- package/dist/augment-C1tjdh5B.d.mts +33 -0
- package/dist/augment-C1tjdh5B.d.mts.map +1 -0
- package/dist/auto_snapshot_matcher-C0y6mAeS.mjs +381 -0
- package/dist/auto_snapshot_matcher-C0y6mAeS.mjs.map +1 -0
- package/dist/auto_snapshot_options-BMRtKmod.d.mts +45 -0
- package/dist/auto_snapshot_options-BMRtKmod.d.mts.map +1 -0
- package/dist/auto_snapshot_options-DUOTpF2N.mjs +88 -0
- package/dist/auto_snapshot_options-DUOTpF2N.mjs.map +1 -0
- package/dist/base64-CHSENEAO.mjs +8 -0
- package/dist/base64-CHSENEAO.mjs.map +1 -0
- package/dist/client-api.d.mts +44 -0
- package/dist/client-api.d.mts.map +1 -0
- package/dist/client-api.mjs +14 -0
- package/dist/client-api.mjs.map +1 -0
- package/dist/commands.types-BVhcnnHw.d.mts +51 -0
- package/dist/commands.types-BVhcnnHw.d.mts.map +1 -0
- package/dist/config.d.mts +28 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +412 -0
- package/dist/config.mjs.map +1 -0
- package/dist/constants-CTBaz8Ml.mjs +10 -0
- package/dist/constants-CTBaz8Ml.mjs.map +1 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +6 -0
- package/dist/presets/auto.d.mts +1 -0
- package/dist/presets/auto.mjs +19 -0
- package/dist/presets/auto.mjs.map +1 -0
- package/dist/presets/enable.d.mts +1 -0
- package/dist/presets/enable.mjs +15 -0
- package/dist/presets/enable.mjs.map +1 -0
- package/dist/presets/manual.d.mts +1 -0
- package/dist/presets/manual.mjs +15 -0
- package/dist/presets/manual.mjs.map +1 -0
- package/dist/server-utils.d.mts +19 -0
- package/dist/server-utils.d.mts.map +1 -0
- package/dist/server-utils.mjs +4 -0
- package/dist/setup-DCytWz48.mjs +124 -0
- package/dist/setup-DCytWz48.mjs.map +1 -0
- package/dist/setup.d.mts +106 -0
- package/dist/setup.d.mts.map +1 -0
- package/dist/setup.mjs +8 -0
- package/dist/snapshot_path-7GliOSH_.mjs +58 -0
- package/dist/snapshot_path-7GliOSH_.mjs.map +1 -0
- package/dist/src-CSQnlFa9.mjs +1 -0
- package/dist/testing.d.mts +12 -0
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +65550 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/to_match_image_snapshot.types--tTmHoRA.d.mts +9 -0
- package/dist/to_match_image_snapshot.types--tTmHoRA.d.mts.map +1 -0
- package/dist/trim_common_folder-DBThLerp.d.mts +9 -0
- package/dist/trim_common_folder-DBThLerp.d.mts.map +1 -0
- package/dist/types-CEmjj-A9.d.mts +144 -0
- package/dist/types-CEmjj-A9.d.mts.map +1 -0
- package/dist/types-DJYCbyT8.d.mts +63 -0
- package/dist/types-DJYCbyT8.d.mts.map +1 -0
- package/package.json +55 -39
- package/readme.md +58 -6
- package/src/client/actions/has_image_snapshot_action.ts +1 -1
- package/src/client/actions/load_image_snapshot_results_action.ts +1 -1
- package/src/client/actions/match_image_snapshot_action.ts +7 -5
- package/src/client/actions/match_page_image_snapshot_action.ts +6 -4
- package/src/client/expect/_ctx.ts +10 -0
- package/src/client/expect/to_match_image_snapshot.ts +3 -4
- package/src/client/external/browser/has_render_content.ts +3 -0
- package/src/client/{image_resizer.ts → external/browser/image_resizer.ts} +1 -1
- package/src/client/{vitest_browser_context_proxy.ts → external/vitest/vitest_browser_context_proxy.ts} +3 -3
- package/src/client/{vitest_suite_proxy.ts → external/vitest/vitest_suite_proxy.ts} +1 -1
- package/src/client/{align_images.ts → image/align_images.ts} +3 -3
- package/src/client/page/_ctx.ts +12 -0
- package/src/client/page/extend.ts +1 -1
- package/src/client/page/has_image_snapshot.mdx +1 -1
- package/src/client/page/has_image_snapshot.ts +4 -4
- package/src/client/page/to_match_image_snapshot.mdx +1 -1
- package/src/client/page/to_match_image_snapshot.ts +3 -4
- package/src/client/{compare_image_snapshot.logic.ts → snapshot/compare_image_snapshot.logic.ts} +1 -1
- package/src/client/{compare_image_snapshot.ts → snapshot/compare_image_snapshot.ts} +8 -9
- package/src/client/snapshot/should_take_snapshot.ts +6 -0
- package/src/client/suite/_ctx.ts +8 -0
- package/src/client/suite/auto_snapshot_matcher.ts +68 -0
- package/src/client/{ctx.ts → task/_ctx.ts} +1 -3
- package/src/client/{auto_snapshot_options.ts → task/auto_snapshot_options.ts} +20 -5
- package/src/client/{snapshot_meta.ts → task/snapshot_meta.ts} +6 -1
- package/src/client-api.ts +3 -2
- package/src/config/vis.ts +4 -4
- package/src/index.ts +1 -1
- package/src/server/browser_provider/browser_api.ts +2 -2
- package/src/server/browser_provider/playwright.ts +6 -4
- package/src/server/browser_provider/webdriverio.ts +3 -3
- package/src/server/commands/_assertions.ts +3 -3
- package/src/server/commands/augment.ts +9 -7
- package/src/server/commands/has_image_snapshot.ts +3 -6
- package/src/server/commands/image_snapshot_next_index.ts +3 -9
- package/src/server/commands/load_image_snapshot_results.ts +3 -23
- package/src/server/commands/prepare_image_snapshot_comparison.ts +4 -50
- package/src/server/commands/prepare_page_image_snapshot_comparison.ts +3 -45
- package/src/server/commands/setup_vis_suite.ts +3 -27
- package/src/server/project.ts +8 -7
- package/src/server/snapshot.ts +4 -4
- package/src/server/snapshot_path.ts +6 -5
- package/src/server/suite.ts +7 -12
- package/src/server/testing/stubBrowserCommandContext.ts +16 -0
- package/src/{testing → server/testing}/stubSuite.ts +7 -9
- package/src/server/testing/stubUserConfig.ts +6 -0
- package/src/server/vis_options.ts +4 -5
- package/src/server/vis_server_context.logic.ts +8 -8
- package/src/server/vis_server_context.types.ts +31 -26
- package/src/{client/setup → setup}/create_vis.ts +23 -78
- package/src/setup/readme.md +5 -0
- package/src/{client/setup → setup}/vis.ts +1 -1
- package/src/setup.ts +2 -2
- package/src/shared/commands.types.ts +71 -0
- package/src/shared/types.ts +55 -1
- package/src/testing.ts +0 -1
- package/esm/client/actions/has_image_snapshot_action.d.ts +0 -4
- package/esm/client/actions/has_image_snapshot_action.d.ts.map +0 -1
- package/esm/client/actions/has_image_snapshot_action.js +0 -6
- package/esm/client/actions/load_image_snapshot_results_action.d.ts +0 -3
- package/esm/client/actions/load_image_snapshot_results_action.d.ts.map +0 -1
- package/esm/client/actions/load_image_snapshot_results_action.js +0 -3
- package/esm/client/actions/match_image_snapshot_action.d.ts +0 -6
- package/esm/client/actions/match_image_snapshot_action.d.ts.map +0 -1
- package/esm/client/actions/match_image_snapshot_action.js +0 -20
- package/esm/client/actions/match_page_image_snapshot_action.d.ts +0 -6
- package/esm/client/actions/match_page_image_snapshot_action.d.ts.map +0 -1
- package/esm/client/actions/match_page_image_snapshot_action.js +0 -9
- package/esm/client/align_images.d.ts +0 -2
- package/esm/client/align_images.d.ts.map +0 -1
- package/esm/client/align_images.js +0 -10
- package/esm/client/auto_snapshot_options.d.ts +0 -29
- package/esm/client/auto_snapshot_options.d.ts.map +0 -1
- package/esm/client/auto_snapshot_options.js +0 -49
- package/esm/client/compare_image_snapshot.d.ts +0 -6
- package/esm/client/compare_image_snapshot.d.ts.map +0 -1
- package/esm/client/compare_image_snapshot.js +0 -52
- package/esm/client/compare_image_snapshot.logic.d.ts +0 -3
- package/esm/client/compare_image_snapshot.logic.d.ts.map +0 -1
- package/esm/client/compare_image_snapshot.logic.js +0 -12
- package/esm/client/ctx.d.ts +0 -7
- package/esm/client/ctx.d.ts.map +0 -1
- package/esm/client/ctx.js +0 -11
- package/esm/client/expect/augment.d.ts +0 -8
- package/esm/client/expect/augment.d.ts.map +0 -1
- package/esm/client/expect/augment.js +0 -1
- package/esm/client/expect/expectation_result.d.ts +0 -3
- package/esm/client/expect/expectation_result.d.ts.map +0 -1
- package/esm/client/expect/expectation_result.js +0 -5
- package/esm/client/expect/extend.d.ts +0 -2
- package/esm/client/expect/extend.d.ts.map +0 -1
- package/esm/client/expect/extend.js +0 -4
- package/esm/client/expect/to_match_image_snapshot.d.ts +0 -9
- package/esm/client/expect/to_match_image_snapshot.d.ts.map +0 -1
- package/esm/client/expect/to_match_image_snapshot.js +0 -21
- package/esm/client/expect/to_match_image_snapshot.types.d.ts +0 -5
- package/esm/client/expect/to_match_image_snapshot.types.d.ts.map +0 -1
- package/esm/client/expect/to_match_image_snapshot.types.js +0 -1
- package/esm/client/image_data.d.ts +0 -3
- package/esm/client/image_data.d.ts.map +0 -1
- package/esm/client/image_data.js +0 -33
- package/esm/client/image_resizer.d.ts +0 -9
- package/esm/client/image_resizer.d.ts.map +0 -1
- package/esm/client/image_resizer.js +0 -49
- package/esm/client/image_snapshot_options.d.ts +0 -2
- package/esm/client/image_snapshot_options.d.ts.map +0 -1
- package/esm/client/image_snapshot_options.js +0 -6
- package/esm/client/page/augment.d.ts +0 -7
- package/esm/client/page/augment.d.ts.map +0 -1
- package/esm/client/page/augment.js +0 -1
- package/esm/client/page/extend.d.ts +0 -2
- package/esm/client/page/extend.d.ts.map +0 -1
- package/esm/client/page/extend.js +0 -5
- package/esm/client/page/has_image_snapshot.d.ts +0 -10
- package/esm/client/page/has_image_snapshot.d.ts.map +0 -1
- package/esm/client/page/has_image_snapshot.js +0 -15
- package/esm/client/page/to_match_image_snapshot.d.ts +0 -6
- package/esm/client/page/to_match_image_snapshot.d.ts.map +0 -1
- package/esm/client/page/to_match_image_snapshot.js +0 -15
- package/esm/client/selector.d.ts +0 -7
- package/esm/client/selector.d.ts.map +0 -1
- package/esm/client/selector.js +0 -97
- package/esm/client/setup/create_vis.d.ts +0 -96
- package/esm/client/setup/create_vis.d.ts.map +0 -1
- package/esm/client/setup/create_vis.js +0 -109
- package/esm/client/setup/vis.ctx.d.ts +0 -12
- package/esm/client/setup/vis.ctx.d.ts.map +0 -1
- package/esm/client/setup/vis.ctx.js +0 -32
- package/esm/client/setup/vis.d.ts +0 -5
- package/esm/client/setup/vis.d.ts.map +0 -1
- package/esm/client/setup/vis.js +0 -6
- package/esm/client/should_take_snapshot.d.ts +0 -3
- package/esm/client/should_take_snapshot.d.ts.map +0 -1
- package/esm/client/should_take_snapshot.js +0 -3
- package/esm/client/snapshot_meta.d.ts +0 -6
- package/esm/client/snapshot_meta.d.ts.map +0 -1
- package/esm/client/snapshot_meta.js +0 -1
- package/esm/client/task_id.d.ts +0 -7
- package/esm/client/task_id.d.ts.map +0 -1
- package/esm/client/task_id.js +0 -10
- package/esm/client/vitest_browser_context_proxy.d.ts +0 -32
- package/esm/client/vitest_browser_context_proxy.d.ts.map +0 -1
- package/esm/client/vitest_browser_context_proxy.js +0 -11
- package/esm/client/vitest_suite_proxy.d.ts +0 -7
- package/esm/client/vitest_suite_proxy.d.ts.map +0 -1
- package/esm/client/vitest_suite_proxy.js +0 -8
- package/esm/client-api.d.ts +0 -12
- package/esm/client-api.d.ts.map +0 -1
- package/esm/client-api.js +0 -9
- package/esm/commands.d.ts +0 -5
- package/esm/commands.d.ts.map +0 -1
- package/esm/commands.js +0 -4
- package/esm/config/types.d.ts +0 -60
- package/esm/config/types.d.ts.map +0 -1
- package/esm/config/types.js +0 -1
- package/esm/config/vis.d.ts +0 -28
- package/esm/config/vis.d.ts.map +0 -1
- package/esm/config/vis.js +0 -27
- package/esm/config.d.ts +0 -4
- package/esm/config.d.ts.map +0 -1
- package/esm/config.js +0 -2
- package/esm/index.d.ts +0 -5
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -4
- package/esm/presets/auto.d.ts +0 -2
- package/esm/presets/auto.d.ts.map +0 -1
- package/esm/presets/auto.js +0 -8
- package/esm/presets/enable.d.ts +0 -2
- package/esm/presets/enable.d.ts.map +0 -1
- package/esm/presets/enable.js +0 -4
- package/esm/presets/manual.d.ts +0 -2
- package/esm/presets/manual.d.ts.map +0 -1
- package/esm/presets/manual.js +0 -4
- package/esm/server/browser_provider/browser_api.d.ts +0 -3
- package/esm/server/browser_provider/browser_api.d.ts.map +0 -1
- package/esm/server/browser_provider/browser_api.js +0 -11
- package/esm/server/browser_provider/playwright.d.ts +0 -4
- package/esm/server/browser_provider/playwright.d.ts.map +0 -1
- package/esm/server/browser_provider/playwright.js +0 -18
- package/esm/server/browser_provider/types.d.ts +0 -10
- package/esm/server/browser_provider/types.d.ts.map +0 -1
- package/esm/server/browser_provider/types.js +0 -1
- package/esm/server/browser_provider/webdriverio.d.ts +0 -4
- package/esm/server/browser_provider/webdriverio.d.ts.map +0 -1
- package/esm/server/browser_provider/webdriverio.js +0 -12
- package/esm/server/commands/_assertions.d.ts +0 -5
- package/esm/server/commands/_assertions.d.ts.map +0 -1
- package/esm/server/commands/_assertions.js +0 -11
- package/esm/server/commands/augment.d.ts +0 -11
- package/esm/server/commands/augment.d.ts.map +0 -1
- package/esm/server/commands/augment.js +0 -1
- package/esm/server/commands/commands.d.ts +0 -9
- package/esm/server/commands/commands.d.ts.map +0 -1
- package/esm/server/commands/commands.js +0 -14
- package/esm/server/commands/has_image_snapshot.d.ts +0 -6
- package/esm/server/commands/has_image_snapshot.d.ts.map +0 -1
- package/esm/server/commands/has_image_snapshot.js +0 -6
- package/esm/server/commands/image_snapshot_next_index.d.ts +0 -9
- package/esm/server/commands/image_snapshot_next_index.d.ts.map +0 -1
- package/esm/server/commands/image_snapshot_next_index.js +0 -6
- package/esm/server/commands/load_image_snapshot_results.d.ts +0 -21
- package/esm/server/commands/load_image_snapshot_results.d.ts.map +0 -1
- package/esm/server/commands/load_image_snapshot_results.js +0 -6
- package/esm/server/commands/prepare_image_snapshot_comparison.d.ts +0 -38
- package/esm/server/commands/prepare_image_snapshot_comparison.d.ts.map +0 -1
- package/esm/server/commands/prepare_image_snapshot_comparison.js +0 -34
- package/esm/server/commands/prepare_page_image_snapshot_comparison.d.ts +0 -35
- package/esm/server/commands/prepare_page_image_snapshot_comparison.d.ts.map +0 -1
- package/esm/server/commands/prepare_page_image_snapshot_comparison.js +0 -27
- package/esm/server/commands/setup_vis_suite.d.ts +0 -15
- package/esm/server/commands/setup_vis_suite.d.ts.map +0 -1
- package/esm/server/commands/setup_vis_suite.js +0 -6
- package/esm/server/commands/types.d.ts +0 -3
- package/esm/server/commands/types.d.ts.map +0 -1
- package/esm/server/commands/types.js +0 -1
- package/esm/server/externals/file.d.ts +0 -10
- package/esm/server/externals/file.d.ts.map +0 -1
- package/esm/server/externals/file.js +0 -20
- package/esm/server/project.d.ts +0 -21
- package/esm/server/project.d.ts.map +0 -1
- package/esm/server/project.js +0 -13
- package/esm/server/snapshot.d.ts +0 -6
- package/esm/server/snapshot.d.ts.map +0 -1
- package/esm/server/snapshot.js +0 -29
- package/esm/server/snapshot_path.d.ts +0 -14
- package/esm/server/snapshot_path.d.ts.map +0 -1
- package/esm/server/snapshot_path.js +0 -34
- package/esm/server/snapshot_writer.d.ts +0 -13
- package/esm/server/snapshot_writer.d.ts.map +0 -1
- package/esm/server/snapshot_writer.js +0 -15
- package/esm/server/suite.d.ts +0 -54
- package/esm/server/suite.d.ts.map +0 -1
- package/esm/server/suite.js +0 -73
- package/esm/server/vis_options.d.ts +0 -19
- package/esm/server/vis_options.d.ts.map +0 -1
- package/esm/server/vis_options.js +0 -14
- package/esm/server/vis_server_context.d.ts +0 -50
- package/esm/server/vis_server_context.d.ts.map +0 -1
- package/esm/server/vis_server_context.deps.d.ts +0 -29
- package/esm/server/vis_server_context.deps.d.ts.map +0 -1
- package/esm/server/vis_server_context.deps.js +0 -10
- package/esm/server/vis_server_context.js +0 -2
- package/esm/server/vis_server_context.logic.d.ts +0 -53
- package/esm/server/vis_server_context.logic.d.ts.map +0 -1
- package/esm/server/vis_server_context.logic.js +0 -79
- package/esm/server/vis_server_context.types.d.ts +0 -54
- package/esm/server/vis_server_context.types.d.ts.map +0 -1
- package/esm/server/vis_server_context.types.js +0 -1
- package/esm/server-utils.d.ts +0 -4
- package/esm/server-utils.d.ts.map +0 -1
- package/esm/server-utils.js +0 -3
- package/esm/setup.d.ts +0 -5
- package/esm/setup.d.ts.map +0 -1
- package/esm/setup.js +0 -5
- package/esm/shared/asserts.d.ts +0 -2
- package/esm/shared/asserts.d.ts.map +0 -1
- package/esm/shared/asserts.js +0 -5
- package/esm/shared/base64.d.ts +0 -2
- package/esm/shared/base64.d.ts.map +0 -1
- package/esm/shared/base64.js +0 -3
- package/esm/shared/compare_image.d.ts +0 -6
- package/esm/shared/compare_image.d.ts.map +0 -1
- package/esm/shared/compare_image.js +0 -42
- package/esm/shared/constants.d.ts +0 -6
- package/esm/shared/constants.d.ts.map +0 -1
- package/esm/shared/constants.js +0 -5
- package/esm/shared/convert_threshold_unit.d.ts +0 -6
- package/esm/shared/convert_threshold_unit.d.ts.map +0 -1
- package/esm/shared/convert_threshold_unit.js +0 -10
- package/esm/shared/get_max_size.d.ts +0 -11
- package/esm/shared/get_max_size.d.ts.map +0 -1
- package/esm/shared/get_max_size.js +0 -5
- package/esm/shared/is_same_size.d.ts +0 -8
- package/esm/shared/is_same_size.d.ts.map +0 -1
- package/esm/shared/is_same_size.js +0 -3
- package/esm/shared/trim_common_folder.d.ts +0 -6
- package/esm/shared/trim_common_folder.d.ts.map +0 -1
- package/esm/shared/trim_common_folder.js +0 -11
- package/esm/shared/types.d.ts +0 -90
- package/esm/shared/types.d.ts.map +0 -1
- package/esm/shared/types.js +0 -1
- package/esm/testing/constants.d.ts +0 -9
- package/esm/testing/constants.d.ts.map +0 -1
- package/esm/testing/constants.js +0 -1933
- package/esm/testing/stubBrowserCommandContext.d.ts +0 -8
- package/esm/testing/stubBrowserCommandContext.d.ts.map +0 -1
- package/esm/testing/stubBrowserCommandContext.js +0 -12
- package/esm/testing/stubSuite.d.ts +0 -10
- package/esm/testing/stubSuite.d.ts.map +0 -1
- package/esm/testing/stubSuite.js +0 -27
- package/esm/testing/stubUserConfig.d.ts +0 -7
- package/esm/testing/stubUserConfig.d.ts.map +0 -1
- package/esm/testing/stubUserConfig.js +0 -4
- package/esm/testing.d.ts +0 -3
- package/esm/testing.d.ts.map +0 -1
- package/esm/testing.js +0 -2
- package/src/client/image_snapshot_options.ts +0 -6
- package/src/client/setup/vis.ctx.ts +0 -33
- package/src/client/should_take_snapshot.ts +0 -5
- package/src/server/commands/types.ts +0 -9
- package/src/testing/stubBrowserCommandContext.ts +0 -16
- package/src/testing/stubUserConfig.ts +0 -6
- /package/src/client/{image_data.ts → external/browser/image_data.ts} +0 -0
- /package/src/client/{selector.ts → external/browser/selector.ts} +0 -0
- /package/src/client/{auto_snapshot_options.mdx → task/auto_snapshot_options.mdx} +0 -0
- /package/src/client/{task_id.ts → task/task_id.ts} +0 -0
package/esm/config/types.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ComparisonMethod, FailureThresholdOptions, ImageSnapshotKeyOptions, ImageSnapshotSubjectOptions, ImageSnapshotTimeoutOptions, PixelComparisonOptions, PixelDiffOptions, SsimComparisonOptions, SsimDiffOptions } from '../shared/types.ts';
|
|
2
|
-
export type { ComparisonMethod, PixelComparisonOptions, PixelDiffOptions, SsimComparisonOptions, SsimDiffOptions };
|
|
3
|
-
export type VisOptions<M extends ComparisonMethod = 'pixel'> = (M extends 'ssim' ? {
|
|
4
|
-
comparisonMethod: M;
|
|
5
|
-
/**
|
|
6
|
-
* Custom options passed to 'ssim'
|
|
7
|
-
*/
|
|
8
|
-
diffOptions?: Partial<SsimDiffOptions> | undefined;
|
|
9
|
-
} : {
|
|
10
|
-
comparisonMethod?: M | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Custom options passed to 'pixelmatch'
|
|
13
|
-
*/
|
|
14
|
-
diffOptions?: PixelDiffOptions | undefined;
|
|
15
|
-
}) & FailureThresholdOptions & ImageSnapshotTimeoutOptions & ImageSnapshotKeyOptions & ImageSnapshotSubjectOptions & {
|
|
16
|
-
/**
|
|
17
|
-
* Loads the `test.setupFiles` of the specified preset.
|
|
18
|
-
*
|
|
19
|
-
* Note:
|
|
20
|
-
* - 'enable` is deprecated. Use `manual` for the same effect.
|
|
21
|
-
* - 'none` is deprecated. Use `custom` for the same effect.
|
|
22
|
-
*
|
|
23
|
-
* @default 'auto'
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
preset?: 'enable' | 'manual' | 'auto' | 'custom' | 'none' | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* The snapshot folder relative to the root of the project.
|
|
29
|
-
*
|
|
30
|
-
* Default: `{projectRoot}/__vis__/{platform}`
|
|
31
|
-
*/
|
|
32
|
-
snapshotRootDir?: string | ((context: {
|
|
33
|
-
ci: boolean;
|
|
34
|
-
browserName?: string | undefined;
|
|
35
|
-
providerName: string;
|
|
36
|
-
platform: string;
|
|
37
|
-
screenshotFailures?: boolean | undefined;
|
|
38
|
-
screenshotDirectory?: string | undefined;
|
|
39
|
-
}) => string) | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Customize the snapshot subpath.
|
|
42
|
-
*
|
|
43
|
-
* Typically, you place your test files either in a dedicated `tests` folder or in the `src` folder along with your source code.
|
|
44
|
-
* By default, the snapshot subpath is the test file path with that folder removed to reduces nesting of the snapshot folders.
|
|
45
|
-
*
|
|
46
|
-
* If you place your test files in multiple folders,
|
|
47
|
-
* such as in both `tests` and `src` folders,
|
|
48
|
-
* and they might have files with the same name and create conflicting snapshots,
|
|
49
|
-
* you can set this to customize the snapshot subpath.
|
|
50
|
-
*
|
|
51
|
-
* @param options - Options for customizing the snapshot subpath.
|
|
52
|
-
* @property subPath - The path of the test file to be used as the snapshot subpath.
|
|
53
|
-
* To retain the full path, simply return it.
|
|
54
|
-
* @returns The customized snapshot subpath.
|
|
55
|
-
*/
|
|
56
|
-
snapshotSubpath?: ((options: {
|
|
57
|
-
subpath: string;
|
|
58
|
-
}) => string) | undefined;
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,MAAM,oBAAoB,CAAA;AAE3B,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,CAAA;AAElH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,gBAAgB,GAAG,OAAO,IAAI,CAAC,CAAC,SAAS,MAAM,GAC7E;IACA,gBAAgB,EAAE,CAAC,CAAA;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;CAClD,GACA;IACA,gBAAgB,CAAC,EAAE,CAAC,GAAG,SAAS,CAAA;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAC1C,CAAC,GACH,uBAAuB,GACvB,2BAA2B,GAC3B,uBAAuB,GACvB,2BAA2B,GAAG;IAC7B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;IACrE;;;;OAIG;IACH,eAAe,CAAC,EACb,MAAM,GACN,CAAC,CAAC,OAAO,EAAE;QACX,EAAE,EAAE,OAAO,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAChC,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACxC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KACvC,KAAK,MAAM,CAAC,GACb,SAAS,CAAA;IACZ;;;;;;;;;;;;;;;OAeG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;CACxE,CAAA"}
|
package/esm/config/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/config/vis.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ComparisonMethod } from '../shared/types.ts';
|
|
2
|
-
import type { VisOptions } from './types.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Create a Vite plugin for visual testing.
|
|
5
|
-
*
|
|
6
|
-
* If options are not provided, the plugin will use the default options,
|
|
7
|
-
* which enables the `auto` preset.
|
|
8
|
-
*/
|
|
9
|
-
export declare function vis<M extends ComparisonMethod = 'pixel'>(options?: VisOptions<M>): {
|
|
10
|
-
name: string;
|
|
11
|
-
config(this: unknown, userConfig: import("vite").UserConfig): {
|
|
12
|
-
test: {
|
|
13
|
-
browser: {
|
|
14
|
-
name: string;
|
|
15
|
-
commands: {
|
|
16
|
-
setupVisSuite: import("vitest/node").BrowserCommand<[]>;
|
|
17
|
-
imageSnapshotNextIndex: import("vitest/node").BrowserCommand<[taskId: string]>;
|
|
18
|
-
hasImageSnapshot: import("vitest/node").BrowserCommand<[taskId: string, snapshotKey: string | undefined]>;
|
|
19
|
-
preparePageImageSnapshotComparison: import("vitest/node").BrowserCommand<[taskId: string, options?: import("../server/commands/types.ts").MatchImageSnapshotOptions | undefined]>;
|
|
20
|
-
prepareImageSnapshotComparison: import("vitest/node").BrowserCommand<[taskId: string, subject: string, options?: import("../server/commands/types.ts").MatchImageSnapshotOptions | undefined]>;
|
|
21
|
-
loadImageSnapshotResults: import("vitest/node").BrowserCommand<[taskId: string]>;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
setupFiles: string[];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=vis.d.ts.map
|
package/esm/config/vis.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vis.d.ts","sourceRoot":"","sources":["../../src/config/vis.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,gBAAgB,GAAG,OAAO,EAAE,OAAO,GAAE,UAAU,CAAC,CAAC,CAA6B;;iBAG7F,OAAO;;;sBAMc,MAAM;;;;;;;;;;;;;EAQzC"}
|
package/esm/config/vis.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { commands } from "../server/commands/commands.js";
|
|
2
|
-
import { setVisOption } from "../server/vis_options.js";
|
|
3
|
-
import { NAME } from "../shared/constants.js";
|
|
4
|
-
/**
|
|
5
|
-
* Create a Vite plugin for visual testing.
|
|
6
|
-
*
|
|
7
|
-
* If options are not provided, the plugin will use the default options,
|
|
8
|
-
* which enables the `auto` preset.
|
|
9
|
-
*/
|
|
10
|
-
export function vis(options = { preset: 'auto' }) {
|
|
11
|
-
return {
|
|
12
|
-
name: NAME,
|
|
13
|
-
config(userConfig) {
|
|
14
|
-
setVisOption(userConfig, options);
|
|
15
|
-
const preset = options?.preset;
|
|
16
|
-
return {
|
|
17
|
-
test: {
|
|
18
|
-
browser: {
|
|
19
|
-
name: undefined,
|
|
20
|
-
commands,
|
|
21
|
-
},
|
|
22
|
-
setupFiles: preset && preset !== 'none' && preset !== 'custom' ? [`vitest-plugin-vis/presets/${preset}`] : [],
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
package/esm/config.d.ts
DELETED
package/esm/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,mBAAmB,mBAAmB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gCAAgC,CAAA"}
|
package/esm/config.js
DELETED
package/esm/index.d.ts
DELETED
package/esm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,sBAAsB,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AACzF,mBAAmB,mBAAmB,CAAA"}
|
package/esm/index.js
DELETED
package/esm/presets/auto.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto.d.ts","sourceRoot":"","sources":["../../src/presets/auto.ts"],"names":[],"mappings":""}
|
package/esm/presets/auto.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeAll } from 'vitest';
|
|
2
|
-
import { setAutoSnapshotOptions } from "../index.js";
|
|
3
|
-
import { vis } from "../setup.js";
|
|
4
|
-
beforeAll(async () => {
|
|
5
|
-
await vis.beforeAll.setup();
|
|
6
|
-
setAutoSnapshotOptions(true);
|
|
7
|
-
});
|
|
8
|
-
afterEach(() => vis.afterEach.matchImageSnapshot());
|
package/esm/presets/enable.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../src/presets/enable.ts"],"names":[],"mappings":""}
|
package/esm/presets/enable.js
DELETED
package/esm/presets/manual.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../src/presets/manual.ts"],"names":[],"mappings":""}
|
package/esm/presets/manual.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser_api.d.ts","sourceRoot":"","sources":["../../../src/server/browser_provider/browser_api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAIxD,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,mCAQxD"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { playwright } from "./playwright.js";
|
|
2
|
-
import { webdriverio } from "./webdriverio.js";
|
|
3
|
-
export function browserApi(context) {
|
|
4
|
-
if (context.provider.name === 'playwright') {
|
|
5
|
-
return playwright(context);
|
|
6
|
-
}
|
|
7
|
-
if (context.provider.name === 'webdriverio') {
|
|
8
|
-
return webdriverio(context);
|
|
9
|
-
}
|
|
10
|
-
throw new Error(`Unsupported provider: ${context.provider.name}`);
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../../src/server/browser_provider/playwright.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,UAAU,CAgBrE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'pathe';
|
|
2
|
-
export function playwright(context) {
|
|
3
|
-
return {
|
|
4
|
-
async takeScreenshot(projectRoot, relativeFilePath, selector, options) {
|
|
5
|
-
const subject = context.iframe.locator(selector);
|
|
6
|
-
return subject.screenshot({
|
|
7
|
-
path: resolve(projectRoot, relativeFilePath),
|
|
8
|
-
...options,
|
|
9
|
-
});
|
|
10
|
-
},
|
|
11
|
-
async takePageScreenshot(projectRoot, relativeFilePath, options) {
|
|
12
|
-
return context.page.screenshot({
|
|
13
|
-
path: resolve(projectRoot, relativeFilePath),
|
|
14
|
-
...options,
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface BrowserApi {
|
|
2
|
-
takeScreenshot(projectRoot: string, relativeFilePath: string, selector: string, options: {
|
|
3
|
-
timeout?: number | undefined;
|
|
4
|
-
} | undefined): Promise<Buffer>;
|
|
5
|
-
takePageScreenshot(projectRoot: string, relativeFilePath: string, options: {
|
|
6
|
-
fullPage?: boolean | undefined;
|
|
7
|
-
timeout?: number | undefined;
|
|
8
|
-
} | undefined): Promise<Buffer>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/browser_provider/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAC1B,cAAc,CACb,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,EACJ;QACA,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,GACD,SAAS,GACV,OAAO,CAAC,MAAM,CAAC,CAAA;IAClB,kBAAkB,CACjB,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,OAAO,EACJ;QACA,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,GACD,SAAS,GACV,OAAO,CAAC,MAAM,CAAC,CAAA;CAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webdriverio.d.ts","sourceRoot":"","sources":["../../../src/server/browser_provider/webdriverio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,UAAU,CAWtE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function webdriverio(context) {
|
|
2
|
-
const browser = context.browser;
|
|
3
|
-
return {
|
|
4
|
-
async takeScreenshot(_projectRoot, relativeFilePath, selector) {
|
|
5
|
-
const element = await browser.$(`${selector}`);
|
|
6
|
-
return element.saveScreenshot(relativeFilePath);
|
|
7
|
-
},
|
|
8
|
-
async takePageScreenshot(_projectRoot, relativeFilePath, options) {
|
|
9
|
-
return browser.saveScreenshot(relativeFilePath, options);
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RequiredPick } from 'type-plus';
|
|
2
|
-
import type { BrowserCommandContext } from 'vitest/node';
|
|
3
|
-
export declare function assertTestPathDefined(context: BrowserCommandContext, commandName: string): asserts context is RequiredPick<BrowserCommandContext, 'testPath'>;
|
|
4
|
-
export declare function assertIsRelativePath(relativeFilePath: string, propName: string): void;
|
|
5
|
-
//# sourceMappingURL=_assertions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_assertions.d.ts","sourceRoot":"","sources":["../../../src/server/commands/_assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAIpE;AAED,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAI9E"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isAbsolute } from 'pathe';
|
|
2
|
-
export function assertTestPathDefined(context, commandName) {
|
|
3
|
-
if (!context.testPath) {
|
|
4
|
-
throw new Error(`'commands.${commandName}' requires testPath to be defined`);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export function assertIsRelativePath(relativeFilePath, propName) {
|
|
8
|
-
if (isAbsolute(relativeFilePath)) {
|
|
9
|
-
throw new Error(`'${propName}' must be a relative path`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HasImageSnapshotCommand } from './has_image_snapshot.ts';
|
|
2
|
-
import type { ImageSnapshotNextIndexCommand } from './image_snapshot_next_index.ts';
|
|
3
|
-
import type { LoadImageSnapshotResultsCommand } from './load_image_snapshot_results.ts';
|
|
4
|
-
import type { PrepareImageSnapshotComparisonCommand } from './prepare_image_snapshot_comparison.ts';
|
|
5
|
-
import type { PreparePageImageSnapshotComparisonCommand } from './prepare_page_image_snapshot_comparison.ts';
|
|
6
|
-
import type { SetupVisSuiteCommand } from './setup_vis_suite.ts';
|
|
7
|
-
declare module '@vitest/browser/context' {
|
|
8
|
-
interface BrowserCommands extends SetupVisSuiteCommand, ImageSnapshotNextIndexCommand, HasImageSnapshotCommand, PreparePageImageSnapshotComparisonCommand, PrepareImageSnapshotComparisonCommand, LoadImageSnapshotResultsCommand {
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=augment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../../../src/server/commands/augment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AACnF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAA;AACvF,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,wCAAwC,CAAA;AACnG,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAA;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,QAAQ,yBAAyB,CAAC;IACxC,UAAU,eACT,SAAQ,oBAAoB,EAC3B,6BAA6B,EAC7B,uBAAuB,EACvB,yCAAyC,EACzC,qCAAqC,EACrC,+BAA+B;KAAG;CACpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const commands: {
|
|
2
|
-
setupVisSuite: import("vitest/node").BrowserCommand<[]>;
|
|
3
|
-
imageSnapshotNextIndex: import("vitest/node").BrowserCommand<[taskId: string]>;
|
|
4
|
-
hasImageSnapshot: import("vitest/node").BrowserCommand<[taskId: string, snapshotKey: string | undefined]>;
|
|
5
|
-
preparePageImageSnapshotComparison: import("vitest/node").BrowserCommand<[taskId: string, options?: import("./types.ts").MatchImageSnapshotOptions | undefined]>;
|
|
6
|
-
prepareImageSnapshotComparison: import("vitest/node").BrowserCommand<[taskId: string, subject: string, options?: import("./types.ts").MatchImageSnapshotOptions | undefined]>;
|
|
7
|
-
loadImageSnapshotResults: import("vitest/node").BrowserCommand<[taskId: string]>;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/server/commands/commands.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { hasImageSnapshot } from "./has_image_snapshot.js";
|
|
2
|
-
import { imageSnapshotNextIndex } from "./image_snapshot_next_index.js";
|
|
3
|
-
import { loadImageSnapshotResults } from "./load_image_snapshot_results.js";
|
|
4
|
-
import { prepareImageSnapshotComparison } from "./prepare_image_snapshot_comparison.js";
|
|
5
|
-
import { preparePageImageSnapshotComparison } from "./prepare_page_image_snapshot_comparison.js";
|
|
6
|
-
import { setupVisSuite } from "./setup_vis_suite.js";
|
|
7
|
-
export const commands = {
|
|
8
|
-
setupVisSuite,
|
|
9
|
-
imageSnapshotNextIndex,
|
|
10
|
-
hasImageSnapshot,
|
|
11
|
-
preparePageImageSnapshotComparison,
|
|
12
|
-
prepareImageSnapshotComparison,
|
|
13
|
-
loadImageSnapshotResults,
|
|
14
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
2
|
-
export interface HasImageSnapshotCommand {
|
|
3
|
-
hasImageSnapshot(taskId: string, snapshotKey: string | undefined): Promise<boolean>;
|
|
4
|
-
}
|
|
5
|
-
export declare const hasImageSnapshot: BrowserCommand<Parameters<HasImageSnapshotCommand['hasImageSnapshot']>>;
|
|
6
|
-
//# sourceMappingURL=has_image_snapshot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has_image_snapshot.d.ts","sourceRoot":"","sources":["../../../src/server/commands/has_image_snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,MAAM,WAAW,uBAAuB;IACvC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACnF;AAED,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,UAAU,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CAQpG,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { visServerContext } from "../vis_server_context.js";
|
|
2
|
-
import { assertTestPathDefined } from "./_assertions.js";
|
|
3
|
-
export const hasImageSnapshot = async (context, taskId, snapshotKey) => {
|
|
4
|
-
assertTestPathDefined(context, 'hasImageSnapshot');
|
|
5
|
-
return visServerContext.hasImageSnapshot(context, taskId, snapshotKey);
|
|
6
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
2
|
-
export interface ImageSnapshotNextIndexCommand {
|
|
3
|
-
/**
|
|
4
|
-
* Get the index of the snapshot image to be created.
|
|
5
|
-
*/
|
|
6
|
-
imageSnapshotNextIndex(taskId: string): Promise<number>;
|
|
7
|
-
}
|
|
8
|
-
export declare const imageSnapshotNextIndex: BrowserCommand<Parameters<ImageSnapshotNextIndexCommand['imageSnapshotNextIndex']>>;
|
|
9
|
-
//# sourceMappingURL=image_snapshot_next_index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image_snapshot_next_index.d.ts","sourceRoot":"","sources":["../../../src/server/commands/image_snapshot_next_index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACvD;AAED,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAClD,UAAU,CAAC,6BAA6B,CAAC,wBAAwB,CAAC,CAAC,CAKnE,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { visServerContext } from "../vis_server_context.js";
|
|
2
|
-
import { assertTestPathDefined } from "./_assertions.js";
|
|
3
|
-
export const imageSnapshotNextIndex = async (context, taskId) => {
|
|
4
|
-
assertTestPathDefined(context, 'imageSnapshotNextIndex');
|
|
5
|
-
return visServerContext.getTaskCount(context, taskId);
|
|
6
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
2
|
-
export interface ImageSnapshotResult {
|
|
3
|
-
filename: string;
|
|
4
|
-
/**
|
|
5
|
-
* The base64 encoded image of the baseline snapshot.
|
|
6
|
-
*/
|
|
7
|
-
baseline?: string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* The base64 encoded image of the result snapshot.
|
|
10
|
-
*/
|
|
11
|
-
result?: string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* The base64 encoded image of the diff snapshot.
|
|
14
|
-
*/
|
|
15
|
-
diff?: string | undefined;
|
|
16
|
-
}
|
|
17
|
-
export interface LoadImageSnapshotResultsCommand {
|
|
18
|
-
loadImageSnapshotResults(taskId: string): Promise<ImageSnapshotResult[]>;
|
|
19
|
-
}
|
|
20
|
-
export declare const loadImageSnapshotResults: BrowserCommand<[taskId: string]>;
|
|
21
|
-
//# sourceMappingURL=load_image_snapshot_results.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load_image_snapshot_results.d.ts","sourceRoot":"","sources":["../../../src/server/commands/load_image_snapshot_results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,+BAA+B;IAC/C,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAA;CACxE;AAED,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAOrE,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { visServerContext } from "../vis_server_context.js";
|
|
2
|
-
import { assertTestPathDefined } from "./_assertions.js";
|
|
3
|
-
export const loadImageSnapshotResults = async (context, taskId) => {
|
|
4
|
-
assertTestPathDefined(context, 'loadImageSnapshotResults');
|
|
5
|
-
return visServerContext.getSnapshotResults(context, taskId);
|
|
6
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
2
|
-
import type { FailureThresholdOptions, ImageSnapshotTimeoutOptions, PixelComparisonOptions, SsimComparisonOptions } from '../../shared/types.ts';
|
|
3
|
-
import type { MatchImageSnapshotOptions } from './types.ts';
|
|
4
|
-
export type ImageSnapshotComparisonInfo = {
|
|
5
|
-
/**
|
|
6
|
-
* Path to the project root.
|
|
7
|
-
*/
|
|
8
|
-
projectRoot: string;
|
|
9
|
-
/**
|
|
10
|
-
* Path to the baseline image relative to the project root.
|
|
11
|
-
*/
|
|
12
|
-
baselinePath: string;
|
|
13
|
-
/**
|
|
14
|
-
* Path to the result image relative to the project root.
|
|
15
|
-
*/
|
|
16
|
-
resultPath: string;
|
|
17
|
-
/**
|
|
18
|
-
* Path to the diff image relative to the project root.
|
|
19
|
-
*/
|
|
20
|
-
diffPath: string;
|
|
21
|
-
/**
|
|
22
|
-
* Base64 encoded baseline image.
|
|
23
|
-
*/
|
|
24
|
-
baseline: string;
|
|
25
|
-
/**
|
|
26
|
-
* Base64 encoded result image.
|
|
27
|
-
*/
|
|
28
|
-
result: string;
|
|
29
|
-
/**
|
|
30
|
-
* Base64 encoded diff image.
|
|
31
|
-
*/
|
|
32
|
-
diff?: string | undefined;
|
|
33
|
-
} & ImageSnapshotTimeoutOptions & FailureThresholdOptions & (SsimComparisonOptions | PixelComparisonOptions);
|
|
34
|
-
export interface PrepareImageSnapshotComparisonCommand {
|
|
35
|
-
prepareImageSnapshotComparison: (taskId: string, subject: string, options?: MatchImageSnapshotOptions | undefined) => Promise<ImageSnapshotComparisonInfo | undefined>;
|
|
36
|
-
}
|
|
37
|
-
export declare const prepareImageSnapshotComparison: BrowserCommand<Parameters<PrepareImageSnapshotComparisonCommand['prepareImageSnapshotComparison']>>;
|
|
38
|
-
//# sourceMappingURL=prepare_image_snapshot_comparison.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepare_image_snapshot_comparison.d.ts","sourceRoot":"","sources":["../../../src/server/commands/prepare_image_snapshot_comparison.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,KAAK,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,uBAAuB,CAAA;AAO9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,MAAM,2BAA2B,GAAG;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB,GAAG,2BAA2B,GAC9B,uBAAuB,GACvB,CAAC,qBAAqB,GAAG,sBAAsB,CAAC,CAAA;AAEjD,MAAM,WAAW,qCAAqC;IACrD,8BAA8B,EAAE,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,yBAAyB,GAAG,SAAS,KAC3C,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAA;CACrD;AAED,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAC1D,UAAU,CAAC,qCAAqC,CAAC,gCAAgC,CAAC,CAAC,CA2BnF,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'pathe';
|
|
2
|
-
import { isBase64String } from "../../shared/base64.js";
|
|
3
|
-
import { file } from "../externals/file.js";
|
|
4
|
-
import { getProjectRoot } from "../project.js";
|
|
5
|
-
import { takeSnapshot, takeSnapshotByBrowser } from "../snapshot.js";
|
|
6
|
-
import { snapshotWriter } from "../snapshot_writer.js";
|
|
7
|
-
import { visServerContext } from "../vis_server_context.js";
|
|
8
|
-
import { assertTestPathDefined } from "./_assertions.js";
|
|
9
|
-
export const prepareImageSnapshotComparison = async (context, taskId, subject, options) => {
|
|
10
|
-
assertTestPathDefined(context, 'prepareImageSnapshotComparison');
|
|
11
|
-
// vitest:browser passes in `null` when not defined
|
|
12
|
-
if (!options)
|
|
13
|
-
options = {};
|
|
14
|
-
options.timeout = options.timeout ?? 30000;
|
|
15
|
-
const projectRoot = getProjectRoot(context);
|
|
16
|
-
const info = await visServerContext.getSnapshotInfo(context, taskId, options);
|
|
17
|
-
const baselineBuffer = await file.tryReadFile(resolve(projectRoot, info.baselinePath));
|
|
18
|
-
if (!baselineBuffer) {
|
|
19
|
-
if (isBase64String(subject)) {
|
|
20
|
-
await snapshotWriter.writeBase64(resolve(projectRoot, info.baselinePath), subject);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
await takeSnapshotByBrowser(context, projectRoot, info.baselinePath, subject, options);
|
|
24
|
-
}
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const resultBuffer = await takeSnapshot(context, projectRoot, info.resultPath, subject, options);
|
|
28
|
-
return {
|
|
29
|
-
...info,
|
|
30
|
-
projectRoot,
|
|
31
|
-
baseline: baselineBuffer.toString('base64'),
|
|
32
|
-
result: resultBuffer.toString('base64'),
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
2
|
-
import type { FailureThresholdOptions, ImageSnapshotTimeoutOptions, PixelComparisonOptions, SsimComparisonOptions } from '../../shared/types.ts';
|
|
3
|
-
import type { MatchImageSnapshotOptions } from './types.ts';
|
|
4
|
-
type ImageSnapshotComparisonInfo = {
|
|
5
|
-
/**
|
|
6
|
-
* Path to the project root.
|
|
7
|
-
*/
|
|
8
|
-
projectRoot: string;
|
|
9
|
-
/**
|
|
10
|
-
* Path to the baseline image relative to the project root.
|
|
11
|
-
*/
|
|
12
|
-
baselinePath: string;
|
|
13
|
-
/**
|
|
14
|
-
* Path to the result image relative to the project root.
|
|
15
|
-
*/
|
|
16
|
-
resultPath: string;
|
|
17
|
-
/**
|
|
18
|
-
* Path to the diff image relative to the project root.
|
|
19
|
-
*/
|
|
20
|
-
diffPath: string;
|
|
21
|
-
/**
|
|
22
|
-
* Base64 encoded baseline image.
|
|
23
|
-
*/
|
|
24
|
-
baseline: string;
|
|
25
|
-
/**
|
|
26
|
-
* Base64 encoded result image.
|
|
27
|
-
*/
|
|
28
|
-
result: string;
|
|
29
|
-
} & ImageSnapshotTimeoutOptions & FailureThresholdOptions & (SsimComparisonOptions | PixelComparisonOptions);
|
|
30
|
-
export interface PreparePageImageSnapshotComparisonCommand {
|
|
31
|
-
preparePageImageSnapshotComparison: (taskId: string, options?: MatchImageSnapshotOptions | undefined) => Promise<ImageSnapshotComparisonInfo | undefined>;
|
|
32
|
-
}
|
|
33
|
-
export declare const preparePageImageSnapshotComparison: BrowserCommand<Parameters<PreparePageImageSnapshotComparisonCommand['preparePageImageSnapshotComparison']>>;
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=prepare_page_image_snapshot_comparison.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepare_page_image_snapshot_comparison.d.ts","sourceRoot":"","sources":["../../../src/server/commands/prepare_page_image_snapshot_comparison.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,KAAK,2BAA2B,GAAG;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACd,GAAG,2BAA2B,GAC9B,uBAAuB,GACvB,CAAC,qBAAqB,GAAG,sBAAsB,CAAC,CAAA;AAEjD,MAAM,WAAW,yCAAyC;IACzD,kCAAkC,EAAE,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,yBAAyB,GAAG,SAAS,KAC3C,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAA;CACrD;AAED,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAC9D,UAAU,CAAC,yCAAyC,CAAC,oCAAoC,CAAC,CAAC,CAsB3F,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'pathe';
|
|
2
|
-
import { file } from "../externals/file.js";
|
|
3
|
-
import { getProjectRoot } from "../project.js";
|
|
4
|
-
import { takePageSnapshot } from "../snapshot.js";
|
|
5
|
-
import { visServerContext } from "../vis_server_context.js";
|
|
6
|
-
import { assertTestPathDefined } from "./_assertions.js";
|
|
7
|
-
export const preparePageImageSnapshotComparison = async (context, taskId, options) => {
|
|
8
|
-
assertTestPathDefined(context, 'preparePageImageSnapshotComparison');
|
|
9
|
-
// vitest:browser passes in `null` when not defined
|
|
10
|
-
if (!options)
|
|
11
|
-
options = {};
|
|
12
|
-
options.timeout = options.timeout ?? 30000;
|
|
13
|
-
const projectRoot = getProjectRoot(context);
|
|
14
|
-
const info = await visServerContext.getSnapshotInfo(context, taskId, options);
|
|
15
|
-
const baselineBuffer = await file.tryReadFile(resolve(projectRoot, info.baselinePath));
|
|
16
|
-
if (!baselineBuffer) {
|
|
17
|
-
await takePageSnapshot(context, projectRoot, info.baselinePath, options);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const resultBuffer = await takePageSnapshot(context, projectRoot, info.resultPath, options);
|
|
21
|
-
return {
|
|
22
|
-
...info,
|
|
23
|
-
projectRoot,
|
|
24
|
-
baseline: baselineBuffer.toString('base64'),
|
|
25
|
-
result: resultBuffer.toString('base64'),
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Pick } from 'type-plus';
|
|
2
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
3
|
-
import type { VisOptions } from '../../config/types.ts';
|
|
4
|
-
export interface SetupVisSuiteCommand {
|
|
5
|
-
/**
|
|
6
|
-
* Sets up the visual testing suite by cleaning up previous snapshot and diff output directories.
|
|
7
|
-
* When this command is run for the first time,
|
|
8
|
-
* it will remove the results and diffs directory of all suites.
|
|
9
|
-
*
|
|
10
|
-
* In subsequent runs, it will only remove the results and diffs directory of the current suite.
|
|
11
|
-
*/
|
|
12
|
-
setupVisSuite: () => Promise<Pick<VisOptions, 'comparisonMethod' | 'diffOptions' | 'failureThreshold' | 'failureThresholdType' | 'snapshotKey' | 'subject' | 'timeout'>>;
|
|
13
|
-
}
|
|
14
|
-
export declare const setupVisSuite: BrowserCommand<[]>;
|
|
15
|
-
//# sourceMappingURL=setup_vis_suite.d.ts.map
|