@shopware-ag/acceptance-test-suite 11.15.4 → 11.16.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/README.md +11 -5
- package/dist/index.d.mts +36 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.mjs +97 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -808,6 +808,10 @@ You can create a new TypeScript class that **extends** the base `TestDataService
|
|
|
808
808
|
import { TestDataService } from '@shopware-ag/acceptance-test-suite';
|
|
809
809
|
|
|
810
810
|
export class CustomTestDataService extends TestDataService {
|
|
811
|
+
|
|
812
|
+
constructor(AdminApiContext, DefaultSalesChannel) {
|
|
813
|
+
super(...);
|
|
814
|
+
}
|
|
811
815
|
|
|
812
816
|
async createCustomCustomerGroup(data: Partial<CustomerGroup>) {
|
|
813
817
|
const response = await this.adminApi.post('customer-group?_response=true', {
|
|
@@ -832,14 +836,16 @@ Example from `AcceptanceTest.ts`:
|
|
|
832
836
|
|
|
833
837
|
```typescript
|
|
834
838
|
import { test as base } from '@shopware-ag/acceptance-test-suite';
|
|
835
|
-
import type { FixtureTypes } from '
|
|
836
|
-
import { CustomTestDataService } from './
|
|
839
|
+
import type { FixtureTypes } from './BaseTestFile';
|
|
840
|
+
import { CustomTestDataService } from './CustomTestDataService';
|
|
837
841
|
|
|
838
|
-
export
|
|
842
|
+
export interface CustomTestDataServiceType {
|
|
843
|
+
TestDataService: CustomTestDataService;
|
|
844
|
+
}
|
|
839
845
|
|
|
840
|
-
export const test = base.extend<FixtureTypes &
|
|
846
|
+
export const test = base.extend<FixtureTypes & CustomTestDataServiceType>({
|
|
841
847
|
TestDataService: async ({ AdminApiContext, DefaultSalesChannel }, use) => {
|
|
842
|
-
const service = new CustomTestDataService(AdminApiContext, DefaultSalesChannel);
|
|
848
|
+
const service = new CustomTestDataService(AdminApiContext, DefaultSalesChannel.salesChannel);
|
|
843
849
|
await use(service);
|
|
844
850
|
await service.cleanUp();
|
|
845
851
|
},
|
package/dist/index.d.mts
CHANGED
|
@@ -1335,7 +1335,36 @@ declare class ProductDetail$1 implements PageObject {
|
|
|
1335
1335
|
readonly productDetailConfigurator: Locator;
|
|
1336
1336
|
readonly productDetailConfiguratorGroupTitle: Locator;
|
|
1337
1337
|
readonly productDetailConfiguratorOptionInputs: Locator;
|
|
1338
|
+
readonly productName: Locator;
|
|
1339
|
+
readonly reviewsTab: Locator;
|
|
1340
|
+
readonly reviewTeaserButton: Locator;
|
|
1341
|
+
readonly reviewTeaserText: Locator;
|
|
1342
|
+
readonly reviewListingItems: Locator;
|
|
1343
|
+
readonly reviewEmptyListingText: Locator;
|
|
1344
|
+
readonly reviewLoginForm: Locator;
|
|
1345
|
+
readonly forgottenPasswordLink: Locator;
|
|
1346
|
+
readonly reviewForm: Locator;
|
|
1347
|
+
readonly reviewRatingPoints: Locator;
|
|
1348
|
+
readonly reviewRatingText: Locator;
|
|
1349
|
+
readonly reviewSubmitMessage: Locator;
|
|
1350
|
+
readonly reviewCounter: Locator;
|
|
1351
|
+
readonly reviewItemRatingPoints: Locator;
|
|
1352
|
+
readonly reviewItemTitle: Locator;
|
|
1353
|
+
readonly reviewReviewTextInput: Locator;
|
|
1354
|
+
readonly reviewItemContent: Locator;
|
|
1355
|
+
readonly reviewLoginButton: Locator;
|
|
1356
|
+
readonly reviewEmailInput: Locator;
|
|
1357
|
+
readonly reviewPasswordInput: Locator;
|
|
1358
|
+
readonly reviewTitleInput: Locator;
|
|
1359
|
+
readonly reviewSubmitButton: Locator;
|
|
1360
|
+
readonly productReviewsLink: Locator;
|
|
1361
|
+
readonly productReviewRating: Locator;
|
|
1338
1362
|
constructor(page: Page);
|
|
1363
|
+
getReviewFilterRowOptionsByName(filterOptionName: string): Promise<{
|
|
1364
|
+
reviewFilterOptionCheckbox: Locator;
|
|
1365
|
+
reviewFilterOptionText: Locator;
|
|
1366
|
+
reviewFilterOptionPercentage: Locator;
|
|
1367
|
+
}>;
|
|
1339
1368
|
url(productData: Product): string;
|
|
1340
1369
|
}
|
|
1341
1370
|
|
|
@@ -1834,6 +1863,11 @@ declare class ProductDetail implements PageObject {
|
|
|
1834
1863
|
*/
|
|
1835
1864
|
readonly variantsTabLink: Locator;
|
|
1836
1865
|
readonly specificationsTabLink: Locator;
|
|
1866
|
+
readonly advancedPricingTabLink: Locator;
|
|
1867
|
+
readonly layoutTabLink: Locator;
|
|
1868
|
+
readonly crossSellingTabLink: Locator;
|
|
1869
|
+
readonly SEOTabLink: Locator;
|
|
1870
|
+
readonly reviewsTabLink: Locator;
|
|
1837
1871
|
/**
|
|
1838
1872
|
* Variants Generation
|
|
1839
1873
|
*/
|
|
@@ -2682,6 +2716,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2682
2716
|
BulkEditCustomers: Task;
|
|
2683
2717
|
} & {
|
|
2684
2718
|
AssignEntitiesToRule: Task;
|
|
2719
|
+
} & {
|
|
2720
|
+
LoginViaReviewsTab: Task;
|
|
2685
2721
|
} & {
|
|
2686
2722
|
Login: Task;
|
|
2687
2723
|
} & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1335,7 +1335,36 @@ declare class ProductDetail$1 implements PageObject {
|
|
|
1335
1335
|
readonly productDetailConfigurator: Locator;
|
|
1336
1336
|
readonly productDetailConfiguratorGroupTitle: Locator;
|
|
1337
1337
|
readonly productDetailConfiguratorOptionInputs: Locator;
|
|
1338
|
+
readonly productName: Locator;
|
|
1339
|
+
readonly reviewsTab: Locator;
|
|
1340
|
+
readonly reviewTeaserButton: Locator;
|
|
1341
|
+
readonly reviewTeaserText: Locator;
|
|
1342
|
+
readonly reviewListingItems: Locator;
|
|
1343
|
+
readonly reviewEmptyListingText: Locator;
|
|
1344
|
+
readonly reviewLoginForm: Locator;
|
|
1345
|
+
readonly forgottenPasswordLink: Locator;
|
|
1346
|
+
readonly reviewForm: Locator;
|
|
1347
|
+
readonly reviewRatingPoints: Locator;
|
|
1348
|
+
readonly reviewRatingText: Locator;
|
|
1349
|
+
readonly reviewSubmitMessage: Locator;
|
|
1350
|
+
readonly reviewCounter: Locator;
|
|
1351
|
+
readonly reviewItemRatingPoints: Locator;
|
|
1352
|
+
readonly reviewItemTitle: Locator;
|
|
1353
|
+
readonly reviewReviewTextInput: Locator;
|
|
1354
|
+
readonly reviewItemContent: Locator;
|
|
1355
|
+
readonly reviewLoginButton: Locator;
|
|
1356
|
+
readonly reviewEmailInput: Locator;
|
|
1357
|
+
readonly reviewPasswordInput: Locator;
|
|
1358
|
+
readonly reviewTitleInput: Locator;
|
|
1359
|
+
readonly reviewSubmitButton: Locator;
|
|
1360
|
+
readonly productReviewsLink: Locator;
|
|
1361
|
+
readonly productReviewRating: Locator;
|
|
1338
1362
|
constructor(page: Page);
|
|
1363
|
+
getReviewFilterRowOptionsByName(filterOptionName: string): Promise<{
|
|
1364
|
+
reviewFilterOptionCheckbox: Locator;
|
|
1365
|
+
reviewFilterOptionText: Locator;
|
|
1366
|
+
reviewFilterOptionPercentage: Locator;
|
|
1367
|
+
}>;
|
|
1339
1368
|
url(productData: Product): string;
|
|
1340
1369
|
}
|
|
1341
1370
|
|
|
@@ -1834,6 +1863,11 @@ declare class ProductDetail implements PageObject {
|
|
|
1834
1863
|
*/
|
|
1835
1864
|
readonly variantsTabLink: Locator;
|
|
1836
1865
|
readonly specificationsTabLink: Locator;
|
|
1866
|
+
readonly advancedPricingTabLink: Locator;
|
|
1867
|
+
readonly layoutTabLink: Locator;
|
|
1868
|
+
readonly crossSellingTabLink: Locator;
|
|
1869
|
+
readonly SEOTabLink: Locator;
|
|
1870
|
+
readonly reviewsTabLink: Locator;
|
|
1837
1871
|
/**
|
|
1838
1872
|
* Variants Generation
|
|
1839
1873
|
*/
|
|
@@ -2682,6 +2716,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2682
2716
|
BulkEditCustomers: Task;
|
|
2683
2717
|
} & {
|
|
2684
2718
|
AssignEntitiesToRule: Task;
|
|
2719
|
+
} & {
|
|
2720
|
+
LoginViaReviewsTab: Task;
|
|
2685
2721
|
} & {
|
|
2686
2722
|
Login: Task;
|
|
2687
2723
|
} & {
|
package/dist/index.mjs
CHANGED
|
@@ -3233,6 +3233,8 @@ class TestDataService {
|
|
|
3233
3233
|
}
|
|
3234
3234
|
}
|
|
3235
3235
|
|
|
3236
|
+
const ATS_SKIP_CLEANUP = ["1", "true"].includes(process.env["ATS_SKIP_CLEANUP"] || "");
|
|
3237
|
+
const ATS_EXEC_CLEANUP = !ATS_SKIP_CLEANUP;
|
|
3236
3238
|
const test$9 = test$f.extend({
|
|
3237
3239
|
TestDataService: async ({ AdminApiContext, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
|
|
3238
3240
|
const DataService = new TestDataService(AdminApiContext, IdProvider, {
|
|
@@ -3245,7 +3247,9 @@ const test$9 = test$f.extend({
|
|
|
3245
3247
|
defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId
|
|
3246
3248
|
});
|
|
3247
3249
|
await use(DataService);
|
|
3248
|
-
|
|
3250
|
+
if (ATS_EXEC_CLEANUP) {
|
|
3251
|
+
await DataService.cleanUp();
|
|
3252
|
+
}
|
|
3249
3253
|
}
|
|
3250
3254
|
});
|
|
3251
3255
|
|
|
@@ -3595,6 +3599,31 @@ let ProductDetail$1 = class ProductDetail {
|
|
|
3595
3599
|
__publicField$T(this, "productDetailConfigurator");
|
|
3596
3600
|
__publicField$T(this, "productDetailConfiguratorGroupTitle");
|
|
3597
3601
|
__publicField$T(this, "productDetailConfiguratorOptionInputs");
|
|
3602
|
+
__publicField$T(this, "productName");
|
|
3603
|
+
//Reviews Tab
|
|
3604
|
+
__publicField$T(this, "reviewsTab");
|
|
3605
|
+
__publicField$T(this, "reviewTeaserButton");
|
|
3606
|
+
__publicField$T(this, "reviewTeaserText");
|
|
3607
|
+
__publicField$T(this, "reviewListingItems");
|
|
3608
|
+
__publicField$T(this, "reviewEmptyListingText");
|
|
3609
|
+
__publicField$T(this, "reviewLoginForm");
|
|
3610
|
+
__publicField$T(this, "forgottenPasswordLink");
|
|
3611
|
+
__publicField$T(this, "reviewForm");
|
|
3612
|
+
__publicField$T(this, "reviewRatingPoints");
|
|
3613
|
+
__publicField$T(this, "reviewRatingText");
|
|
3614
|
+
__publicField$T(this, "reviewSubmitMessage");
|
|
3615
|
+
__publicField$T(this, "reviewCounter");
|
|
3616
|
+
__publicField$T(this, "reviewItemRatingPoints");
|
|
3617
|
+
__publicField$T(this, "reviewItemTitle");
|
|
3618
|
+
__publicField$T(this, "reviewReviewTextInput");
|
|
3619
|
+
__publicField$T(this, "reviewItemContent");
|
|
3620
|
+
__publicField$T(this, "reviewLoginButton");
|
|
3621
|
+
__publicField$T(this, "reviewEmailInput");
|
|
3622
|
+
__publicField$T(this, "reviewPasswordInput");
|
|
3623
|
+
__publicField$T(this, "reviewTitleInput");
|
|
3624
|
+
__publicField$T(this, "reviewSubmitButton");
|
|
3625
|
+
__publicField$T(this, "productReviewsLink");
|
|
3626
|
+
__publicField$T(this, "productReviewRating");
|
|
3598
3627
|
this.addToCartButton = page.getByRole("button", { name: "Add to shopping cart" });
|
|
3599
3628
|
this.quantitySelect = page.getByLabel("Quantity", { exact: true });
|
|
3600
3629
|
this.productSingleImage = page.locator(".gallery-slider-single-image");
|
|
@@ -3614,6 +3643,41 @@ let ProductDetail$1 = class ProductDetail {
|
|
|
3614
3643
|
this.productDetailConfigurator = page.locator(".product-detail-configurator");
|
|
3615
3644
|
this.productDetailConfiguratorGroupTitle = page.locator(".product-detail-configurator-group-title");
|
|
3616
3645
|
this.productDetailConfiguratorOptionInputs = page.locator(".product-detail-configurator-option-input");
|
|
3646
|
+
this.productName = page.locator(".product-detail-name");
|
|
3647
|
+
this.productReviewRating = page.locator(".product-detail-reviews .product-review-rating");
|
|
3648
|
+
this.productReviewsLink = page.locator(".product-detail-reviews .product-detail-reviews-link");
|
|
3649
|
+
this.reviewsTab = this.page.getByRole("tab", { name: "Reviews" });
|
|
3650
|
+
this.reviewTeaserButton = this.page.locator(".product-detail-review-teaser-btn");
|
|
3651
|
+
this.reviewTeaserText = this.page.locator(".product-detail-review-teaser .h4");
|
|
3652
|
+
this.reviewListingItems = this.page.locator(".product-detail-review-item");
|
|
3653
|
+
this.reviewEmptyListingText = this.page.getByText("No reviews found. Share your insights with others.");
|
|
3654
|
+
this.reviewLoginForm = this.page.locator(".product-detail-review-login");
|
|
3655
|
+
this.forgottenPasswordLink = this.page.getByRole("link", { name: "I have forgotten my password." });
|
|
3656
|
+
this.reviewLoginButton = this.page.getByRole("button", { name: "Log in" });
|
|
3657
|
+
this.reviewEmailInput = this.page.getByLabel("Your email address");
|
|
3658
|
+
this.reviewPasswordInput = this.page.getByLabel("Your password");
|
|
3659
|
+
this.reviewForm = this.page.locator(".product-detail-review-form");
|
|
3660
|
+
this.reviewTitleInput = this.page.getByLabel("Title");
|
|
3661
|
+
this.reviewReviewTextInput = this.page.getByLabel("Your review");
|
|
3662
|
+
this.reviewSubmitButton = this.page.locator(".btn-review-submit");
|
|
3663
|
+
this.reviewRatingPoints = this.page.locator(".product-detail-review-form-star");
|
|
3664
|
+
this.reviewRatingText = this.page.locator(".product-detail-review-form-rating-text");
|
|
3665
|
+
this.reviewCounter = this.page.locator(".product-detail-review-counter");
|
|
3666
|
+
this.reviewItemRatingPoints = this.page.locator(".product-detail-review-item-points .point-full");
|
|
3667
|
+
this.reviewItemTitle = this.page.locator(".product-detail-review-item-title");
|
|
3668
|
+
this.reviewItemContent = this.page.locator(".product-detail-review-item-content");
|
|
3669
|
+
this.reviewSubmitMessage = this.page.getByText("Thank you for submitting your review. We will examine the review and eventually unlock it, please be patient.");
|
|
3670
|
+
}
|
|
3671
|
+
async getReviewFilterRowOptionsByName(filterOptionName) {
|
|
3672
|
+
const rowLocators = this.page.locator(".product-detail-review-filter").filter({ hasText: filterOptionName });
|
|
3673
|
+
const reviewFilterOptionCheckbox = rowLocators.getByLabel(filterOptionName);
|
|
3674
|
+
const reviewFilterOptionText = rowLocators.locator(".custom-control-label");
|
|
3675
|
+
const reviewFilterOptionPercentage = rowLocators.locator(".product-detail-review-share");
|
|
3676
|
+
return {
|
|
3677
|
+
reviewFilterOptionCheckbox,
|
|
3678
|
+
reviewFilterOptionText,
|
|
3679
|
+
reviewFilterOptionPercentage
|
|
3680
|
+
};
|
|
3617
3681
|
}
|
|
3618
3682
|
url(productData) {
|
|
3619
3683
|
let namePath = "";
|
|
@@ -4767,6 +4831,11 @@ class ProductDetail {
|
|
|
4767
4831
|
*/
|
|
4768
4832
|
__publicField$w(this, "variantsTabLink");
|
|
4769
4833
|
__publicField$w(this, "specificationsTabLink");
|
|
4834
|
+
__publicField$w(this, "advancedPricingTabLink");
|
|
4835
|
+
__publicField$w(this, "layoutTabLink");
|
|
4836
|
+
__publicField$w(this, "crossSellingTabLink");
|
|
4837
|
+
__publicField$w(this, "SEOTabLink");
|
|
4838
|
+
__publicField$w(this, "reviewsTabLink");
|
|
4770
4839
|
/**
|
|
4771
4840
|
* Variants Generation
|
|
4772
4841
|
*/
|
|
@@ -4794,6 +4863,13 @@ class ProductDetail {
|
|
|
4794
4863
|
this.savePhysicalProductButton = page.getByRole("button", { name: "Save" });
|
|
4795
4864
|
this.saveButtonCheckMark = page.locator(".icon--regular-checkmark-xs");
|
|
4796
4865
|
this.saveButtonLoadingSpinner = page.locator("sw-loader");
|
|
4866
|
+
this.specificationsTabLink = page.getByRole("tab", { name: "Specifications" });
|
|
4867
|
+
this.advancedPricingTabLink = page.getByRole("tab", { name: "Advanced pricing" });
|
|
4868
|
+
this.variantsTabLink = page.getByRole("tab", { name: "Variants" });
|
|
4869
|
+
this.layoutTabLink = page.getByRole("tab", { name: "Layout" });
|
|
4870
|
+
this.crossSellingTabLink = page.getByRole("tab", { name: "Cross Selling" });
|
|
4871
|
+
this.SEOTabLink = page.getByRole("tab", { name: "SEO" });
|
|
4872
|
+
this.reviewsTabLink = page.getByRole("tab", { name: "Reviews" });
|
|
4797
4873
|
this.manufacturerDropdownText = page.locator(".sw-select-product__select_manufacturer");
|
|
4798
4874
|
this.priceGrossInput = page.locator("#sw-price-field-gross").first();
|
|
4799
4875
|
this.stockInput = page.getByPlaceholder("Enter quantity in stock...");
|
|
@@ -4809,7 +4885,6 @@ class ProductDetail {
|
|
|
4809
4885
|
this.uploadMediaButton = page.getByRole("button", { name: "Upload file" });
|
|
4810
4886
|
this.coverImage = page.locator(".sw-product-media-form__cover-image");
|
|
4811
4887
|
this.productImage = page.locator(".sw-media-preview-v2__item");
|
|
4812
|
-
this.variantsTabLink = page.getByRole("tab", { name: "Variants" });
|
|
4813
4888
|
this.generateVariantsButton = page.getByRole("button", { name: "Generate variants" });
|
|
4814
4889
|
this.variantsModal = page.getByRole("dialog", { name: "Generate variants" });
|
|
4815
4890
|
this.variantsModalHeadline = this.variantsModal.getByRole("heading", { name: "Generate variants" });
|
|
@@ -4824,7 +4899,6 @@ class ProductDetail {
|
|
|
4824
4899
|
this.propertyOptionSizeSmall = this.propertyOptionGrid.getByRole("row", { name: "Small" }).getByRole("checkbox");
|
|
4825
4900
|
this.propertyOptionSizeMedium = this.propertyOptionGrid.getByRole("row", { name: "Medium" }).getByRole("checkbox");
|
|
4826
4901
|
this.propertyOptionSizeLarge = this.propertyOptionGrid.getByRole("row", { name: "Large" }).getByRole("checkbox");
|
|
4827
|
-
this.specificationsTabLink = page.getByRole("tab", { name: "Specifications" });
|
|
4828
4902
|
if (satisfies(instanceMeta.version, "<6.7")) {
|
|
4829
4903
|
this.customFieldCard = page.locator(".sw-card").getByText("Custom fields");
|
|
4830
4904
|
} else {
|
|
@@ -7445,13 +7519,32 @@ const AssignEntitiesToRule = test$f.extend({
|
|
|
7445
7519
|
}
|
|
7446
7520
|
});
|
|
7447
7521
|
|
|
7522
|
+
const LoginViaReviewsTab = test$f.extend({
|
|
7523
|
+
LoginViaReviewsTab: async ({ ShopCustomer, DefaultSalesChannel, StorefrontProductDetail }, use) => {
|
|
7524
|
+
const task = (product, customCustomer) => {
|
|
7525
|
+
return async function LoginViaReviewsTab2() {
|
|
7526
|
+
const customer = customCustomer ? customCustomer : DefaultSalesChannel.customer;
|
|
7527
|
+
await ShopCustomer.goesTo(StorefrontProductDetail.url(product));
|
|
7528
|
+
await StorefrontProductDetail.reviewsTab.click();
|
|
7529
|
+
await StorefrontProductDetail.reviewTeaserButton.click();
|
|
7530
|
+
await StorefrontProductDetail.reviewEmailInput.fill(customer.email);
|
|
7531
|
+
await StorefrontProductDetail.reviewPasswordInput.fill(customer.password);
|
|
7532
|
+
await StorefrontProductDetail.reviewLoginButton.click();
|
|
7533
|
+
await ShopCustomer.expects(StorefrontProductDetail.productName).toHaveText(product.name);
|
|
7534
|
+
};
|
|
7535
|
+
};
|
|
7536
|
+
await use(task);
|
|
7537
|
+
}
|
|
7538
|
+
});
|
|
7539
|
+
|
|
7448
7540
|
const test$4 = mergeTests(
|
|
7449
7541
|
SaveProduct,
|
|
7450
7542
|
ExpectNotification,
|
|
7451
7543
|
CreateLinkTypeCategory,
|
|
7452
7544
|
BulkEditProducts,
|
|
7453
7545
|
BulkEditCustomers,
|
|
7454
|
-
AssignEntitiesToRule
|
|
7546
|
+
AssignEntitiesToRule,
|
|
7547
|
+
LoginViaReviewsTab
|
|
7455
7548
|
);
|
|
7456
7549
|
|
|
7457
7550
|
const Login = test$f.extend({
|