@shopware-ag/acceptance-test-suite 11.9.1 → 11.9.3

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/README.md CHANGED
@@ -469,18 +469,30 @@ The most important part is [test isolation](https://playwright.dev/docs/best-pra
469
469
  ## Running Tests in the Test Suite
470
470
  If you want to work on the test suite and try to execute tests from within this repository, you have to run a corresponding docker image for a specific Shopware version.
471
471
 
472
- Shopware 6.6
473
- ```
474
- docker compose up -d shopware
475
- ```
472
+ We publish pre-built images at the [GitHub container registry](https://github.com/orgs/shopware/packages/container/package/acceptance-test-suite%2Ftest-image). The images are built on a daily basis, check to see which versions are available.
476
473
 
477
- Shopware 6.5
474
+ In order to select an image, export the corresponding tag as `SHOPWARE_VERSION` and start the containers:
475
+
476
+ ```bash
477
+ SHOPWARE_VERSION=trunk docker compose up --wait shopware
478
478
  ```
479
- docker compose up -d shopware-65
479
+
480
+ <details>
481
+ <summary>ℹ️ What if the version I'd like to test is not available as a pre-built image?</summary>
482
+
483
+ If you want to test with an image that's not available already, you can build it yourself by exporting a few more variables:
484
+
485
+ ```bash
486
+ export PHP_VERSION="8.3" # PHP version of the base image
487
+ export SHOPWARE_VERSION="v6.5.8.0" # Shopware version to check out. This may bei either a branch or a tag, depending on the value of SHOPWARE_BUILD_SOURCE
488
+ export SHOPWARE_BUILD_SOURCE="tag" # Either "branch" or "tag"
489
+
490
+ docker compose up --attach-dependencies shopware # This will build the image if it's not available
480
491
  ```
492
+ </details>
481
493
 
482
- When the docker container is running you can execute the normal playwright commands.
494
+ Afterwards you can execute the normal playwright commands:
483
495
 
496
+ ```bash
497
+ npx playwright test --ui
484
498
  ```
485
- npx playwright test
486
- ```
package/dist/index.d.mts CHANGED
@@ -1941,13 +1941,14 @@ declare class FlowBuilderDetail implements PageObject {
1941
1941
 
1942
1942
  declare class DataSharing implements PageObject {
1943
1943
  readonly page: Page;
1944
+ readonly instanceMeta: HelperFixtureTypes['InstanceMeta'];
1944
1945
  readonly dataConsentHeadline: Locator;
1945
1946
  readonly dataSharingSuccessMessageLabel: Locator;
1946
1947
  readonly dataSharingAgreeButton: Locator;
1947
1948
  readonly dataSharingDisableButton: Locator;
1948
1949
  readonly dataSharingTermsAgreementLabel: Locator;
1949
- constructor(page: Page);
1950
- url(): string;
1950
+ constructor(page: Page, instanceMeta: HelperFixtureTypes['InstanceMeta']);
1951
+ url(): "#/sw/settings/usage/data/index" | "#/sw/settings/usage/data/index/general";
1951
1952
  }
1952
1953
 
1953
1954
  declare class Dashboard implements PageObject {
package/dist/index.d.ts CHANGED
@@ -1941,13 +1941,14 @@ declare class FlowBuilderDetail implements PageObject {
1941
1941
 
1942
1942
  declare class DataSharing implements PageObject {
1943
1943
  readonly page: Page;
1944
+ readonly instanceMeta: HelperFixtureTypes['InstanceMeta'];
1944
1945
  readonly dataConsentHeadline: Locator;
1945
1946
  readonly dataSharingSuccessMessageLabel: Locator;
1946
1947
  readonly dataSharingAgreeButton: Locator;
1947
1948
  readonly dataSharingDisableButton: Locator;
1948
1949
  readonly dataSharingTermsAgreementLabel: Locator;
1949
- constructor(page: Page);
1950
- url(): string;
1950
+ constructor(page: Page, instanceMeta: HelperFixtureTypes['InstanceMeta']);
1951
+ url(): "#/sw/settings/usage/data/index" | "#/sw/settings/usage/data/index/general";
1951
1952
  }
1952
1953
 
1953
1954
  declare class Dashboard implements PageObject {
package/dist/index.mjs CHANGED
@@ -556,7 +556,7 @@ const isSaaSInstance = async (adminApiContext) => {
556
556
  const isThemeCompiled = async (context, storefrontUrl) => {
557
557
  const response = await context.get(storefrontUrl);
558
558
  const body = (await response.body()).toString();
559
- const matches = body.match(/.*"(https:\/\/.*all\.css[^"]*)".*/);
559
+ const matches = body.match(/.*"(https?:\/\/.*all\.css[^"]*)".*/);
560
560
  if (matches && matches?.length > 1) {
561
561
  const allCssUrl = matches[1];
562
562
  const allCssResponse = await context.get(allCssUrl);
@@ -602,7 +602,7 @@ const test$b = test$f.extend({
602
602
  });
603
603
  await expect(page.url()).toContain("login");
604
604
  await page.getByLabel(/Username|Email address/).fill(adminUser.username);
605
- await page.getByLabel("Password").fill(adminUser.password);
605
+ await page.getByLabel("Password", { exact: true }).fill(adminUser.password);
606
606
  const config = await (await AdminApiContext.get("./_info/config")).json();
607
607
  const jsLoadingPromises = [];
608
608
  for (const i in config.bundles) {
@@ -639,16 +639,13 @@ const test$b = test$f.extend({
639
639
  baseURL: url
640
640
  });
641
641
  const page = await context.newPage();
642
- const isSaasInstance = await isSaaSInstance(AdminApiContext);
643
642
  if (!await isThemeCompiled(AdminApiContext, DefaultSalesChannel.url)) {
644
643
  test$f.slow();
645
644
  await AdminApiContext.post(
646
645
  `./_action/theme/${SalesChannelBaseConfig.defaultThemeId}/assign/${salesChannel.id}`
647
646
  );
648
- if (isSaasInstance) {
649
- while (!await isThemeCompiled(AdminApiContext, DefaultSalesChannel.url)) {
650
- await page.waitForTimeout(4e3);
651
- }
647
+ while (!await isThemeCompiled(AdminApiContext, DefaultSalesChannel.url)) {
648
+ await page.waitForTimeout(4e3);
652
649
  }
653
650
  }
654
651
  await page.goto("./", { waitUntil: "load" });
@@ -3223,7 +3220,7 @@ const test$8 = test$f.extend({
3223
3220
  expect(response.ok(), "/_info/config request failed").toBeTruthy();
3224
3221
  const config = await response.json();
3225
3222
  const features = {};
3226
- if (satisfies(config.version, ">=6.6.0.0")) {
3223
+ if (satisfies(config.version, ">=6.6.1.0")) {
3227
3224
  const featuresResponse = await context.get("./_action/feature-flag");
3228
3225
  expect(featuresResponse.ok(), "/_action/feature-flag request failed").toBeTruthy();
3229
3226
  const data = await featuresResponse.json();
@@ -4973,7 +4970,7 @@ class FirstRunWizard {
4973
4970
  this.smtpServerHostInput = page.getByLabel("Host");
4974
4971
  this.smtpServerPortInput = page.getByLabel("Port");
4975
4972
  this.smtpServerUsernameInput = page.getByLabel("Username");
4976
- this.smtpServerPasswordInput = page.getByLabel("Password");
4973
+ this.smtpServerPasswordInput = page.getByLabel("Password", { exact: true });
4977
4974
  this.smtpServerEncryptionInput = page.locator(".sw-single-select__selection-input");
4978
4975
  this.smtpServerSenderAddressInput = page.getByLabel("Sender address");
4979
4976
  this.smtpServerDeliveryAddressInput = page.getByLabel("Delivery address");
@@ -5113,20 +5110,28 @@ var __publicField$l = (obj, key, value) => {
5113
5110
  return value;
5114
5111
  };
5115
5112
  class DataSharing {
5116
- constructor(page) {
5113
+ constructor(page, instanceMeta) {
5117
5114
  this.page = page;
5115
+ this.instanceMeta = instanceMeta;
5118
5116
  __publicField$l(this, "dataConsentHeadline");
5119
5117
  __publicField$l(this, "dataSharingSuccessMessageLabel");
5120
5118
  __publicField$l(this, "dataSharingAgreeButton");
5121
5119
  __publicField$l(this, "dataSharingDisableButton");
5122
5120
  __publicField$l(this, "dataSharingTermsAgreementLabel");
5123
- this.dataConsentHeadline = page.locator("h3.sw-usage-data-consent-banner__content-headline");
5121
+ if (satisfies(instanceMeta.version, "<6.6.1")) {
5122
+ this.dataConsentHeadline = page.locator("header.sw-usage-data-consent-banner__title");
5123
+ } else {
5124
+ this.dataConsentHeadline = page.locator("h3.sw-usage-data-consent-banner__content-headline");
5125
+ }
5124
5126
  this.dataSharingAgreeButton = page.getByRole("button", { name: "Agree" });
5125
5127
  this.dataSharingDisableButton = page.getByRole("button", { name: "Disable data sharing" });
5126
5128
  this.dataSharingSuccessMessageLabel = page.getByText("You are sharing data with us", { exact: true });
5127
5129
  this.dataSharingTermsAgreementLabel = page.getByText('By clicking "Agree", you confirm that you are authorized to enter into this agreement on behalf of your company.');
5128
5130
  }
5129
5131
  url() {
5132
+ if (satisfies(this.instanceMeta.version, "<6.6.1")) {
5133
+ return "#/sw/settings/usage/data/index";
5134
+ }
5130
5135
  return "#/sw/settings/usage/data/index/general";
5131
5136
  }
5132
5137
  }
@@ -6161,8 +6166,8 @@ const test$6 = test$f.extend({
6161
6166
  AdminFlowBuilderDetail: async ({ AdminPage }, use) => {
6162
6167
  await use(new FlowBuilderDetail(AdminPage));
6163
6168
  },
6164
- AdminDataSharing: async ({ AdminPage }, use) => {
6165
- await use(new DataSharing(AdminPage));
6169
+ AdminDataSharing: async ({ AdminPage, InstanceMeta }, use) => {
6170
+ await use(new DataSharing(AdminPage, InstanceMeta));
6166
6171
  },
6167
6172
  AdminDashboard: async ({ AdminPage }, use) => {
6168
6173
  await use(new Dashboard(AdminPage));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.9.1",
3
+ "version": "11.9.3",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",