@shopware-ag/acceptance-test-suite 11.17.0 → 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 CHANGED
@@ -1162,6 +1162,7 @@ interface HelperFixtureTypes {
1162
1162
  features: FeaturesType;
1163
1163
  };
1164
1164
  HideElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
1165
+ ReplaceElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
1165
1166
  }
1166
1167
 
1167
1168
  interface StoreBaseConfig {
package/dist/index.d.ts CHANGED
@@ -1162,6 +1162,7 @@ interface HelperFixtureTypes {
1162
1162
  features: FeaturesType;
1163
1163
  };
1164
1164
  HideElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
1165
+ ReplaceElementsForScreenshot: (page: Page, selectors: string[]) => Promise<void>;
1165
1166
  }
1166
1167
 
1167
1168
  interface StoreBaseConfig {
package/dist/index.mjs CHANGED
@@ -3344,17 +3344,47 @@ const test$8 = test$f.extend({
3344
3344
  },
3345
3345
  { scope: "worker" }
3346
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
+ */
3347
3353
  HideElementsForScreenshot: [
3348
3354
  async ({}, use) => {
3349
3355
  const fn = async (page, selectors) => {
3350
3356
  if (!selectors.length)
3351
3357
  return;
3352
- const css = selectors.map((selector) => `${selector} { display: none !important; }`).join("\n");
3358
+ const css = selectors.map((selector) => `${selector} { visibility: hidden !important; }`).join("\n");
3353
3359
  await page.addStyleTag({ content: css });
3354
3360
  };
3355
3361
  await use(fn);
3356
3362
  },
3357
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" }
3358
3388
  ]
3359
3389
  });
3360
3390
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.17.0",
3
+ "version": "11.17.1",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",