@shopware-ag/acceptance-test-suite 3.8.4 → 3.10.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 +2 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +33 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,8 @@ For more information about how to configure your Playwright project, have a look
|
|
|
73
73
|
## Usage
|
|
74
74
|
The test suite uses the [extension system](https://playwright.dev/docs/extensibility) of Playwright and can be used as a full drop-in for Playwright. But, as you might also want to add your own extensions, the best way to use it is to create your own base test file and use it as the central reference for your test files. Add it to your project root or a specific fixture directory and name it whatever you like.
|
|
75
75
|
|
|
76
|
+
Make sure to set `"type": "module",` in your `package.json`.
|
|
77
|
+
|
|
76
78
|
```TypeScript
|
|
77
79
|
// BaseTestFile.ts
|
|
78
80
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as axe_core from 'axe-core';
|
|
2
2
|
import * as _playwright_test from '@playwright/test';
|
|
3
|
-
import { APIRequestContext, APIResponse, Page, Locator } from '@playwright/test';
|
|
3
|
+
import { APIRequestContext, APIResponse, Page, BrowserContext, Locator } from '@playwright/test';
|
|
4
4
|
export * from '@playwright/test';
|
|
5
5
|
import * as playwright_core from 'playwright-core';
|
|
6
6
|
import { components } from '@shopware/api-client/admin-api-types';
|
|
@@ -135,6 +135,8 @@ interface ApiContextTypes {
|
|
|
135
135
|
interface PageContextTypes {
|
|
136
136
|
AdminPage: Page;
|
|
137
137
|
StorefrontPage: Page;
|
|
138
|
+
page: Page;
|
|
139
|
+
context: BrowserContext;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
declare class Actor {
|
|
@@ -1189,12 +1191,17 @@ declare class FlowBuilderListing implements PageObject {
|
|
|
1189
1191
|
readonly firstFlowContextButton: Locator;
|
|
1190
1192
|
readonly flowContextMenu: Locator;
|
|
1191
1193
|
readonly contextMenuDownload: Locator;
|
|
1194
|
+
readonly contextMenuDuplicate: Locator;
|
|
1195
|
+
readonly contextMenuEdit: Locator;
|
|
1196
|
+
readonly contextMenuDelete: Locator;
|
|
1192
1197
|
readonly flowDownloadModal: Locator;
|
|
1193
1198
|
readonly downloadFlowButton: Locator;
|
|
1199
|
+
readonly flowDeleteButton: Locator;
|
|
1194
1200
|
readonly successAlert: Locator;
|
|
1195
1201
|
readonly successAlertMessage: Locator;
|
|
1196
1202
|
constructor(page: Page);
|
|
1197
1203
|
url(): string;
|
|
1204
|
+
getLineItemByFlowName(flowName: string): Promise<Record<string, Locator>>;
|
|
1198
1205
|
}
|
|
1199
1206
|
|
|
1200
1207
|
declare class FlowBuilderDetail implements PageObject {
|
|
@@ -1308,6 +1315,10 @@ type Currency = components['schemas']['Currency'] & {
|
|
|
1308
1315
|
declare const getCurrency: (isoCode: string, adminApiContext: AdminApiContext) => Promise<Currency>;
|
|
1309
1316
|
declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1310
1317
|
declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Gives the default shipping method back called Standard
|
|
1320
|
+
* @param adminApiContext - An AdminApiContext entity
|
|
1321
|
+
*/
|
|
1311
1322
|
declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1312
1323
|
declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>;
|
|
1313
1324
|
declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as axe_core from 'axe-core';
|
|
2
2
|
import * as _playwright_test from '@playwright/test';
|
|
3
|
-
import { APIRequestContext, APIResponse, Page, Locator } from '@playwright/test';
|
|
3
|
+
import { APIRequestContext, APIResponse, Page, BrowserContext, Locator } from '@playwright/test';
|
|
4
4
|
export * from '@playwright/test';
|
|
5
5
|
import * as playwright_core from 'playwright-core';
|
|
6
6
|
import { components } from '@shopware/api-client/admin-api-types';
|
|
@@ -135,6 +135,8 @@ interface ApiContextTypes {
|
|
|
135
135
|
interface PageContextTypes {
|
|
136
136
|
AdminPage: Page;
|
|
137
137
|
StorefrontPage: Page;
|
|
138
|
+
page: Page;
|
|
139
|
+
context: BrowserContext;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
declare class Actor {
|
|
@@ -1189,12 +1191,17 @@ declare class FlowBuilderListing implements PageObject {
|
|
|
1189
1191
|
readonly firstFlowContextButton: Locator;
|
|
1190
1192
|
readonly flowContextMenu: Locator;
|
|
1191
1193
|
readonly contextMenuDownload: Locator;
|
|
1194
|
+
readonly contextMenuDuplicate: Locator;
|
|
1195
|
+
readonly contextMenuEdit: Locator;
|
|
1196
|
+
readonly contextMenuDelete: Locator;
|
|
1192
1197
|
readonly flowDownloadModal: Locator;
|
|
1193
1198
|
readonly downloadFlowButton: Locator;
|
|
1199
|
+
readonly flowDeleteButton: Locator;
|
|
1194
1200
|
readonly successAlert: Locator;
|
|
1195
1201
|
readonly successAlertMessage: Locator;
|
|
1196
1202
|
constructor(page: Page);
|
|
1197
1203
|
url(): string;
|
|
1204
|
+
getLineItemByFlowName(flowName: string): Promise<Record<string, Locator>>;
|
|
1198
1205
|
}
|
|
1199
1206
|
|
|
1200
1207
|
declare class FlowBuilderDetail implements PageObject {
|
|
@@ -1308,6 +1315,10 @@ type Currency = components['schemas']['Currency'] & {
|
|
|
1308
1315
|
declare const getCurrency: (isoCode: string, adminApiContext: AdminApiContext) => Promise<Currency>;
|
|
1309
1316
|
declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1310
1317
|
declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Gives the default shipping method back called Standard
|
|
1320
|
+
* @param adminApiContext - An AdminApiContext entity
|
|
1321
|
+
*/
|
|
1311
1322
|
declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1312
1323
|
declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>;
|
|
1313
1324
|
declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
|
package/dist/index.mjs
CHANGED
|
@@ -857,6 +857,12 @@ const test$a = test$e.extend({
|
|
|
857
857
|
await use(page);
|
|
858
858
|
await page.close();
|
|
859
859
|
await context.close();
|
|
860
|
+
},
|
|
861
|
+
page: async ({ AdminPage }, use) => {
|
|
862
|
+
await use(AdminPage);
|
|
863
|
+
},
|
|
864
|
+
context: async ({ AdminPage }, use) => {
|
|
865
|
+
await use(AdminPage.context());
|
|
860
866
|
}
|
|
861
867
|
});
|
|
862
868
|
|
|
@@ -3284,16 +3290,24 @@ class FlowBuilderListing {
|
|
|
3284
3290
|
__publicField$4(this, "firstFlowContextButton");
|
|
3285
3291
|
__publicField$4(this, "flowContextMenu");
|
|
3286
3292
|
__publicField$4(this, "contextMenuDownload");
|
|
3293
|
+
__publicField$4(this, "contextMenuDuplicate");
|
|
3294
|
+
__publicField$4(this, "contextMenuEdit");
|
|
3295
|
+
__publicField$4(this, "contextMenuDelete");
|
|
3287
3296
|
__publicField$4(this, "flowDownloadModal");
|
|
3288
3297
|
__publicField$4(this, "downloadFlowButton");
|
|
3298
|
+
__publicField$4(this, "flowDeleteButton");
|
|
3289
3299
|
__publicField$4(this, "successAlert");
|
|
3290
3300
|
__publicField$4(this, "successAlertMessage");
|
|
3291
3301
|
this.createFlowButton = page.locator(".sw-flow-list__create");
|
|
3292
3302
|
this.firstFlowName = page.locator(".sw-data-grid__cell--name a").first();
|
|
3293
3303
|
this.firstFlowContextButton = page.locator(".sw-data-grid__actions-menu").first();
|
|
3294
3304
|
this.flowContextMenu = page.locator(".sw-context-menu__content");
|
|
3295
|
-
this.contextMenuDownload =
|
|
3296
|
-
this.
|
|
3305
|
+
this.contextMenuDownload = this.flowContextMenu.locator(".sw-flow-list__item-download");
|
|
3306
|
+
this.contextMenuDuplicate = this.flowContextMenu.locator(".sw-flow-list__item-duplicate");
|
|
3307
|
+
this.contextMenuEdit = this.flowContextMenu.locator(".sw-flow-list__item-edit");
|
|
3308
|
+
this.contextMenuDelete = this.flowContextMenu.locator(".sw-flow-list__item-delete");
|
|
3309
|
+
this.flowDownloadModal = page.locator(".sw-flow-download-modal");
|
|
3310
|
+
this.flowDeleteButton = page.getByRole("dialog").filter({ hasText: "If you delete this flow, no more actions will be performed for the trigger. Are you sure you want to delete this flow?" }).getByRole("button", { name: "Delete" });
|
|
3297
3311
|
this.downloadFlowButton = page.getByRole("button", { name: "Download flow" });
|
|
3298
3312
|
this.successAlert = page.locator(".sw-alert__body");
|
|
3299
3313
|
this.successAlertMessage = page.locator(".sw-alert__message");
|
|
@@ -3301,6 +3315,23 @@ class FlowBuilderListing {
|
|
|
3301
3315
|
url() {
|
|
3302
3316
|
return "#/sw/flow/index/";
|
|
3303
3317
|
}
|
|
3318
|
+
async getLineItemByFlowName(flowName) {
|
|
3319
|
+
const lineItem = this.page.locator(".sw-data-grid__row").filter({ hasText: flowName });
|
|
3320
|
+
const flowSelectionCheckbox = lineItem.locator(".sw-data-grid__cell--selection").locator(".sw-field__checkbox");
|
|
3321
|
+
const flowActiveCheckmark = lineItem.locator(".sw-data-grid__cell--active").locator(".icon--regular-checkmark-xs");
|
|
3322
|
+
const flowDisabledCheckmark = lineItem.locator(".sw-data-grid__cell--active").locator(".icon--regular-times-s");
|
|
3323
|
+
const flowNameText = lineItem.locator(".sw-data-grid__cell--name");
|
|
3324
|
+
const flowEventNameText = lineItem.locator(".sw-data-grid__cell--eventName");
|
|
3325
|
+
const flowContextMenuButton = lineItem.locator(".sw-data-grid__actions-menu");
|
|
3326
|
+
return {
|
|
3327
|
+
flowSelectionCheckbox,
|
|
3328
|
+
flowActiveCheckmark,
|
|
3329
|
+
flowDisabledCheckmark,
|
|
3330
|
+
flowNameText,
|
|
3331
|
+
flowEventNameText,
|
|
3332
|
+
flowContextMenuButton
|
|
3333
|
+
};
|
|
3334
|
+
}
|
|
3304
3335
|
}
|
|
3305
3336
|
|
|
3306
3337
|
var __defProp$3 = Object.defineProperty;
|