cabloy 5.1.160 → 5.1.161
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/.cabloy-version +1 -1
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/repo-e2e/specs/cabloy-basic.spec.ts +16 -16
- package/test-results/.last-run.json +2 -20
- package/vona/pnpm-lock.yaml +31 -121
- package/test-results/a-commerce-ATP-ADDR-01-aut-11dea-ss-through-Web-self-service/error-context.md +0 -238
- package/test-results/a-commerce-ATP-SPC-01-Coup-ef380-mantic-Admin-field-controls/error-context.md +0 -240
- package/test-results/a-commerce-ATP-SPC-02-Cate-9f120-on-and-publication-controls/error-context.md +0 -238
- package/test-results/a-commerce-ATP-SPC-02-Prod-5f92a-on-and-publication-controls/error-context.md +0 -238
- package/test-results/a-commerce-ATP-SPC-02-SKU--2e61e-ency-and-lifecycle-controls/error-context.md +0 -238
- package/test-results/a-commerce-ATP-SPC-04-Stoc-fa895--readonly-and-mutation-free/error-context.md +0 -235
- package/test-results/a-commerce-ATP-SPC-05-syst-fb406-e-without-mutation-controls/error-context.md +0 -238
- package/test-results/a-commerce-Commerce-sessio-4e963-ie-selects-raw-server-theme/error-context.md +0 -226
- package/test-results/a-commerce-Commerce-theme--062fe--without-hydration-mismatch/error-context.md +0 -229
- package/test-results/a-commerce-PayPal-browser--8672c-t-or-open-an-awaiting-order/error-context.md +0 -238
- package/test-results/a-commerce-Payment-callbac-f56c2--reconciles-after-hydration/error-context.md +0 -238
- package/test-results/a-commerce-Payment-cancell-3fc74-ified-provider-confirmation/error-context.md +0 -238
- package/test-results/a-commerce-Phase-50-60-aut-71d61--observes-operator-shipment/error-context.md +0 -238
- package/test-results/a-commerce-Phase-60-custom-407cd-ecutes-a-whole-order-refund/error-context.md +0 -238
- package/test-results/cabloy-basic-ATP-BASIC-TAB-e7253-and-pins-configured-columns/error-context.md +0 -240
- package/test-results/markdown-ATP-SPC-02-Produc-9d5c2-link-toolbar-edits-Markdown/error-context.md +0 -211
- package/test-results/markdown-ATP-SPC-02-Produc-9d6ea-t-editor-and-saves-Markdown/error-context.md +0 -238
package/test-results/a-commerce-ATP-SPC-01-Coup-ef380-mantic-Admin-field-controls/error-context.md
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
# Instructions
|
|
2
|
-
|
|
3
|
-
- Following Playwright test failed.
|
|
4
|
-
- Explain why, be concise, respect Playwright best practices.
|
|
5
|
-
- Provide a snippet of code with the fix, if possible.
|
|
6
|
-
|
|
7
|
-
# Test info
|
|
8
|
-
|
|
9
|
-
- Name: a-commerce.spec.ts >> ATP-SPC-01: Coupon Template renders semantic Admin field controls
|
|
10
|
-
- Location: repo-e2e/specs/a-commerce.spec.ts:1443:1
|
|
11
|
-
|
|
12
|
-
# Error details
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Error: expect(page).toHaveURL(expected) failed
|
|
16
|
-
|
|
17
|
-
Expected pattern: /\/commerce-admin\/rest\/resource\/commerce-promotion(?:%3A|:|%253A)couponTemplate\/create(?:[/?#]|$)/
|
|
18
|
-
Received string: "http://127.0.0.1:7102/commerce-admin/home/base/errorAccessDenied"
|
|
19
|
-
Timeout: 5000ms
|
|
20
|
-
|
|
21
|
-
Call log:
|
|
22
|
-
- Expect "toHaveURL" with timeout 5000ms
|
|
23
|
-
2 × locator resolved to <html lang="en-us">…</html>
|
|
24
|
-
- unexpected value "http://127.0.0.1:7102/commerce-admin/home/base/errorAccessDenied"
|
|
25
|
-
12 × locator resolved to <html lang="en-us" data-zova-hydrated="commerceAdmin">…</html>
|
|
26
|
-
- unexpected value "http://127.0.0.1:7102/commerce-admin/home/base/errorAccessDenied"
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
```yaml
|
|
31
|
-
- text: 403 Access denied.
|
|
32
|
-
- button "Go Home"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
# Test source
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
1360 | await expect(page.getByText('refunded · $45.99')).toBeVisible();
|
|
39
|
-
1361 | await expect(page.getByText('1 × $45.99 = $45.99')).toBeVisible();
|
|
40
|
-
1362 | await expect(page.getByRole('heading', { name: 'Shipment' })).toHaveCount(0);
|
|
41
|
-
1363 | await expect(page.getByRole('alert')).toHaveCount(0);
|
|
42
|
-
1364 | expect(pageErrors).toEqual([]);
|
|
43
|
-
1365 | } finally {
|
|
44
|
-
1366 | await context.close().catch(() => {});
|
|
45
|
-
1367 | }
|
|
46
|
-
1368 | },
|
|
47
|
-
1369 | );
|
|
48
|
-
1370 |
|
|
49
|
-
1371 | test(
|
|
50
|
-
1372 | 'ATP-SPC-05: systemAdmin inspects readonly Address Resource without mutation controls',
|
|
51
|
-
1373 | { tag: ['@admin', '@flow', '@address'] },
|
|
52
|
-
1374 | async ({ browser, request }, testInfo) => {
|
|
53
|
-
1375 | test.setTimeout(60_000);
|
|
54
|
-
1376 | const customer = await createAddressThroughCustomerPage(browser, request, testInfo);
|
|
55
|
-
1377 | const adminContext = await browser.newContext();
|
|
56
|
-
1378 | const adminPage = await adminContext.newPage();
|
|
57
|
-
1379 | const adminPageErrors = collectPageErrors(adminPage);
|
|
58
|
-
1380 | const addressMutationMethods: string[] = [];
|
|
59
|
-
1381 | adminPage.on('request', request => {
|
|
60
|
-
1382 | const url = new URL(request.url());
|
|
61
|
-
1383 | if (
|
|
62
|
-
1384 | url.pathname.startsWith(addressActionPath) &&
|
|
63
|
-
1385 | ['POST', 'PATCH', 'PUT', 'DELETE'].includes(request.method())
|
|
64
|
-
1386 | ) {
|
|
65
|
-
1387 | addressMutationMethods.push(request.method());
|
|
66
|
-
1388 | }
|
|
67
|
-
1389 | });
|
|
68
|
-
1390 |
|
|
69
|
-
1391 | try {
|
|
70
|
-
1392 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
71
|
-
1393 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
72
|
-
1394 | await adminPage.goto('/commerce-admin/rest/resource/commerce-member%3Aaddress', {
|
|
73
|
-
1395 | waitUntil: 'load',
|
|
74
|
-
1396 | });
|
|
75
|
-
1397 | await expect(adminPage).toHaveURL(addressResourceUrl);
|
|
76
|
-
1398 | const fixtureRow = adminPage.getByRole('row', { name: customer.fixture.recipientName });
|
|
77
|
-
1399 | await expect(fixtureRow).toBeVisible();
|
|
78
|
-
1400 | await expect(fixtureRow).toContainText(customer.fixture.recipientName);
|
|
79
|
-
1401 | await expect(fixtureRow).toContainText(customer.fixture.phone);
|
|
80
|
-
1402 | await expect(fixtureRow).toContainText(customer.fixture.countryCode);
|
|
81
|
-
1403 | await expect(fixtureRow).toContainText(customer.fixture.city);
|
|
82
|
-
1404 | await expect(fixtureRow).not.toContainText(customer.fixture.region);
|
|
83
|
-
1405 | await expect(fixtureRow).not.toContainText(customer.fixture.postalCode);
|
|
84
|
-
1406 | await expect(fixtureRow).not.toContainText(customer.fixture.addressLine1);
|
|
85
|
-
1407 | await expect(fixtureRow).not.toContainText(customer.fixture.addressLine2);
|
|
86
|
-
1408 | await expect(adminPage.getByRole('button', { name: 'Create', exact: true })).toHaveCount(0);
|
|
87
|
-
1409 | await expect(
|
|
88
|
-
1410 | adminPage.locator('a[href*="/rest/resource/"]').filter({ hasText: 'Create' }),
|
|
89
|
-
1411 | ).toHaveCount(0);
|
|
90
|
-
1412 |
|
|
91
|
-
1413 | const addressId = await fixtureRow.getByRole('cell').first().textContent();
|
|
92
|
-
1414 | expect(addressId).toMatch(/^\d+$/);
|
|
93
|
-
1415 | await expect(fixtureRow.getByRole('link', { name: addressId! })).toHaveCount(1);
|
|
94
|
-
1416 | await adminPage.goto(`/commerce-admin/rest/resource/commerce-member%3Aaddress/${addressId}`, {
|
|
95
|
-
1417 | waitUntil: 'load',
|
|
96
|
-
1418 | });
|
|
97
|
-
1419 | await expect(adminPage).toHaveURL(
|
|
98
|
-
1420 | /\/commerce-admin\/rest\/resource\/commerce-member(?:%3A|:|%253A)address\/\d+(?:[/?#]|$)/,
|
|
99
|
-
1421 | );
|
|
100
|
-
1422 | await expect(
|
|
101
|
-
1423 | adminPage.getByRole('group', { name: 'Address Line 1 *' }).getByRole('textbox'),
|
|
102
|
-
1424 | ).toHaveValue(customer.fixture.addressLine1);
|
|
103
|
-
1425 | await expect(
|
|
104
|
-
1426 | adminPage.getByRole('group', { name: 'City *' }).getByRole('textbox'),
|
|
105
|
-
1427 | ).toHaveValue(customer.fixture.city);
|
|
106
|
-
1428 | await expect(adminPage.getByRole('button', { name: 'Back', exact: true })).toBeVisible();
|
|
107
|
-
1429 | await expect(adminPage.getByRole('button', { name: 'Submit', exact: true })).toHaveCount(0);
|
|
108
|
-
1430 | expect(addressMutationMethods).toEqual([]);
|
|
109
|
-
1431 | expect(adminPageErrors).toEqual([]);
|
|
110
|
-
1432 |
|
|
111
|
-
1433 | await deleteAddressThroughCustomerPage(customer.page, customer.fixture);
|
|
112
|
-
1434 | await expect(customer.page.getByRole('alert')).toHaveCount(0);
|
|
113
|
-
1435 | expect(customer.pageErrors).toEqual([]);
|
|
114
|
-
1436 | } finally {
|
|
115
|
-
1437 | await adminContext.close().catch(() => {});
|
|
116
|
-
1438 | await customer.context.close().catch(() => {});
|
|
117
|
-
1439 | }
|
|
118
|
-
1440 | },
|
|
119
|
-
1441 | );
|
|
120
|
-
1442 |
|
|
121
|
-
1443 | test(
|
|
122
|
-
1444 | 'ATP-SPC-01: Coupon Template renders semantic Admin field controls',
|
|
123
|
-
1445 | { tag: ['@admin', '@flow', '@fia'] },
|
|
124
|
-
1446 | async ({ browser }) => {
|
|
125
|
-
1447 | test.setTimeout(60_000);
|
|
126
|
-
1448 | const adminContext = await browser.newContext();
|
|
127
|
-
1449 | const adminPage = await adminContext.newPage();
|
|
128
|
-
1450 | const adminPageErrors = collectPageErrors(adminPage);
|
|
129
|
-
1451 | try {
|
|
130
|
-
1452 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
131
|
-
1453 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
132
|
-
1454 | await adminPage.goto(
|
|
133
|
-
1455 | '/commerce-admin/rest/resource/commerce-promotion%3AcouponTemplate/create',
|
|
134
|
-
1456 | {
|
|
135
|
-
1457 | waitUntil: 'load',
|
|
136
|
-
1458 | },
|
|
137
|
-
1459 | );
|
|
138
|
-
> 1460 | await expect(adminPage).toHaveURL(
|
|
139
|
-
| ^ Error: expect(page).toHaveURL(expected) failed
|
|
140
|
-
1461 | /\/commerce-admin\/rest\/resource\/commerce-promotion(?:%3A|:|%253A)couponTemplate\/create(?:[/?#]|$)/,
|
|
141
|
-
1462 | );
|
|
142
|
-
1463 |
|
|
143
|
-
1464 | for (const groupName of [
|
|
144
|
-
1465 | 'Basic Information',
|
|
145
|
-
1466 | 'Discount Policy',
|
|
146
|
-
1467 | 'Validity Window',
|
|
147
|
-
1468 | 'Usage Limits',
|
|
148
|
-
1469 | ]) {
|
|
149
|
-
1470 | await expect(adminPage.getByRole('group', { name: groupName })).toBeVisible();
|
|
150
|
-
1471 | }
|
|
151
|
-
1472 |
|
|
152
|
-
1473 | const state = adminPage
|
|
153
|
-
1474 | .getByRole('group', { name: 'Template State *' })
|
|
154
|
-
1475 | .getByRole('combobox');
|
|
155
|
-
1476 | await expect(state).toBeVisible();
|
|
156
|
-
1477 | await state.selectOption({ label: 'Active' });
|
|
157
|
-
1478 | await expect(state).toHaveValue('active');
|
|
158
|
-
1479 |
|
|
159
|
-
1480 | const discountInput = adminPage
|
|
160
|
-
1481 | .getByRole('group', { name: 'Fixed Discount *' })
|
|
161
|
-
1482 | .getByRole('textbox');
|
|
162
|
-
1483 | const minSpendInput = adminPage
|
|
163
|
-
1484 | .getByRole('group', { name: 'Minimum Spend *' })
|
|
164
|
-
1485 | .getByRole('textbox');
|
|
165
|
-
1486 | await discountInput.fill('12.34');
|
|
166
|
-
1487 | await minSpendInput.fill('45.67');
|
|
167
|
-
1488 | await expect(discountInput).toHaveValue('12.34');
|
|
168
|
-
1489 | await expect(minSpendInput).toHaveValue('45.67');
|
|
169
|
-
1490 | await expect(
|
|
170
|
-
1491 | adminPage.getByRole('group', { name: 'Valid From *' }).locator('input[type="date"]'),
|
|
171
|
-
1492 | ).toBeVisible();
|
|
172
|
-
1493 | await expect(
|
|
173
|
-
1494 | adminPage.getByRole('group', { name: 'Valid Until *' }).locator('input[type="date"]'),
|
|
174
|
-
1495 | ).toBeVisible();
|
|
175
|
-
1496 |
|
|
176
|
-
1497 | await adminPage
|
|
177
|
-
1498 | .getByRole('group', { name: 'Name *' })
|
|
178
|
-
1499 | .getByRole('textbox')
|
|
179
|
-
1500 | .fill('E2E Coupon Template');
|
|
180
|
-
1501 | await adminPage.getByRole('group', { name: 'Currency *' }).getByRole('textbox').fill('USD');
|
|
181
|
-
1502 | await adminPage
|
|
182
|
-
1503 | .getByRole('group', { name: 'Valid From *' })
|
|
183
|
-
1504 | .getByRole('textbox')
|
|
184
|
-
1505 | .fill('2026-08-04');
|
|
185
|
-
1506 | await adminPage
|
|
186
|
-
1507 | .getByRole('group', { name: 'Valid Until *' })
|
|
187
|
-
1508 | .getByRole('textbox')
|
|
188
|
-
1509 | .fill('2026-12-31');
|
|
189
|
-
1510 | await adminPage
|
|
190
|
-
1511 | .getByRole('group', { name: 'Total Issue Limit' })
|
|
191
|
-
1512 | .getByRole('textbox')
|
|
192
|
-
1513 | .fill('10');
|
|
193
|
-
1514 | await adminPage
|
|
194
|
-
1515 | .getByRole('group', { name: 'Total Usage Limit' })
|
|
195
|
-
1516 | .getByRole('textbox')
|
|
196
|
-
1517 | .fill('10');
|
|
197
|
-
1518 | await adminPage
|
|
198
|
-
1519 | .getByRole('group', { name: 'Per-customer Issue Limit' })
|
|
199
|
-
1520 | .getByRole('textbox')
|
|
200
|
-
1521 | .fill('1');
|
|
201
|
-
1522 |
|
|
202
|
-
1523 | await expect(adminPage.getByRole('button', { name: 'Submit', exact: true })).toBeVisible();
|
|
203
|
-
1524 | await expect(adminPage.getByRole('button', { name: 'Back', exact: true })).toBeVisible();
|
|
204
|
-
1525 | expect(adminPageErrors).toEqual([]);
|
|
205
|
-
1526 | } finally {
|
|
206
|
-
1527 | await adminContext.close().catch(() => {});
|
|
207
|
-
1528 | }
|
|
208
|
-
1529 | },
|
|
209
|
-
1530 | );
|
|
210
|
-
1531 |
|
|
211
|
-
1532 | test(
|
|
212
|
-
1533 | 'ATP-SPC-02: Category renders semantic Admin relation and publication controls',
|
|
213
|
-
1534 | { tag: ['@admin', '@flow', '@category'] },
|
|
214
|
-
1535 | async ({ browser }, testInfo) => {
|
|
215
|
-
1536 | test.setTimeout(60_000);
|
|
216
|
-
1537 | const suffix = `${testInfo.workerIndex}-${testInfo.parallelIndex ?? testInfo.retry}-${Date.now()}`;
|
|
217
|
-
1538 | const parentName = `E2E Category Parent ${suffix}`;
|
|
218
|
-
1539 | const childName = `E2E Category Child ${suffix}`;
|
|
219
|
-
1540 | const adminContext = await browser.newContext();
|
|
220
|
-
1541 | const adminPage = await adminContext.newPage();
|
|
221
|
-
1542 | const adminPageErrors = collectPageErrors(adminPage);
|
|
222
|
-
1543 | const categoryCreatePath = '/commerce-admin/rest/resource/commerce-catalog%3Acategory/create';
|
|
223
|
-
1544 | const categoryListPath = '/commerce-admin/rest/resource/commerce-catalog%3Acategory';
|
|
224
|
-
1545 | const categoryActionPath = '/api/commerce/catalog/category';
|
|
225
|
-
1546 | let parentId: number | string | undefined;
|
|
226
|
-
1547 | let childId: number | string | undefined;
|
|
227
|
-
1548 | let headers: { Authorization: string } | undefined;
|
|
228
|
-
1549 | try {
|
|
229
|
-
1550 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
230
|
-
1551 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
231
|
-
1552 | const accessToken = (await adminContext.cookies()).find(
|
|
232
|
-
1553 | cookie => cookie.name === 'token',
|
|
233
|
-
1554 | )?.value;
|
|
234
|
-
1555 | expect(accessToken).toBeTruthy();
|
|
235
|
-
1556 | headers = { Authorization: `Bearer ${accessToken}` };
|
|
236
|
-
1557 |
|
|
237
|
-
1558 | const parentCreateResponse = await adminPage.request.post(categoryActionPath, {
|
|
238
|
-
1559 | data: { name: parentName, published: false },
|
|
239
|
-
1560 | headers,
|
|
240
|
-
```
|
package/test-results/a-commerce-ATP-SPC-02-Cate-9f120-on-and-publication-controls/error-context.md
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# Instructions
|
|
2
|
-
|
|
3
|
-
- Following Playwright test failed.
|
|
4
|
-
- Explain why, be concise, respect Playwright best practices.
|
|
5
|
-
- Provide a snippet of code with the fix, if possible.
|
|
6
|
-
|
|
7
|
-
# Test info
|
|
8
|
-
|
|
9
|
-
- Name: a-commerce.spec.ts >> ATP-SPC-02: Category renders semantic Admin relation and publication controls
|
|
10
|
-
- Location: repo-e2e/specs/a-commerce.spec.ts:1532:1
|
|
11
|
-
|
|
12
|
-
# Error details
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Error: expect(locator).toBeVisible() failed
|
|
16
|
-
|
|
17
|
-
Locator: getByRole('group', { name: 'Published' }).getByRole('combobox')
|
|
18
|
-
Expected: visible
|
|
19
|
-
Timeout: 5000ms
|
|
20
|
-
Error: element(s) not found
|
|
21
|
-
|
|
22
|
-
Call log:
|
|
23
|
-
- Expect "toBeVisible" with timeout 5000ms
|
|
24
|
-
- waiting for getByRole('group', { name: 'Published' }).getByRole('combobox')
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
- text: 403 Access denied.
|
|
30
|
-
- button "Go Home"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# Test source
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
1470 | await expect(adminPage.getByRole('group', { name: groupName })).toBeVisible();
|
|
37
|
-
1471 | }
|
|
38
|
-
1472 |
|
|
39
|
-
1473 | const state = adminPage
|
|
40
|
-
1474 | .getByRole('group', { name: 'Template State *' })
|
|
41
|
-
1475 | .getByRole('combobox');
|
|
42
|
-
1476 | await expect(state).toBeVisible();
|
|
43
|
-
1477 | await state.selectOption({ label: 'Active' });
|
|
44
|
-
1478 | await expect(state).toHaveValue('active');
|
|
45
|
-
1479 |
|
|
46
|
-
1480 | const discountInput = adminPage
|
|
47
|
-
1481 | .getByRole('group', { name: 'Fixed Discount *' })
|
|
48
|
-
1482 | .getByRole('textbox');
|
|
49
|
-
1483 | const minSpendInput = adminPage
|
|
50
|
-
1484 | .getByRole('group', { name: 'Minimum Spend *' })
|
|
51
|
-
1485 | .getByRole('textbox');
|
|
52
|
-
1486 | await discountInput.fill('12.34');
|
|
53
|
-
1487 | await minSpendInput.fill('45.67');
|
|
54
|
-
1488 | await expect(discountInput).toHaveValue('12.34');
|
|
55
|
-
1489 | await expect(minSpendInput).toHaveValue('45.67');
|
|
56
|
-
1490 | await expect(
|
|
57
|
-
1491 | adminPage.getByRole('group', { name: 'Valid From *' }).locator('input[type="date"]'),
|
|
58
|
-
1492 | ).toBeVisible();
|
|
59
|
-
1493 | await expect(
|
|
60
|
-
1494 | adminPage.getByRole('group', { name: 'Valid Until *' }).locator('input[type="date"]'),
|
|
61
|
-
1495 | ).toBeVisible();
|
|
62
|
-
1496 |
|
|
63
|
-
1497 | await adminPage
|
|
64
|
-
1498 | .getByRole('group', { name: 'Name *' })
|
|
65
|
-
1499 | .getByRole('textbox')
|
|
66
|
-
1500 | .fill('E2E Coupon Template');
|
|
67
|
-
1501 | await adminPage.getByRole('group', { name: 'Currency *' }).getByRole('textbox').fill('USD');
|
|
68
|
-
1502 | await adminPage
|
|
69
|
-
1503 | .getByRole('group', { name: 'Valid From *' })
|
|
70
|
-
1504 | .getByRole('textbox')
|
|
71
|
-
1505 | .fill('2026-08-04');
|
|
72
|
-
1506 | await adminPage
|
|
73
|
-
1507 | .getByRole('group', { name: 'Valid Until *' })
|
|
74
|
-
1508 | .getByRole('textbox')
|
|
75
|
-
1509 | .fill('2026-12-31');
|
|
76
|
-
1510 | await adminPage
|
|
77
|
-
1511 | .getByRole('group', { name: 'Total Issue Limit' })
|
|
78
|
-
1512 | .getByRole('textbox')
|
|
79
|
-
1513 | .fill('10');
|
|
80
|
-
1514 | await adminPage
|
|
81
|
-
1515 | .getByRole('group', { name: 'Total Usage Limit' })
|
|
82
|
-
1516 | .getByRole('textbox')
|
|
83
|
-
1517 | .fill('10');
|
|
84
|
-
1518 | await adminPage
|
|
85
|
-
1519 | .getByRole('group', { name: 'Per-customer Issue Limit' })
|
|
86
|
-
1520 | .getByRole('textbox')
|
|
87
|
-
1521 | .fill('1');
|
|
88
|
-
1522 |
|
|
89
|
-
1523 | await expect(adminPage.getByRole('button', { name: 'Submit', exact: true })).toBeVisible();
|
|
90
|
-
1524 | await expect(adminPage.getByRole('button', { name: 'Back', exact: true })).toBeVisible();
|
|
91
|
-
1525 | expect(adminPageErrors).toEqual([]);
|
|
92
|
-
1526 | } finally {
|
|
93
|
-
1527 | await adminContext.close().catch(() => {});
|
|
94
|
-
1528 | }
|
|
95
|
-
1529 | },
|
|
96
|
-
1530 | );
|
|
97
|
-
1531 |
|
|
98
|
-
1532 | test(
|
|
99
|
-
1533 | 'ATP-SPC-02: Category renders semantic Admin relation and publication controls',
|
|
100
|
-
1534 | { tag: ['@admin', '@flow', '@category'] },
|
|
101
|
-
1535 | async ({ browser }, testInfo) => {
|
|
102
|
-
1536 | test.setTimeout(60_000);
|
|
103
|
-
1537 | const suffix = `${testInfo.workerIndex}-${testInfo.parallelIndex ?? testInfo.retry}-${Date.now()}`;
|
|
104
|
-
1538 | const parentName = `E2E Category Parent ${suffix}`;
|
|
105
|
-
1539 | const childName = `E2E Category Child ${suffix}`;
|
|
106
|
-
1540 | const adminContext = await browser.newContext();
|
|
107
|
-
1541 | const adminPage = await adminContext.newPage();
|
|
108
|
-
1542 | const adminPageErrors = collectPageErrors(adminPage);
|
|
109
|
-
1543 | const categoryCreatePath = '/commerce-admin/rest/resource/commerce-catalog%3Acategory/create';
|
|
110
|
-
1544 | const categoryListPath = '/commerce-admin/rest/resource/commerce-catalog%3Acategory';
|
|
111
|
-
1545 | const categoryActionPath = '/api/commerce/catalog/category';
|
|
112
|
-
1546 | let parentId: number | string | undefined;
|
|
113
|
-
1547 | let childId: number | string | undefined;
|
|
114
|
-
1548 | let headers: { Authorization: string } | undefined;
|
|
115
|
-
1549 | try {
|
|
116
|
-
1550 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
117
|
-
1551 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
118
|
-
1552 | const accessToken = (await adminContext.cookies()).find(
|
|
119
|
-
1553 | cookie => cookie.name === 'token',
|
|
120
|
-
1554 | )?.value;
|
|
121
|
-
1555 | expect(accessToken).toBeTruthy();
|
|
122
|
-
1556 | headers = { Authorization: `Bearer ${accessToken}` };
|
|
123
|
-
1557 |
|
|
124
|
-
1558 | const parentCreateResponse = await adminPage.request.post(categoryActionPath, {
|
|
125
|
-
1559 | data: { name: parentName, published: false },
|
|
126
|
-
1560 | headers,
|
|
127
|
-
1561 | });
|
|
128
|
-
1562 | expect(parentCreateResponse.ok()).toBeTruthy();
|
|
129
|
-
1563 | parentId = (await parentCreateResponse.json()).data;
|
|
130
|
-
1564 | expectTableIdentity(parentId);
|
|
131
|
-
1565 |
|
|
132
|
-
1566 | await adminPage.goto(categoryCreatePath, { waitUntil: 'load' });
|
|
133
|
-
1567 | const parentPublication = adminPage
|
|
134
|
-
1568 | .getByRole('group', { name: 'Published' })
|
|
135
|
-
1569 | .getByRole('combobox');
|
|
136
|
-
> 1570 | await expect(parentPublication).toBeVisible();
|
|
137
|
-
| ^ Error: expect(locator).toBeVisible() failed
|
|
138
|
-
1571 | await expect(parentPublication.locator('option')).toHaveText([
|
|
139
|
-
1572 | '',
|
|
140
|
-
1573 | 'Unpublished',
|
|
141
|
-
1574 | 'Published',
|
|
142
|
-
1575 | ]);
|
|
143
|
-
1576 | await parentPublication.selectOption({ label: 'Unpublished' });
|
|
144
|
-
1577 | await expect(parentPublication).toHaveValue('false');
|
|
145
|
-
1578 |
|
|
146
|
-
1579 | const parentPicker = adminPage
|
|
147
|
-
1580 | .getByRole('group', { name: 'Parent category' })
|
|
148
|
-
1581 | .getByRole('combobox');
|
|
149
|
-
1582 | await expect(parentPicker).toBeVisible();
|
|
150
|
-
1583 | await parentPicker.selectOption({ label: parentName });
|
|
151
|
-
1584 | const parentValue = await parentPicker.inputValue();
|
|
152
|
-
1585 | expect(parentValue).toBe(String(parentId));
|
|
153
|
-
1586 | const childPublication = adminPage
|
|
154
|
-
1587 | .getByRole('group', { name: 'Published' })
|
|
155
|
-
1588 | .getByRole('combobox');
|
|
156
|
-
1589 | await childPublication.selectOption({ label: 'Published' });
|
|
157
|
-
1590 | await expect(childPublication).toHaveValue('true');
|
|
158
|
-
1591 |
|
|
159
|
-
1592 | const childCreateResponse = await adminPage.request.post(categoryActionPath, {
|
|
160
|
-
1593 | data: { name: childName, parentId: parentValue, published: true },
|
|
161
|
-
1594 | headers,
|
|
162
|
-
1595 | });
|
|
163
|
-
1596 | expect(childCreateResponse.ok()).toBeTruthy();
|
|
164
|
-
1597 | childId = (await childCreateResponse.json()).data;
|
|
165
|
-
1598 | expectTableIdentity(childId);
|
|
166
|
-
1599 |
|
|
167
|
-
1600 | await adminPage.goto(categoryListPath, { waitUntil: 'load' });
|
|
168
|
-
1601 | const childRow = adminPage.getByRole('row', { name: new RegExp(childName) });
|
|
169
|
-
1602 | await expect(childRow).toBeVisible();
|
|
170
|
-
1603 | await expect(childRow.getByText(parentName, { exact: true })).toBeVisible();
|
|
171
|
-
1604 | await expect(childRow.getByText('Published', { exact: true })).toBeVisible();
|
|
172
|
-
1605 |
|
|
173
|
-
1606 | await adminPage.goto(`${categoryListPath}/${parentId}/edit`, { waitUntil: 'load' });
|
|
174
|
-
1607 | await expect(
|
|
175
|
-
1608 | adminPage.getByRole('group', { name: 'Published' }).getByRole('combobox'),
|
|
176
|
-
1609 | ).toHaveValue('false');
|
|
177
|
-
1610 |
|
|
178
|
-
1611 | await adminPage.goto(`${categoryListPath}/${childId}/edit`, { waitUntil: 'load' });
|
|
179
|
-
1612 | await expect(
|
|
180
|
-
1613 | adminPage.getByRole('group', { name: 'Published' }).getByRole('combobox'),
|
|
181
|
-
1614 | ).toHaveValue('true');
|
|
182
|
-
1615 |
|
|
183
|
-
1616 | await adminPage.goto(`${categoryListPath}/${childId}`, { waitUntil: 'load' });
|
|
184
|
-
1617 | await expect(
|
|
185
|
-
1618 | adminPage.getByRole('group', { name: 'Parent category' }).getByRole('textbox'),
|
|
186
|
-
1619 | ).toHaveValue(parentName);
|
|
187
|
-
1620 | await expect(
|
|
188
|
-
1621 | adminPage.getByRole('group', { name: 'Published' }).getByRole('textbox'),
|
|
189
|
-
1622 | ).toHaveValue('Published');
|
|
190
|
-
1623 | await expect(adminPage.getByRole('button', { name: 'Submit', exact: true })).toHaveCount(0);
|
|
191
|
-
1624 | expect(adminPageErrors).toEqual([]);
|
|
192
|
-
1625 | } finally {
|
|
193
|
-
1626 | if (childId && headers) {
|
|
194
|
-
1627 | const response = await adminPage.request.delete(`${categoryActionPath}/${childId}`, {
|
|
195
|
-
1628 | headers,
|
|
196
|
-
1629 | });
|
|
197
|
-
1630 | expect(response.ok()).toBeTruthy();
|
|
198
|
-
1631 | }
|
|
199
|
-
1632 | if (parentId && headers) {
|
|
200
|
-
1633 | const response = await adminPage.request.delete(`${categoryActionPath}/${parentId}`, {
|
|
201
|
-
1634 | headers,
|
|
202
|
-
1635 | });
|
|
203
|
-
1636 | expect(response.ok()).toBeTruthy();
|
|
204
|
-
1637 | }
|
|
205
|
-
1638 | await adminContext.close().catch(() => {});
|
|
206
|
-
1639 | }
|
|
207
|
-
1640 | },
|
|
208
|
-
1641 | );
|
|
209
|
-
1642 |
|
|
210
|
-
1643 | test(
|
|
211
|
-
1644 | 'ATP-SPC-02: Product renders semantic Admin relation and publication controls',
|
|
212
|
-
1645 | { tag: ['@admin', '@flow', '@product'] },
|
|
213
|
-
1646 | async ({ browser }, testInfo) => {
|
|
214
|
-
1647 | test.setTimeout(60_000);
|
|
215
|
-
1648 | const suffix = `${testInfo.workerIndex}-${testInfo.parallelIndex ?? testInfo.retry}-${Date.now()}`;
|
|
216
|
-
1649 | const categoryName = `E2E Product Category ${suffix}`;
|
|
217
|
-
1650 | const productTitle = `E2E Product ${suffix}`;
|
|
218
|
-
1651 | const adminContext = await browser.newContext();
|
|
219
|
-
1652 | const adminPage = await adminContext.newPage();
|
|
220
|
-
1653 | const adminPageErrors = collectPageErrors(adminPage);
|
|
221
|
-
1654 | const productCreatePath = '/commerce-admin/rest/resource/commerce-catalog%3Aproduct/create';
|
|
222
|
-
1655 | const productListPath = '/commerce-admin/rest/resource/commerce-catalog%3Aproduct';
|
|
223
|
-
1656 | const categoryActionPath = '/api/commerce/catalog/category';
|
|
224
|
-
1657 | const productActionPath = '/api/commerce/catalog/product';
|
|
225
|
-
1658 | let categoryId: number | string | undefined;
|
|
226
|
-
1659 | let productId: number | string | undefined;
|
|
227
|
-
1660 | let headers: { Authorization: string } | undefined;
|
|
228
|
-
1661 | try {
|
|
229
|
-
1662 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
230
|
-
1663 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
231
|
-
1664 | const accessToken = (await adminContext.cookies()).find(
|
|
232
|
-
1665 | cookie => cookie.name === 'token',
|
|
233
|
-
1666 | )?.value;
|
|
234
|
-
1667 | expect(accessToken).toBeTruthy();
|
|
235
|
-
1668 | headers = { Authorization: `Bearer ${accessToken}` };
|
|
236
|
-
1669 |
|
|
237
|
-
1670 | const categoryResponse = await adminPage.request.post(categoryActionPath, {
|
|
238
|
-
```
|