@shopware-ag/acceptance-test-suite 11.15.4 → 11.16.0
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 +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.mjs +85 -2
- 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
|
|
|
@@ -2682,6 +2711,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2682
2711
|
BulkEditCustomers: Task;
|
|
2683
2712
|
} & {
|
|
2684
2713
|
AssignEntitiesToRule: Task;
|
|
2714
|
+
} & {
|
|
2715
|
+
LoginViaReviewsTab: Task;
|
|
2685
2716
|
} & {
|
|
2686
2717
|
Login: Task;
|
|
2687
2718
|
} & {
|
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
|
|
|
@@ -2682,6 +2711,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2682
2711
|
BulkEditCustomers: Task;
|
|
2683
2712
|
} & {
|
|
2684
2713
|
AssignEntitiesToRule: Task;
|
|
2714
|
+
} & {
|
|
2715
|
+
LoginViaReviewsTab: Task;
|
|
2685
2716
|
} & {
|
|
2686
2717
|
Login: Task;
|
|
2687
2718
|
} & {
|
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 = "";
|
|
@@ -7445,13 +7509,32 @@ const AssignEntitiesToRule = test$f.extend({
|
|
|
7445
7509
|
}
|
|
7446
7510
|
});
|
|
7447
7511
|
|
|
7512
|
+
const LoginViaReviewsTab = test$f.extend({
|
|
7513
|
+
LoginViaReviewsTab: async ({ ShopCustomer, DefaultSalesChannel, StorefrontProductDetail }, use) => {
|
|
7514
|
+
const task = (product, customCustomer) => {
|
|
7515
|
+
return async function LoginViaReviewsTab2() {
|
|
7516
|
+
const customer = customCustomer ? customCustomer : DefaultSalesChannel.customer;
|
|
7517
|
+
await ShopCustomer.goesTo(StorefrontProductDetail.url(product));
|
|
7518
|
+
await StorefrontProductDetail.reviewsTab.click();
|
|
7519
|
+
await StorefrontProductDetail.reviewTeaserButton.click();
|
|
7520
|
+
await StorefrontProductDetail.reviewEmailInput.fill(customer.email);
|
|
7521
|
+
await StorefrontProductDetail.reviewPasswordInput.fill(customer.password);
|
|
7522
|
+
await StorefrontProductDetail.reviewLoginButton.click();
|
|
7523
|
+
await ShopCustomer.expects(StorefrontProductDetail.productName).toHaveText(product.name);
|
|
7524
|
+
};
|
|
7525
|
+
};
|
|
7526
|
+
await use(task);
|
|
7527
|
+
}
|
|
7528
|
+
});
|
|
7529
|
+
|
|
7448
7530
|
const test$4 = mergeTests(
|
|
7449
7531
|
SaveProduct,
|
|
7450
7532
|
ExpectNotification,
|
|
7451
7533
|
CreateLinkTypeCategory,
|
|
7452
7534
|
BulkEditProducts,
|
|
7453
7535
|
BulkEditCustomers,
|
|
7454
|
-
AssignEntitiesToRule
|
|
7536
|
+
AssignEntitiesToRule,
|
|
7537
|
+
LoginViaReviewsTab
|
|
7455
7538
|
);
|
|
7456
7539
|
|
|
7457
7540
|
const Login = test$f.extend({
|