@shopware-ag/acceptance-test-suite 11.16.3 → 11.17.1
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +42 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1161,6 +1161,8 @@ interface HelperFixtureTypes {
|
|
|
1161
1161
|
isSaaS: boolean;
|
|
1162
1162
|
features: FeaturesType;
|
|
1163
1163
|
};
|
|
1164
|
+
HideElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
|
|
1165
|
+
ReplaceElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
|
|
1164
1166
|
}
|
|
1165
1167
|
|
|
1166
1168
|
interface StoreBaseConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -1161,6 +1161,8 @@ interface HelperFixtureTypes {
|
|
|
1161
1161
|
isSaaS: boolean;
|
|
1162
1162
|
features: FeaturesType;
|
|
1163
1163
|
};
|
|
1164
|
+
HideElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
|
|
1165
|
+
ReplaceElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
|
|
1164
1166
|
}
|
|
1165
1167
|
|
|
1166
1168
|
interface StoreBaseConfig {
|
package/dist/index.mjs
CHANGED
|
@@ -3343,6 +3343,48 @@ const test$8 = test$f.extend({
|
|
|
3343
3343
|
});
|
|
3344
3344
|
},
|
|
3345
3345
|
{ scope: "worker" }
|
|
3346
|
+
],
|
|
3347
|
+
/**
|
|
3348
|
+
* Hides the given page elements using `visibility: hidden`, so they become invisible
|
|
3349
|
+
* without affecting the layout (no realignment occurs).
|
|
3350
|
+
*
|
|
3351
|
+
* @param selectors - A list of CSS selectors for the elements to hide.
|
|
3352
|
+
*/
|
|
3353
|
+
HideElementsForScreenshot: [
|
|
3354
|
+
async ({}, use) => {
|
|
3355
|
+
const fn = async (page, selectors) => {
|
|
3356
|
+
if (!selectors.length)
|
|
3357
|
+
return;
|
|
3358
|
+
const css = selectors.map((selector) => `${selector} { visibility: hidden !important; }`).join("\n");
|
|
3359
|
+
await page.addStyleTag({ content: css });
|
|
3360
|
+
};
|
|
3361
|
+
await use(fn);
|
|
3362
|
+
},
|
|
3363
|
+
{ scope: "worker" }
|
|
3364
|
+
],
|
|
3365
|
+
/**
|
|
3366
|
+
* Replaces the visible text content of the selected elements with "***",
|
|
3367
|
+
* typically used to mask sensitive information (e.g. names, prices).
|
|
3368
|
+
*
|
|
3369
|
+
* @param selectors - A list of CSS selectors for the elements whose content should be replaced.
|
|
3370
|
+
*/
|
|
3371
|
+
ReplaceElementsForScreenshot: [
|
|
3372
|
+
async ({}, use) => {
|
|
3373
|
+
const fn = async (page, selectors) => {
|
|
3374
|
+
if (!selectors.length)
|
|
3375
|
+
return;
|
|
3376
|
+
await page.evaluate((selectors2) => {
|
|
3377
|
+
selectors2.forEach((selector) => {
|
|
3378
|
+
const elements = document.querySelectorAll(selector);
|
|
3379
|
+
elements.forEach((el) => {
|
|
3380
|
+
el.textContent = "***";
|
|
3381
|
+
});
|
|
3382
|
+
});
|
|
3383
|
+
}, selectors);
|
|
3384
|
+
};
|
|
3385
|
+
await use(fn);
|
|
3386
|
+
},
|
|
3387
|
+
{ scope: "worker" }
|
|
3346
3388
|
]
|
|
3347
3389
|
});
|
|
3348
3390
|
|