File tree Expand file tree Collapse file tree
browser/src/node/commands/screenshotMatcher Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ receives an object with the following properties:
118118 The value provided to [ ` attachmentsDir ` ] ( /config/attachmentsdir ) , if none is
119119 provided, its default value.
120120
121+ - ` project: TestProject ` <Version type =" experimental " >4.1.6</Version > <Experimental />
122+
123+ The [ ` TestProject ` ] ( /api/advanced/test-project ) the test belongs to.
124+
121125For example, to group screenshots by browser:
122126
123127``` ts
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ export function resolveOptions(
143143 testFileName : basename ( context . testPath ) ,
144144 testName : sanitize ( testName , false ) ,
145145 browserName : context . project . config . browser . name ,
146+ project : context . project ,
146147 } satisfies Parameters < GlobalOptions [ 'resolveDiffPath' ] > [ 0 ]
147148
148149 return {
Original file line number Diff line number Diff line change @@ -524,6 +524,12 @@ type ToMatchScreenshotResolvePath = (data: {
524524 * if none is provided, its default value.
525525 */
526526 attachmentsDir : string
527+ /**
528+ * The {@linkcode https://vitest.dev/api/advanced/test-project|TestProject} the test belongs to.
529+ *
530+ * @experimental
531+ */
532+ project : TestProject
527533} ) => string
528534
529535export interface ToMatchScreenshotOptions {
You can’t perform that action at this time.
0 commit comments