@12-apps/payments-e2e 2.2.0 → 2.3.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/dist/helpers/checkout.d.ts +9 -0
- package/dist/helpers/checkout.d.ts.map +1 -1
- package/dist/helpers/checkout.js +12 -1
- package/dist/helpers/checkout.js.map +1 -1
- package/dist/steps/saved-card-wallet.steps.js +13 -4
- package/dist/steps/saved-card-wallet.steps.js.map +1 -1
- package/package.json +3 -3
|
@@ -19,6 +19,15 @@ export declare const VALID_CPF = "529.982.247-25";
|
|
|
19
19
|
export declare const GOOD_PAN = "4111 1111 1111 1111";
|
|
20
20
|
/** The sandbox PAN that always declines, honoured by the shipped tokenizer. */
|
|
21
21
|
export declare const DECLINE_PAN = "4000 0000 0000 0002";
|
|
22
|
+
/**
|
|
23
|
+
* How a saved-card list restates {@link CARD_EXPIRY_TYPED}: the same date,
|
|
24
|
+
* with the year in full.
|
|
25
|
+
*
|
|
26
|
+
* Exported so a step can assert the DIGITS a screen shows without asserting
|
|
27
|
+
* the host's word for them (FUT-760) — "Validade", "Vence em" and "Expires"
|
|
28
|
+
* are all the same fact, and only one of them is any given host's.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CARD_EXPIRY_SHOWN = "12/2031";
|
|
22
31
|
/** Fill the Dados step's CPF. */
|
|
23
32
|
export declare function fillCpf(page: Page, cpf?: string): Promise<void>;
|
|
24
33
|
/** Fill the card form the store's chain gave the buyer. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/helpers/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAE1C,6EAA6E;AAC7E,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAE9C,+EAA+E;AAC/E,eAAO,MAAM,WAAW,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/helpers/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAE1C,6EAA6E;AAC7E,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAE9C,+EAA+E;AAC/E,eAAO,MAAM,WAAW,wBAAwB,CAAC;AAKjD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,iCAAiC;AACjC,wBAAsB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhF;AAED,2DAA2D;AAC3D,wBAAsB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,MAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhF;AAED,6EAA6E;AAC7E,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1D;AAED,uEAAuE;AACvE,wBAAsB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD;AAED,iDAAiD;AACjD,wBAAsB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5D"}
|
package/dist/helpers/checkout.js
CHANGED
|
@@ -19,6 +19,17 @@ export const VALID_CPF = '529.982.247-25';
|
|
|
19
19
|
export const GOOD_PAN = '4111 1111 1111 1111';
|
|
20
20
|
/** The sandbox PAN that always declines, honoured by the shipped tokenizer. */
|
|
21
21
|
export const DECLINE_PAN = '4000 0000 0000 0002';
|
|
22
|
+
/** The expiry {@link fillCard} types — two-digit, as a card is embossed. */
|
|
23
|
+
const CARD_EXPIRY_TYPED = '12/31';
|
|
24
|
+
/**
|
|
25
|
+
* How a saved-card list restates {@link CARD_EXPIRY_TYPED}: the same date,
|
|
26
|
+
* with the year in full.
|
|
27
|
+
*
|
|
28
|
+
* Exported so a step can assert the DIGITS a screen shows without asserting
|
|
29
|
+
* the host's word for them (FUT-760) — "Validade", "Vence em" and "Expires"
|
|
30
|
+
* are all the same fact, and only one of them is any given host's.
|
|
31
|
+
*/
|
|
32
|
+
export const CARD_EXPIRY_SHOWN = '12/2031';
|
|
22
33
|
/** Fill the Dados step's CPF. */
|
|
23
34
|
export async function fillCpf(page, cpf = VALID_CPF) {
|
|
24
35
|
await page.getByTestId('buyer-cpf').fill(cpf);
|
|
@@ -27,7 +38,7 @@ export async function fillCpf(page, cpf = VALID_CPF) {
|
|
|
27
38
|
export async function fillCard(page, pan = GOOD_PAN) {
|
|
28
39
|
await page.getByTestId('card-number').fill(pan);
|
|
29
40
|
await page.getByTestId('card-holder').fill('ANA COMPRADORA');
|
|
30
|
-
await page.getByTestId('card-expiry').fill(
|
|
41
|
+
await page.getByTestId('card-expiry').fill(CARD_EXPIRY_TYPED);
|
|
31
42
|
await page.getByTestId('card-cvv').fill('123');
|
|
32
43
|
}
|
|
33
44
|
/** Pick the card tile on a store that offers both, and wait for the form. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/helpers/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAE9C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAEjD,iCAAiC;AACjC,MAAM,CAAC,KAAK,UAA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W,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC7D,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9D,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAU;IACzC,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,KAAK,EAAE,CAAC;IACvD,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC5D,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAU;IACtC,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAU;IAC3C,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from '@playwright/test';
|
|
2
|
-
import { DECLINE_PAN, fillCard } from '../helpers/checkout.js';
|
|
2
|
+
import { CARD_EXPIRY_SHOWN, DECLINE_PAN, fillCard } from '../helpers/checkout.js';
|
|
3
3
|
import { paymentsWorld } from '../world.js';
|
|
4
4
|
import { Given, Then, When } from './fixtures.js';
|
|
5
5
|
/**
|
|
@@ -41,10 +41,19 @@ Then('the card is stored and appears in the list', async ({ page }) => {
|
|
|
41
41
|
Then('the list shows only the brand and the last digits', async ({ page }) => {
|
|
42
42
|
// Display metadata ONLY. The vault token — the thing that can charge —
|
|
43
43
|
// never reaches this screen; what she reads back is brand + last4 + expiry.
|
|
44
|
-
//
|
|
44
|
+
//
|
|
45
|
+
// Asserted as DIGITS, not as sentences (FUT-760). The expiry line used to be
|
|
46
|
+
// matched on the word "Validade", which was the package's own hard-coded
|
|
47
|
+
// label — so the assertion held only for a host that had inherited it, and
|
|
48
|
+
// said nothing at all about the host under test. "Validade", "Vence em" and
|
|
49
|
+
// "Expires" are one fact worded three ways; the numbers beside them are the
|
|
50
|
+
// fact, and the mask is what proves the PAN is not on screen.
|
|
45
51
|
const list = page.getByTestId('manage-cards-list');
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
// A mask and exactly four digits after it — the shape, not which four: the
|
|
53
|
+
// last4 is whatever the store's vault answered, and pinning it here would
|
|
54
|
+
// make this journey a test of one host's stub.
|
|
55
|
+
await expect(list).toContainText(/•••• {0,1}\d{4}/);
|
|
56
|
+
await expect(list).toContainText(CARD_EXPIRY_SHOWN);
|
|
48
57
|
});
|
|
49
58
|
Then('the refusal explains why and the form stays on screen', async ({ page }) => {
|
|
50
59
|
// The endpoint's own reason, and the form kept editable under it — wiping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-card-wallet.steps.js","sourceRoot":"","sources":["../../src/steps/saved-card-wallet.steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"saved-card-wallet.steps.js","sourceRoot":"","sources":["../../src/steps/saved-card-wallet.steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBA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AAE;IACxD,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,gDAAgD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACxE,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACnE,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/payments-e2e",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The payments buyer journeys, as Gherkin a host runs against its own app",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"playwright-bdd": ">=8.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@12-apps/eslint-config": "^1.21.
|
|
37
|
-
"@12-apps/typescript-config": "^1.20.
|
|
36
|
+
"@12-apps/eslint-config": "^1.21.1",
|
|
37
|
+
"@12-apps/typescript-config": "^1.20.1",
|
|
38
38
|
"@playwright/test": "^1.56.1",
|
|
39
39
|
"playwright-bdd": "^8.4.1",
|
|
40
40
|
"typescript": "5.9.2"
|