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/markdown-ATP-SPC-02-Produc-9d5c2-link-toolbar-edits-Markdown/error-context.md
DELETED
|
@@ -1,211 +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: markdown.spec.ts >> ATP-SPC-02: Product Content link toolbar edits Markdown
|
|
10
|
-
- Location: repo-e2e/specs/markdown.spec.ts:448:1
|
|
11
|
-
|
|
12
|
-
# Error details
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Error: expect(locator).toBeVisible() failed
|
|
16
|
-
|
|
17
|
-
Locator: locator('[contenteditable="true"]')
|
|
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 locator('[contenteditable="true"]')
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
- text: 403 Access denied.
|
|
30
|
-
- button "Go Home"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# Test source
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
403 | await expect(insertedTable.locator('td')).toHaveCount(4);
|
|
37
|
-
404 | expect(adminPageErrors).toEqual([]);
|
|
38
|
-
405 | await tableToolbar.getByRole('button', { name: 'Delete column' }).click();
|
|
39
|
-
406 | await expect(insertedTable.locator('th')).toHaveCount(3);
|
|
40
|
-
407 | await expect(insertedTable.locator('td')).toHaveCount(3);
|
|
41
|
-
408 | expect(adminPageErrors).toEqual([]);
|
|
42
|
-
409 | await tableToolbar.getByRole('button', { name: 'Delete table' }).click();
|
|
43
|
-
410 | await expect(editor.locator('table')).toHaveCount(1);
|
|
44
|
-
411 | await expect(tableToolbar).toBeHidden();
|
|
45
|
-
412 | expect(adminPageErrors).toEqual([]);
|
|
46
|
-
413 |
|
|
47
|
-
414 | const productUpdate = waitForApiResponse(
|
|
48
|
-
415 | adminPage,
|
|
49
|
-
416 | 'PATCH',
|
|
50
|
-
417 | `${productActionPath}/${productId}`,
|
|
51
|
-
418 | );
|
|
52
|
-
419 | await adminPage.getByRole('button', { name: 'Submit', exact: true }).click();
|
|
53
|
-
420 | await productUpdate;
|
|
54
|
-
421 | const productResponseAfterUpdate = await adminPage.request.get(
|
|
55
|
-
422 | `${productActionPath}/${productId}`,
|
|
56
|
-
423 | { headers },
|
|
57
|
-
424 | );
|
|
58
|
-
425 | expect(productResponseAfterUpdate.ok()).toBeTruthy();
|
|
59
|
-
426 | expect((await productResponseAfterUpdate.json()).productContentForm.descriptionMarkdown).toBe(
|
|
60
|
-
427 | markdown.replace('```ts', '```python'),
|
|
61
|
-
428 | );
|
|
62
|
-
429 | expect(adminPageErrors).toEqual([]);
|
|
63
|
-
430 | } finally {
|
|
64
|
-
431 | if (productId && headers) {
|
|
65
|
-
432 | const response = await adminPage.request.delete(`${productActionPath}/${productId}`, {
|
|
66
|
-
433 | headers,
|
|
67
|
-
434 | });
|
|
68
|
-
435 | expect(response.ok()).toBeTruthy();
|
|
69
|
-
436 | }
|
|
70
|
-
437 | if (categoryId && headers) {
|
|
71
|
-
438 | const response = await adminPage.request.delete(`${categoryActionPath}/${categoryId}`, {
|
|
72
|
-
439 | headers,
|
|
73
|
-
440 | });
|
|
74
|
-
441 | expect(response.ok()).toBeTruthy();
|
|
75
|
-
442 | }
|
|
76
|
-
443 | await adminContext.close().catch(() => {});
|
|
77
|
-
444 | }
|
|
78
|
-
445 | },
|
|
79
|
-
446 | );
|
|
80
|
-
447 |
|
|
81
|
-
448 | test(
|
|
82
|
-
449 | 'ATP-SPC-02: Product Content link toolbar edits Markdown',
|
|
83
|
-
450 | { tag: ['@admin', '@flow', '@product'] },
|
|
84
|
-
451 | async ({ browser }, testInfo) => {
|
|
85
|
-
452 | test.setTimeout(180_000);
|
|
86
|
-
453 | const suffix = `${testInfo.workerIndex}-${testInfo.parallelIndex ?? testInfo.retry}-${Date.now()}`;
|
|
87
|
-
454 | const categoryName = `E2E Product Link Category ${suffix}`;
|
|
88
|
-
455 | const productTitle = `E2E Product Link ${suffix}`;
|
|
89
|
-
456 | const markdown = `# Product content ${suffix}\n\nA product description.`;
|
|
90
|
-
457 | const adminContext = await browser.newContext();
|
|
91
|
-
458 | const adminPage = await adminContext.newPage();
|
|
92
|
-
459 | const adminPageErrors = collectPageErrors(adminPage);
|
|
93
|
-
460 | const adminConsoleErrors = collectConsoleErrors(adminPage);
|
|
94
|
-
461 | const productListPath = '/commerce-admin/rest/resource/commerce-catalog%3Aproduct';
|
|
95
|
-
462 | const categoryActionPath = '/api/commerce/catalog/category';
|
|
96
|
-
463 | const productActionPath = '/api/commerce/catalog/product';
|
|
97
|
-
464 | let categoryId: number | string | undefined;
|
|
98
|
-
465 | let productId: number | string | undefined;
|
|
99
|
-
466 | let headers: { Authorization: string } | undefined;
|
|
100
|
-
467 | try {
|
|
101
|
-
468 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
102
|
-
469 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
103
|
-
470 | const accessToken = (await adminContext.cookies()).find(
|
|
104
|
-
471 | cookie => cookie.name === 'token',
|
|
105
|
-
472 | )?.value;
|
|
106
|
-
473 | expect(accessToken).toBeTruthy();
|
|
107
|
-
474 | headers = { Authorization: `Bearer ${accessToken}` };
|
|
108
|
-
475 |
|
|
109
|
-
476 | const categoryResponse = await adminPage.request.post(categoryActionPath, {
|
|
110
|
-
477 | data: { name: categoryName, published: false },
|
|
111
|
-
478 | headers,
|
|
112
|
-
479 | });
|
|
113
|
-
480 | expect(categoryResponse.ok()).toBeTruthy();
|
|
114
|
-
481 | categoryId = (await categoryResponse.json()).data;
|
|
115
|
-
482 | expectTableIdentity(categoryId);
|
|
116
|
-
483 |
|
|
117
|
-
484 | const productResponse = await adminPage.request.post(productActionPath, {
|
|
118
|
-
485 | data: {
|
|
119
|
-
486 | categoryId,
|
|
120
|
-
487 | title: productTitle,
|
|
121
|
-
488 | published: false,
|
|
122
|
-
489 | productContentForm: { descriptionMarkdown: markdown },
|
|
123
|
-
490 | },
|
|
124
|
-
491 | headers,
|
|
125
|
-
492 | });
|
|
126
|
-
493 | expect(productResponse.ok()).toBeTruthy();
|
|
127
|
-
494 | productId = (await productResponse.json()).data;
|
|
128
|
-
495 | expectTableIdentity(productId);
|
|
129
|
-
496 |
|
|
130
|
-
497 | await adminPage.goto(`${productListPath}/${productId}/edit`, { waitUntil: 'load' });
|
|
131
|
-
498 | await expect(adminPage.locator('html')).toHaveAttribute(
|
|
132
|
-
499 | 'data-zova-hydrated',
|
|
133
|
-
500 | 'commerceAdmin',
|
|
134
|
-
501 | );
|
|
135
|
-
502 | const editor = adminPage.locator('[contenteditable="true"]');
|
|
136
|
-
> 503 | await expect(editor).toBeVisible();
|
|
137
|
-
| ^ Error: expect(locator).toBeVisible() failed
|
|
138
|
-
504 | const toolbar = adminPage.getByRole('toolbar', { name: 'Markdown toolbar' });
|
|
139
|
-
505 | await expect(toolbar).toBeVisible();
|
|
140
|
-
506 | const linkButton = toolbar.getByRole('button', { name: 'Link' });
|
|
141
|
-
507 | await expect(linkButton).toHaveAttribute('type', 'button');
|
|
142
|
-
508 | await expect(linkButton).toBeDisabled();
|
|
143
|
-
509 |
|
|
144
|
-
510 | await editor.locator('h1').selectText();
|
|
145
|
-
511 | await expect(linkButton).toBeEnabled();
|
|
146
|
-
512 | await linkButton.click();
|
|
147
|
-
513 | const linkPrompt = adminPage.locator('.fixed.inset-0.z-50');
|
|
148
|
-
514 | await expect(linkPrompt).toBeVisible();
|
|
149
|
-
515 | const linkInput = linkPrompt.locator('input[type="text"]');
|
|
150
|
-
516 | await linkInput.fill('https://example.com/docs');
|
|
151
|
-
517 | await linkInput.press('Enter');
|
|
152
|
-
518 | await expect(editor.locator('h1 a[href="https://example.com/docs"]')).toHaveText(
|
|
153
|
-
519 | `Product content ${suffix}`,
|
|
154
|
-
520 | );
|
|
155
|
-
521 | await expect(linkButton).toHaveAttribute('aria-pressed', 'true');
|
|
156
|
-
522 | await editor.press('ArrowLeft');
|
|
157
|
-
523 | await expect(linkButton).toHaveAttribute('aria-pressed', 'true');
|
|
158
|
-
524 |
|
|
159
|
-
525 | await linkButton.click();
|
|
160
|
-
526 | await expect(linkPrompt).toBeVisible();
|
|
161
|
-
527 | await expect(linkInput).toHaveValue('https://example.com/docs');
|
|
162
|
-
528 | await linkInput.fill('https://example.com/updated');
|
|
163
|
-
529 | await linkPrompt.getByRole('button', { name: 'OK' }).click();
|
|
164
|
-
530 | await expect(editor.locator('h1 a[href="https://example.com/updated"]')).toHaveText(
|
|
165
|
-
531 | `Product content ${suffix}`,
|
|
166
|
-
532 | );
|
|
167
|
-
533 |
|
|
168
|
-
534 | await linkButton.click();
|
|
169
|
-
535 | await expect(linkPrompt).toBeVisible();
|
|
170
|
-
536 | await linkPrompt.getByRole('button', { name: 'Cancel' }).click();
|
|
171
|
-
537 | await expect(editor.locator('h1 a[href="https://example.com/updated"]')).toHaveText(
|
|
172
|
-
538 | `Product content ${suffix}`,
|
|
173
|
-
539 | );
|
|
174
|
-
540 |
|
|
175
|
-
541 | await editor.locator('h1').selectText();
|
|
176
|
-
542 | await expect(linkButton).toHaveAttribute('aria-pressed', 'true');
|
|
177
|
-
543 | await linkButton.click();
|
|
178
|
-
544 | await expect(linkPrompt).toBeVisible();
|
|
179
|
-
545 | await linkInput.fill('');
|
|
180
|
-
546 | await linkInput.press('Enter');
|
|
181
|
-
547 | await expect(editor.locator('h1 a')).toHaveCount(0);
|
|
182
|
-
548 | await adminPage.getByRole('button', { name: 'Submit', exact: true }).click();
|
|
183
|
-
549 | const productResponseAfterLinkRemoval = await adminPage.request.get(
|
|
184
|
-
550 | `${productActionPath}/${productId}`,
|
|
185
|
-
551 | { headers },
|
|
186
|
-
552 | );
|
|
187
|
-
553 | expect(productResponseAfterLinkRemoval.ok()).toBeTruthy();
|
|
188
|
-
554 | expect(
|
|
189
|
-
555 | (await productResponseAfterLinkRemoval.json()).productContentForm.descriptionMarkdown,
|
|
190
|
-
556 | ).not.toContain('https://example.com/updated');
|
|
191
|
-
557 | expect(adminPageErrors).toEqual([]);
|
|
192
|
-
558 | expect(adminConsoleErrors).toEqual([]);
|
|
193
|
-
559 | } finally {
|
|
194
|
-
560 | if (productId && headers) {
|
|
195
|
-
561 | const response = await adminPage.request.delete(`${productActionPath}/${productId}`, {
|
|
196
|
-
562 | headers,
|
|
197
|
-
563 | });
|
|
198
|
-
564 | expect(response.ok()).toBeTruthy();
|
|
199
|
-
565 | }
|
|
200
|
-
566 | if (categoryId && headers) {
|
|
201
|
-
567 | const response = await adminPage.request.delete(`${categoryActionPath}/${categoryId}`, {
|
|
202
|
-
568 | headers,
|
|
203
|
-
569 | });
|
|
204
|
-
570 | expect(response.ok()).toBeTruthy();
|
|
205
|
-
571 | }
|
|
206
|
-
572 | await adminContext.close().catch(() => {});
|
|
207
|
-
573 | }
|
|
208
|
-
574 | },
|
|
209
|
-
575 | );
|
|
210
|
-
576 |
|
|
211
|
-
```
|
package/test-results/markdown-ATP-SPC-02-Produc-9d6ea-t-editor-and-saves-Markdown/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: markdown.spec.ts >> ATP-SPC-02: Product Content opens the rich-text editor and saves Markdown
|
|
10
|
-
- Location: repo-e2e/specs/markdown.spec.ts:209:1
|
|
11
|
-
|
|
12
|
-
# Error details
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Error: expect(locator).toBeVisible() failed
|
|
16
|
-
|
|
17
|
-
Locator: locator('[contenteditable="true"]')
|
|
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 locator('[contenteditable="true"]')
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
- text: 403 Access denied.
|
|
30
|
-
- button "Go Home"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# Test source
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
185 | expect(webConsoleErrors).toEqual([]);
|
|
37
|
-
186 | } finally {
|
|
38
|
-
187 | if (skuId && headers) {
|
|
39
|
-
188 | const response = await adminPage.request.delete(`${skuActionPath}/${skuId}`, { headers });
|
|
40
|
-
189 | expect(response.ok()).toBeTruthy();
|
|
41
|
-
190 | }
|
|
42
|
-
191 | if (productId && headers) {
|
|
43
|
-
192 | const response = await adminPage.request.delete(`${productActionPath}/${productId}`, {
|
|
44
|
-
193 | headers,
|
|
45
|
-
194 | });
|
|
46
|
-
195 | expect(response.ok()).toBeTruthy();
|
|
47
|
-
196 | }
|
|
48
|
-
197 | if (categoryId && headers) {
|
|
49
|
-
198 | const response = await adminPage.request.delete(`${categoryActionPath}/${categoryId}`, {
|
|
50
|
-
199 | headers,
|
|
51
|
-
200 | });
|
|
52
|
-
201 | expect(response.ok()).toBeTruthy();
|
|
53
|
-
202 | }
|
|
54
|
-
203 | await webContext.close().catch(() => {});
|
|
55
|
-
204 | await adminContext.close().catch(() => {});
|
|
56
|
-
205 | }
|
|
57
|
-
206 | },
|
|
58
|
-
207 | );
|
|
59
|
-
208 |
|
|
60
|
-
209 | test(
|
|
61
|
-
210 | 'ATP-SPC-02: Product Content opens the rich-text editor and saves Markdown',
|
|
62
|
-
211 | { tag: ['@admin', '@flow', '@product'] },
|
|
63
|
-
212 | async ({ browser }, testInfo) => {
|
|
64
|
-
213 | test.setTimeout(60_000);
|
|
65
|
-
214 | const suffix = `${testInfo.workerIndex}-${testInfo.parallelIndex ?? testInfo.retry}-${Date.now()}`;
|
|
66
|
-
215 | const categoryName = `E2E Product Content Category ${suffix}`;
|
|
67
|
-
216 | const productTitle = `E2E Product Content ${suffix}`;
|
|
68
|
-
217 | const markdown = `# Product content ${suffix}
|
|
69
|
-
218 |
|
|
70
|
-
219 | - First benefit
|
|
71
|
-
220 | - Second benefit
|
|
72
|
-
221 |
|
|
73
|
-
222 | - [ ] Open task
|
|
74
|
-
223 | - [x] Completed task
|
|
75
|
-
224 |
|
|
76
|
-
225 | > Product quote
|
|
77
|
-
226 |
|
|
78
|
-
227 | \`\`\`ts
|
|
79
|
-
228 | const product = '${suffix}';
|
|
80
|
-
229 | \`\`\`
|
|
81
|
-
230 |
|
|
82
|
-
231 | ==highlighted text==
|
|
83
|
-
232 |
|
|
84
|
-
233 |
|
|
85
|
-
234 | | Feature | Value |
|
|
86
|
-
235 | | -------- | ------- |
|
|
87
|
-
236 | | Material | Durable |`;
|
|
88
|
-
237 | const adminContext = await browser.newContext();
|
|
89
|
-
238 | const adminPage = await adminContext.newPage();
|
|
90
|
-
239 | const adminPageErrors = collectPageErrors(adminPage);
|
|
91
|
-
240 | const adminConsoleErrors = collectConsoleErrors(adminPage);
|
|
92
|
-
241 | const productListPath = '/commerce-admin/rest/resource/commerce-catalog%3Aproduct';
|
|
93
|
-
242 | const categoryActionPath = '/api/commerce/catalog/category';
|
|
94
|
-
243 | const productActionPath = '/api/commerce/catalog/product';
|
|
95
|
-
244 | let categoryId: number | string | undefined;
|
|
96
|
-
245 | let productId: number | string | undefined;
|
|
97
|
-
246 | let headers: { Authorization: string } | undefined;
|
|
98
|
-
247 | try {
|
|
99
|
-
248 | await adminPage.setViewportSize({ width: 1440, height: 900 });
|
|
100
|
-
249 | await login(adminPage, '/commerce-admin/', 'admin', '123456', 'commerceAdmin');
|
|
101
|
-
250 | const accessToken = (await adminContext.cookies()).find(
|
|
102
|
-
251 | cookie => cookie.name === 'token',
|
|
103
|
-
252 | )?.value;
|
|
104
|
-
253 | expect(accessToken).toBeTruthy();
|
|
105
|
-
254 | headers = { Authorization: `Bearer ${accessToken}` };
|
|
106
|
-
255 |
|
|
107
|
-
256 | const categoryResponse = await adminPage.request.post(categoryActionPath, {
|
|
108
|
-
257 | data: { name: categoryName, published: false },
|
|
109
|
-
258 | headers,
|
|
110
|
-
259 | });
|
|
111
|
-
260 | expect(categoryResponse.ok()).toBeTruthy();
|
|
112
|
-
261 | categoryId = (await categoryResponse.json()).data;
|
|
113
|
-
262 | expectTableIdentity(categoryId);
|
|
114
|
-
263 |
|
|
115
|
-
264 | const productResponse = await adminPage.request.post(productActionPath, {
|
|
116
|
-
265 | data: {
|
|
117
|
-
266 | categoryId,
|
|
118
|
-
267 | title: productTitle,
|
|
119
|
-
268 | published: false,
|
|
120
|
-
269 | productContentForm: { descriptionMarkdown: markdown },
|
|
121
|
-
270 | },
|
|
122
|
-
271 | headers,
|
|
123
|
-
272 | });
|
|
124
|
-
273 | expect(productResponse.ok()).toBeTruthy();
|
|
125
|
-
274 | productId = (await productResponse.json()).data;
|
|
126
|
-
275 | expectTableIdentity(productId);
|
|
127
|
-
276 |
|
|
128
|
-
277 | await adminPage.goto(`${productListPath}/${productId}/edit`, { waitUntil: 'load' });
|
|
129
|
-
278 | await expect(adminPage.locator('html')).toHaveAttribute(
|
|
130
|
-
279 | 'data-zova-hydrated',
|
|
131
|
-
280 | 'commerceAdmin',
|
|
132
|
-
281 | );
|
|
133
|
-
282 | expect(adminPageErrors).toEqual([]);
|
|
134
|
-
283 | expect(adminConsoleErrors).toEqual([]);
|
|
135
|
-
284 | const editor = adminPage.locator('[contenteditable="true"]');
|
|
136
|
-
> 285 | await expect(editor).toBeVisible();
|
|
137
|
-
| ^ Error: expect(locator).toBeVisible() failed
|
|
138
|
-
286 | const toolbar = adminPage.getByRole('toolbar', { name: 'Markdown toolbar' });
|
|
139
|
-
287 | await expect(toolbar).toBeVisible();
|
|
140
|
-
288 | const undoButton = toolbar.getByRole('button', { name: 'Undo' });
|
|
141
|
-
289 | await expect(toolbar.getByRole('combobox', { name: 'Code block language' })).toHaveCount(0);
|
|
142
|
-
290 | const codeBlockToolbar = adminPage.getByRole('toolbar', { name: 'Code block language' });
|
|
143
|
-
291 | await expect(codeBlockToolbar).toBeHidden();
|
|
144
|
-
292 | await expect(toolbar.getByRole('button', { name: 'Bold' })).toHaveAttribute('type', 'button');
|
|
145
|
-
293 | await expect(undoButton).toBeEnabled();
|
|
146
|
-
294 | const insertTableButton = toolbar.getByRole('button', { name: 'Insert table' });
|
|
147
|
-
295 | await expect(insertTableButton).toHaveAttribute('type', 'button');
|
|
148
|
-
296 | await expect(insertTableButton).toHaveAttribute('aria-haspopup', 'grid');
|
|
149
|
-
297 | await expect(insertTableButton).toHaveAttribute('aria-expanded', 'false');
|
|
150
|
-
298 | await insertTableButton.click();
|
|
151
|
-
299 | const tablePickerDialog = adminPage.locator('#markdown-table-size-picker');
|
|
152
|
-
300 | const tablePicker = tablePickerDialog.locator('[role="grid"]');
|
|
153
|
-
301 | await expect(tablePickerDialog).toBeVisible();
|
|
154
|
-
302 | await expect(tablePicker).toHaveCount(1);
|
|
155
|
-
303 | await expect(insertTableButton).toHaveAttribute('aria-expanded', 'true');
|
|
156
|
-
304 | await expect(editor.locator('table')).toHaveCount(1);
|
|
157
|
-
305 | const tablePickerCell = tablePicker.locator('[data-table-picker-cell="2-3"]');
|
|
158
|
-
306 | await tablePickerCell.hover();
|
|
159
|
-
307 | await expect(tablePickerDialog.locator('[aria-live="polite"]')).toHaveText(
|
|
160
|
-
308 | 'Selected table size: 2 × 3',
|
|
161
|
-
309 | );
|
|
162
|
-
310 | await expect(tablePicker.locator('[aria-selected="true"]')).toHaveCount(6);
|
|
163
|
-
311 | await expect(tablePicker.locator('[aria-selected="false"]').first()).toBeVisible();
|
|
164
|
-
312 | await tablePickerCell.click();
|
|
165
|
-
313 | await expect(tablePickerDialog).toHaveCount(0);
|
|
166
|
-
314 | await expect(insertTableButton).toHaveAttribute('aria-expanded', 'false');
|
|
167
|
-
315 | await expect(editor.locator('table')).toHaveCount(2);
|
|
168
|
-
316 | await expect(editor.locator('table').last().locator('th')).toHaveCount(3);
|
|
169
|
-
317 | await expect(editor.locator('table').last().locator('td')).toHaveCount(3);
|
|
170
|
-
318 | const editorSurface = editor.locator('..');
|
|
171
|
-
319 | await editor.locator('h1').click();
|
|
172
|
-
320 | await expect(editorSurface).not.toHaveClass(/\bprose\b/);
|
|
173
|
-
321 | const editorSurfaceClass = await editorSurface.getAttribute('class');
|
|
174
|
-
322 | expect(editorSurfaceClass?.trim()).toBeTruthy();
|
|
175
|
-
323 | await expect(editor).toBeFocused();
|
|
176
|
-
324 | await expect(editor.locator('h1')).toHaveText(`Product content ${suffix}`);
|
|
177
|
-
325 | await expect(editor.locator('ul:not([data-type="taskList"])')).toHaveCount(1);
|
|
178
|
-
326 | await expect(editor.locator('blockquote')).toHaveText('Product quote');
|
|
179
|
-
327 | const codeBlock = editor.locator('pre code');
|
|
180
|
-
328 | const codeBlockLanguage = codeBlockToolbar.getByRole('combobox', {
|
|
181
|
-
329 | name: 'Code block language',
|
|
182
|
-
330 | });
|
|
183
|
-
331 | await expect(codeBlockToolbar).toBeHidden();
|
|
184
|
-
332 | await expect(codeBlock).toHaveClass(/\blanguage-ts\b/);
|
|
185
|
-
333 | await expect(codeBlock).toHaveText(`const product = '${suffix}';`);
|
|
186
|
-
334 | await expect(codeBlock.locator('span[class*="hljs-"]')).not.toHaveCount(0);
|
|
187
|
-
335 | await codeBlock.click();
|
|
188
|
-
336 | await expect(codeBlockToolbar).toBeVisible();
|
|
189
|
-
337 | await expect(codeBlockLanguage).toBeEnabled();
|
|
190
|
-
338 | await expect(codeBlockLanguage).toHaveValue('typescript');
|
|
191
|
-
339 | await codeBlockLanguage.selectOption('python');
|
|
192
|
-
340 | await expect(codeBlock).toHaveClass(/\blanguage-python\b/);
|
|
193
|
-
341 | await expect(codeBlock.locator('span[class*="hljs-"]')).not.toHaveCount(0);
|
|
194
|
-
342 | await editor.locator('h1').click();
|
|
195
|
-
343 | await expect(codeBlockToolbar).toBeHidden();
|
|
196
|
-
344 | await expect(editor.locator('mark')).toHaveText('highlighted text');
|
|
197
|
-
345 | await expect(editor.locator('table th')).toHaveCount(5);
|
|
198
|
-
346 | await expect(editor.locator('table td')).toHaveCount(5);
|
|
199
|
-
347 | await expect(editor.locator('h1')).toHaveCSS('font-weight', '700');
|
|
200
|
-
348 | await expect(editor.locator('ul:not([data-type="taskList"])')).toHaveCSS(
|
|
201
|
-
349 | 'list-style-type',
|
|
202
|
-
350 | 'disc',
|
|
203
|
-
351 | );
|
|
204
|
-
352 | await expect(editor.locator('ul[data-type="taskList"]')).toHaveCount(1);
|
|
205
|
-
353 | await expect(editor.locator('input[type="checkbox"]')).toHaveCount(2);
|
|
206
|
-
354 | await expect(editor.locator('input[type="checkbox"]').nth(0)).not.toBeChecked();
|
|
207
|
-
355 | await expect(editor.locator('input[type="checkbox"]').nth(1)).toBeChecked();
|
|
208
|
-
356 | await expect(editor.locator('blockquote')).toHaveCSS('border-left-width', '4px');
|
|
209
|
-
357 | await expect(editor.locator('pre')).toHaveCSS('overflow-x', 'auto');
|
|
210
|
-
358 | await expect(editor.locator('table th').first()).toHaveCSS('font-weight', '600');
|
|
211
|
-
359 | await editor.locator('h1').selectText();
|
|
212
|
-
360 | const boldButton = toolbar.getByRole('button', { name: 'Bold' });
|
|
213
|
-
361 | await boldButton.click();
|
|
214
|
-
362 | await expect(boldButton).toHaveAttribute('aria-pressed', 'true');
|
|
215
|
-
363 | await undoButton.click();
|
|
216
|
-
364 | await expect(boldButton).toHaveAttribute('aria-pressed', 'false');
|
|
217
|
-
365 | await expect(toolbar.getByRole('button', { name: 'Redo' })).toBeEnabled();
|
|
218
|
-
366 |
|
|
219
|
-
367 | const tableToolbar = adminPage.getByRole('toolbar', { name: 'Table toolbar' });
|
|
220
|
-
368 | const insertedTable = editor.locator('table').last();
|
|
221
|
-
369 | await editor.locator('h1').click();
|
|
222
|
-
370 | await expect(tableToolbar).toBeHidden();
|
|
223
|
-
371 | await insertedTable.locator('td').first().click();
|
|
224
|
-
372 | expect(adminPageErrors).toEqual([]);
|
|
225
|
-
373 | expect(adminConsoleErrors).toEqual([]);
|
|
226
|
-
374 | await expect(tableToolbar).toBeVisible();
|
|
227
|
-
375 | expect(adminPageErrors).toEqual([]);
|
|
228
|
-
376 | expect(adminConsoleErrors).toEqual([]);
|
|
229
|
-
377 | await expect(tableToolbar.getByRole('button', { name: 'Add row before' })).toHaveAttribute(
|
|
230
|
-
378 | 'type',
|
|
231
|
-
379 | 'button',
|
|
232
|
-
380 | );
|
|
233
|
-
381 | await tableToolbar.getByRole('button', { name: 'Add row before' }).click();
|
|
234
|
-
382 | await expect(insertedTable.locator('td')).toHaveCount(6);
|
|
235
|
-
383 | expect(adminPageErrors).toEqual([]);
|
|
236
|
-
384 | await tableToolbar.getByRole('button', { name: 'Delete row' }).click();
|
|
237
|
-
385 | await expect(insertedTable.locator('td')).toHaveCount(3);
|
|
238
|
-
```
|