@open-mercato/checkout 0.6.5-develop.4863.1.169bfbb3a3 → 0.6.5-develop.4882.1.901c3aa813
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/dist/modules/checkout/__integration__/TC-CHKT-040-gateway-settings-select.spec.js +17 -5
- package/dist/modules/checkout/__integration__/TC-CHKT-040-gateway-settings-select.spec.js.map +2 -2
- package/package.json +5 -5
- package/src/modules/checkout/__integration__/TC-CHKT-040-gateway-settings-select.spec.ts +21 -6
|
@@ -7,9 +7,23 @@ import {
|
|
|
7
7
|
deleteCheckoutEntityIfExists,
|
|
8
8
|
readTemplate
|
|
9
9
|
} from "./helpers/fixtures.js";
|
|
10
|
+
async function waitForCaptureMethodSelect(page) {
|
|
11
|
+
const captureMethodField = page.getByText("Capture method").locator('xpath=ancestor::div[contains(@class, "space-y-2")]').first();
|
|
12
|
+
const captureMethodSelect = captureMethodField.getByRole("combobox").first();
|
|
13
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
14
|
+
if (await captureMethodSelect.isVisible({ timeout: 2e4 }).catch(() => false)) {
|
|
15
|
+
return captureMethodSelect;
|
|
16
|
+
}
|
|
17
|
+
if (attempt < 2) {
|
|
18
|
+
await page.reload({ waitUntil: "domcontentloaded" });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
await expect(page.locator("main").getByText(/Edit Template|Capture method/).first()).toBeVisible({ timeout: 5e3 });
|
|
22
|
+
return captureMethodSelect;
|
|
23
|
+
}
|
|
10
24
|
test.describe("TC-CHKT-040: Gateway setting selects round-trip through template edit UI", () => {
|
|
11
25
|
test("prefills and saves the checkout capture method", async ({ page, request }) => {
|
|
12
|
-
test.
|
|
26
|
+
test.setTimeout(12e4);
|
|
13
27
|
let token = null;
|
|
14
28
|
let templateId = null;
|
|
15
29
|
try {
|
|
@@ -20,10 +34,8 @@ test.describe("TC-CHKT-040: Gateway setting selects round-trip through template
|
|
|
20
34
|
status: "draft"
|
|
21
35
|
}));
|
|
22
36
|
await login(page, "admin");
|
|
23
|
-
await page.goto(`/backend/checkout/templates/${encodeURIComponent(templateId)}`, { waitUntil: "
|
|
24
|
-
await
|
|
25
|
-
const captureMethodField = page.getByText("Capture method").locator('xpath=ancestor::div[contains(@class, "space-y-2")]').first();
|
|
26
|
-
const captureMethodSelect = captureMethodField.getByRole("combobox").first();
|
|
37
|
+
await page.goto(`/backend/checkout/templates/${encodeURIComponent(templateId)}`, { waitUntil: "domcontentloaded" });
|
|
38
|
+
const captureMethodSelect = await waitForCaptureMethodSelect(page);
|
|
27
39
|
await expect(captureMethodSelect).toBeVisible();
|
|
28
40
|
await expect(captureMethodSelect).toContainText("Manual capture");
|
|
29
41
|
await captureMethodSelect.click();
|
package/dist/modules/checkout/__integration__/TC-CHKT-040-gateway-settings-select.spec.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/checkout/__integration__/TC-CHKT-040-gateway-settings-select.spec.ts"],
|
|
4
|
-
"sourcesContent": ["import { expect, test } from '@playwright/test'\nimport { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'\nimport { login } from '@open-mercato/core/helpers/integration/auth'\nimport {\n createFixedTemplateInput,\n createTemplateFixture,\n deleteCheckoutEntityIfExists,\n readTemplate,\n} from './helpers/fixtures'\n\ntest.describe('TC-CHKT-040: Gateway setting selects round-trip through template edit UI', () => {\n test('prefills and saves the checkout capture method', async ({ page, request }) => {\n test.
|
|
5
|
-
"mappings": "AAAA,SAAS,QAAQ,
|
|
4
|
+
"sourcesContent": ["import { expect, test, type Locator, type Page } from '@playwright/test'\nimport { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'\nimport { login } from '@open-mercato/core/helpers/integration/auth'\nimport {\n createFixedTemplateInput,\n createTemplateFixture,\n deleteCheckoutEntityIfExists,\n readTemplate,\n} from './helpers/fixtures'\n\nasync function waitForCaptureMethodSelect(page: Page): Promise<Locator> {\n const captureMethodField = page.getByText('Capture method').locator('xpath=ancestor::div[contains(@class, \"space-y-2\")]').first()\n const captureMethodSelect = captureMethodField.getByRole('combobox').first()\n\n for (let attempt = 0; attempt < 3; attempt += 1) {\n if (await captureMethodSelect.isVisible({ timeout: 20_000 }).catch(() => false)) {\n return captureMethodSelect\n }\n if (attempt < 2) {\n await page.reload({ waitUntil: 'domcontentloaded' })\n }\n }\n\n await expect(page.locator('main').getByText(/Edit Template|Capture method/).first()).toBeVisible({ timeout: 5_000 })\n return captureMethodSelect\n}\n\ntest.describe('TC-CHKT-040: Gateway setting selects round-trip through template edit UI', () => {\n test('prefills and saves the checkout capture method', async ({ page, request }) => {\n test.setTimeout(120_000)\n let token: string | null = null\n let templateId: string | null = null\n\n try {\n token = await getAuthToken(request)\n templateId = await createTemplateFixture(request, token, createFixedTemplateInput({\n gatewayProviderKey: 'mock_processing',\n gatewaySettings: { captureMethod: 'manual' },\n status: 'draft',\n }))\n\n await login(page, 'admin')\n await page.goto(`/backend/checkout/templates/${encodeURIComponent(templateId)}`, { waitUntil: 'domcontentloaded' })\n\n const captureMethodSelect = await waitForCaptureMethodSelect(page)\n await expect(captureMethodSelect).toBeVisible()\n await expect(captureMethodSelect).toContainText('Manual capture')\n\n await captureMethodSelect.click()\n await page.getByRole('option', { name: 'Automatic capture' }).click()\n await page.locator('form').getByRole('button', { name: 'Save' }).click()\n await expect(page).toHaveURL(/\\/backend\\/checkout\\/templates(?:\\?.*)?$/)\n\n const saved = await readTemplate(request, token, templateId)\n expect((saved.gatewaySettings as Record<string, unknown> | undefined)?.captureMethod).toBe('automatic')\n } finally {\n await deleteCheckoutEntityIfExists(request, token, 'templates', templateId)\n }\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,QAAQ,YAAqC;AACtD,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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pE,YAAM,KAAK,QAAQ,MAAM,EAAE,UAAU,UAAU,EAAE,MAAM,OAAO,CAAC,EAAE,MAAM;AACvE,YAAM,OAAO,IAAI,EAAE,UAAU,0CAA0C;AAEvE,YAAM,QAAQ,MAAM,aAAa,SAAS,OAAO,UAAU;AAC3D,aAAQ,MAAM,iBAAyD,aAAa,EAAE,KAAK,WAAW;AAAA,IACxG,UAAE;AACA,YAAM,6BAA6B,SAAS,OAAO,aAAa,UAAU;AAAA,IAC5E;AAAA,EACF,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/checkout",
|
|
3
|
-
"version": "0.6.5-develop.
|
|
3
|
+
"version": "0.6.5-develop.4882.1.901c3aa813",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@open-mercato/core": "0.6.5-develop.
|
|
65
|
-
"@open-mercato/ui": "0.6.5-develop.
|
|
64
|
+
"@open-mercato/core": "0.6.5-develop.4882.1.901c3aa813",
|
|
65
|
+
"@open-mercato/ui": "0.6.5-develop.4882.1.901c3aa813",
|
|
66
66
|
"bcryptjs": "^3.0.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@mikro-orm/postgresql": "^7.0.14",
|
|
70
|
-
"@open-mercato/shared": "0.6.5-develop.
|
|
70
|
+
"@open-mercato/shared": "0.6.5-develop.4882.1.901c3aa813",
|
|
71
71
|
"react": "^19.0.0",
|
|
72
72
|
"react-dom": "^19.0.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@open-mercato/shared": "0.6.5-develop.
|
|
75
|
+
"@open-mercato/shared": "0.6.5-develop.4882.1.901c3aa813",
|
|
76
76
|
"@types/jest": "^30.0.0",
|
|
77
77
|
"@types/react": "^19.2.16",
|
|
78
78
|
"@types/react-dom": "^19.2.3",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { expect, test } from '@playwright/test'
|
|
1
|
+
import { expect, test, type Locator, type Page } from '@playwright/test'
|
|
2
2
|
import { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'
|
|
3
3
|
import { login } from '@open-mercato/core/helpers/integration/auth'
|
|
4
4
|
import {
|
|
@@ -8,9 +8,26 @@ import {
|
|
|
8
8
|
readTemplate,
|
|
9
9
|
} from './helpers/fixtures'
|
|
10
10
|
|
|
11
|
+
async function waitForCaptureMethodSelect(page: Page): Promise<Locator> {
|
|
12
|
+
const captureMethodField = page.getByText('Capture method').locator('xpath=ancestor::div[contains(@class, "space-y-2")]').first()
|
|
13
|
+
const captureMethodSelect = captureMethodField.getByRole('combobox').first()
|
|
14
|
+
|
|
15
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
16
|
+
if (await captureMethodSelect.isVisible({ timeout: 20_000 }).catch(() => false)) {
|
|
17
|
+
return captureMethodSelect
|
|
18
|
+
}
|
|
19
|
+
if (attempt < 2) {
|
|
20
|
+
await page.reload({ waitUntil: 'domcontentloaded' })
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
await expect(page.locator('main').getByText(/Edit Template|Capture method/).first()).toBeVisible({ timeout: 5_000 })
|
|
25
|
+
return captureMethodSelect
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
test.describe('TC-CHKT-040: Gateway setting selects round-trip through template edit UI', () => {
|
|
12
29
|
test('prefills and saves the checkout capture method', async ({ page, request }) => {
|
|
13
|
-
test.
|
|
30
|
+
test.setTimeout(120_000)
|
|
14
31
|
let token: string | null = null
|
|
15
32
|
let templateId: string | null = null
|
|
16
33
|
|
|
@@ -23,11 +40,9 @@ test.describe('TC-CHKT-040: Gateway setting selects round-trip through template
|
|
|
23
40
|
}))
|
|
24
41
|
|
|
25
42
|
await login(page, 'admin')
|
|
26
|
-
await page.goto(`/backend/checkout/templates/${encodeURIComponent(templateId)}`, { waitUntil: '
|
|
43
|
+
await page.goto(`/backend/checkout/templates/${encodeURIComponent(templateId)}`, { waitUntil: 'domcontentloaded' })
|
|
27
44
|
|
|
28
|
-
await
|
|
29
|
-
const captureMethodField = page.getByText('Capture method').locator('xpath=ancestor::div[contains(@class, "space-y-2")]').first()
|
|
30
|
-
const captureMethodSelect = captureMethodField.getByRole('combobox').first()
|
|
45
|
+
const captureMethodSelect = await waitForCaptureMethodSelect(page)
|
|
31
46
|
await expect(captureMethodSelect).toBeVisible()
|
|
32
47
|
await expect(captureMethodSelect).toContainText('Manual capture')
|
|
33
48
|
|