@rebilly/framepay-react 13.64.0 → 13.66.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [13.64.0](https://github.com/Rebilly/rebilly/compare/framepay-react-v13.63.0...framepay-react-v13.64.0) (2026-02-26)
1
+ ## [13.66.0](https://github.com/Rebilly/rebilly/compare/framepay-react-v13.65.0...framepay-react-v13.66.0) (2026-03-02)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#19177](https://github.com/Rebilly/rebilly/issues/19177)) ([1641ed9](https://github.com/Rebilly/rebilly/commit/1641ed91e176672c9a078e13744a97c814ebd4d5))
6
+ * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#19229](https://github.com/Rebilly/rebilly/issues/19229)) ([4ceca33](https://github.com/Rebilly/rebilly/commit/4ceca33151c9b46453e4efcb8423e0ef2ee8d6de))
package/README.md CHANGED
@@ -334,4 +334,4 @@ Unit tests can be run using the `test:unit` command.
334
334
  - Run one of the following commands:
335
335
  - `test:e2e:pr` - runs a smaller subset of E2E tests tests headlessly.
336
336
  - `test:e2e:post-merge` - runs the complete set of E2E tests tests headlessly.
337
- - `test:e2e:open` - opens the cypress GUI, allowing you to interact with each test visually.
337
+ - `test:e2e:open` - opens the PlayWright GUI, allowing you to interact with each test visually.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-react",
3
- "version": "13.64.0",
3
+ "version": "13.66.0",
4
4
  "description": "A React wrapper for Rebilly's FramePay offering out-of-the-box support for Redux and other common React features",
5
5
  "main": "build/index.js",
6
6
  "author": "Rebilly",
@@ -46,7 +46,7 @@
46
46
  "serve:e2e": "run-s dotenv build:* && node test/e2e/local-server.mjs",
47
47
  "serve:e2e:no-build": "node test/e2e/local-server.mjs",
48
48
  "test:unit": "jest --config ./test/unit/jest.config.js",
49
- "test:e2e:base": "START_SERVER_AND_TEST_INSECURE=1 start-server-and-test 'pnpm serve:e2e:no-build' https-get://localhost:8000 'pnpm test:e2e:run'",
49
+ "test:e2e:base": "pnpm test:e2e:run",
50
50
  "test:e2e:react-14": "cross-env REACT_VERSION=0.14.0 run-s set-react-14 dotenv build:e2e test:e2e:base clean-react-alias",
51
51
  "test:e2e:react-15": "cross-env REACT_VERSION=15.0.0 run-s set-react-15 dotenv build:e2e clean-react-alias test:e2e:base",
52
52
  "test:e2e:react-16": "cross-env REACT_VERSION=16 run-s set-react-16 dotenv build:e2e clean-react-alias test:e2e:base",
@@ -55,8 +55,8 @@
55
55
  "test:e2e:react-19": "cross-env REACT_VERSION=19 run-s set-react-19 dotenv build:e2e clean-react-alias test:e2e:base",
56
56
  "test:e2e:pr": "npm run test:e2e:react-19",
57
57
  "test:e2e:post-merge": "run-s test:e2e:react-*",
58
- "test:e2e:open": "cypress open",
59
- "test:e2e:run": "cypress run",
58
+ "test:e2e:open": "playwright test --ui",
59
+ "test:e2e:run": "playwright test --reporter=list",
60
60
  "watch": "run-s build && run-p \"build -- --w\"",
61
61
  "clean:e2e": "rm -rf test/e2e/build"
62
62
  },
@@ -70,18 +70,16 @@
70
70
  "prop-types": "^15.8.1"
71
71
  },
72
72
  "devDependencies": {
73
+ "@playwright/test": "^1.57.0",
73
74
  "@fluffy-spoon/substitute": "^1.89.0",
74
75
  "@rebilly/eslint-config": "*",
75
76
  "@small-tech/auto-encrypt-localhost": "^8.4.0",
76
- "@testing-library/cypress": "^10.1.0",
77
77
  "@testing-library/react": "^15.0.7",
78
78
  "@types/jest": "^29.5.1",
79
79
  "@types/node": "^22.15.30",
80
80
  "@types/react": "^19.2.7",
81
81
  "core-js": "^3.42.0",
82
82
  "cross-env": "^10.1.0",
83
- "cypress": "^15.8.2",
84
- "cypress-iframe": "^1.0.1",
85
83
  "dotenv": "^16.5.0",
86
84
  "eslint-plugin-react": "^7.37.5",
87
85
  "express": "^5.1.0",
@@ -96,7 +94,6 @@
96
94
  "react-dom": "^19.2.1",
97
95
  "react-dom-19": "npm:react-dom@^19.2.1",
98
96
  "scheduler": "^0.26.0",
99
- "start-server-and-test": "^2.0.11",
100
97
  "ts-jest": "^29.3.2",
101
98
  "typescript": "^5.8.3",
102
99
  "warning": "^4.0.3"
@@ -0,0 +1,29 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('bank-separate', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/bank-separate');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Bank Page Separate Fields');
10
+ });
11
+
12
+ test('should inject the bank iframes into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#bbanAccountType')).toBeVisible();
14
+ await expect(page.locator('iframe#bbanAccountNumber')).toBeVisible();
15
+ await expect(page.locator('iframe#bbanRoutingNumber')).toBeVisible();
16
+ });
17
+
18
+ test('should call the on-ready BankAccountType element hook', async ({ page }) => {
19
+ await expect(page.locator('#events-bankAccountType-onReady-true')).toBeAttached();
20
+ });
21
+
22
+ test('should call the on-ready BankAccountNumber element hook', async ({ page }) => {
23
+ await expect(page.locator('#events-bankAccountNumber-onReady-true')).toBeAttached();
24
+ });
25
+
26
+ test('should call the on-ready BankRoutingNumber element hook', async ({ page }) => {
27
+ await expect(page.locator('#events-bankRoutingNumber-onReady-true')).toBeAttached();
28
+ });
29
+ });
@@ -0,0 +1,68 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('card-separate-brands', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/card-separate-brands');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Card Page Separate Fields allowed Brands');
10
+ });
11
+
12
+ test('should inject the card iframes into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#cardNumber')).toBeVisible();
14
+ await expect(page.locator('iframe#cardCvv')).toBeVisible();
15
+ await expect(page.locator('iframe#cardExpiration')).toBeVisible();
16
+ });
17
+
18
+ test('should be call the on-ready card element hook', async ({ page }) => {
19
+ await expect(page.locator('#events-number-onReady-true')).toBeAttached();
20
+ });
21
+
22
+ test('should be call the on-ready cvv element hook', async ({ page }) => {
23
+ await expect(page.locator('#events-cvv-onReady-true')).toBeAttached();
24
+ });
25
+
26
+ test('should be call the on-ready expiry element hook', async ({ page }) => {
27
+ await expect(page.locator('#events-expiry-onReady-true')).toBeAttached();
28
+ });
29
+
30
+ test('should decline the MasterCard by default', async ({ page }) => {
31
+ await expect(page.locator('#events-number-onReady-true')).toBeAttached();
32
+
33
+ await page.frameLocator('iframe#cardNumber')
34
+ .getByTestId('cardnumber')
35
+ .fill('4111 1111 1111 1111');
36
+
37
+ await expect(page.locator('#events-number-onChange-error-code-unavailable-card-brand')).toBeAttached();
38
+ });
39
+
40
+ test('should allow the Visa after update and decline after restore', async ({ page }) => {
41
+ await page.frameLocator('iframe#cardNumber')
42
+ .getByTestId('cardnumber')
43
+ .fill('4111 1111 1111 1111');
44
+
45
+ await page.frameLocator('iframe#cardCvv')
46
+ .getByTestId('cvv')
47
+ .fill('123');
48
+
49
+ const now = new Date();
50
+ const month = String('0' + (now.getMonth() + 1)).slice(-2);
51
+ const year = String(now.getFullYear()).slice(-2);
52
+ const expiry = month + year;
53
+ await page.frameLocator('iframe#cardExpiration')
54
+ .getByTestId('exp-date')
55
+ .fill(expiry);
56
+
57
+ const errorIndicator = page.locator('#events-number-onChange-error-code-unavailable-card-brand');
58
+ await expect(errorIndicator).toBeAttached();
59
+
60
+ await page.locator('#btn-update').click();
61
+
62
+ await expect(errorIndicator).not.toBeAttached();
63
+
64
+ await page.locator('#btn-restore').click();
65
+
66
+ await expect(errorIndicator).toBeAttached();
67
+ });
68
+ });
@@ -0,0 +1,29 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('card-separate', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/card-separate');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Card Page Separate Fields');
10
+ });
11
+
12
+ test('should inject the card iframes into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#cardNumber')).toBeVisible();
14
+ await expect(page.locator('iframe#cardCvv')).toBeVisible();
15
+ await expect(page.locator('iframe#cardExpiration')).toBeVisible();
16
+ });
17
+
18
+ test('should be call the on-ready card element hook', async ({ page }) => {
19
+ await expect(page.locator('#events-number-onReady-true')).toBeAttached();
20
+ });
21
+
22
+ test('should be call the on-ready cvv element hook', async ({ page }) => {
23
+ await expect(page.locator('#events-cvv-onReady-true')).toBeAttached();
24
+ });
25
+
26
+ test('should be call the on-ready expiry element hook', async ({ page }) => {
27
+ await expect(page.locator('#events-expiry-onReady-true')).toBeAttached();
28
+ });
29
+ });
@@ -0,0 +1,26 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('checkout-combined', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/checkout-combined');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Checkout Page Combined Field');
10
+ });
11
+
12
+ test('should inject the card iframe into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#card')).toBeVisible();
14
+ });
15
+
16
+ test('should be call the on-ready hook', async ({ page }) => {
17
+ await expect(page.locator('#events-onReady-true')).toBeAttached();
18
+ });
19
+
20
+ test('should call the on-change hook', async ({ page }) => {
21
+ await expect(page.locator('#events-onReady-true')).toBeAttached();
22
+ await page.locator('#submit').click();
23
+ await expect(page.locator('#key-onChange')).toBeVisible();
24
+ await expect(page.locator('#token-data-code-invalid-payment-card')).toBeAttached();
25
+ });
26
+ });
@@ -0,0 +1,15 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('google-pay', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/google-pay');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Google Pay');
10
+ });
11
+
12
+ test('should inject the Google pay iframe into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#googlePay')).toBeVisible();
14
+ });
15
+ });
@@ -0,0 +1,19 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('iban', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/iban');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test IBAN Field');
10
+ });
11
+
12
+ test('should inject the card iframe into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#iban')).toBeVisible();
14
+ });
15
+
16
+ test('should call the on-ready iban element hook', async ({ page }) => {
17
+ await expect(page.locator('#events-iban-onReady-true')).toBeAttached();
18
+ });
19
+ });
@@ -0,0 +1,46 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('inject-riskMetadata', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/inject-metadata');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Inject Metadata');
10
+ });
11
+
12
+ test('should inject the card iframe into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe#card')).toBeVisible();
14
+ });
15
+
16
+ test('should be call the on-ready hook', async ({ page }) => {
17
+ await expect(page.locator('#events-onReady-true')).toBeAttached();
18
+ });
19
+
20
+ test('should call the on-change hook', async ({ page }) => {
21
+ await expect(page.locator('#events-onReady-true')).toBeAttached();
22
+ await page.locator('#submit').click();
23
+ await expect(page.locator('#key-onChange')).toBeVisible();
24
+ await expect(page.locator('#token-data-code-invalid-payment-card')).toBeAttached();
25
+ });
26
+
27
+ test('should show provided data in token', async ({ page }) => {
28
+ await expect(page.locator('#events-onReady-true')).toBeAttached();
29
+
30
+ const now = new Date();
31
+ const month = String('0' + (now.getMonth() + 1)).slice(-2);
32
+ const year = String(now.getFullYear()).slice(-2);
33
+ const expiry = month + year;
34
+ const cardNumber = '4111111111111111';
35
+ const cvv = '123';
36
+
37
+ const cardFrame = page.frameLocator('iframe#card');
38
+ await cardFrame.getByTestId('cardnumber').fill(cardNumber);
39
+ await cardFrame.getByTestId('exp-date').fill(expiry);
40
+ await cardFrame.getByTestId('cvv').fill(cvv);
41
+
42
+ await page.locator('#submit').click();
43
+
44
+ await expect(page.locator('#token-data-fingerprint')).toHaveText('fingerprint123');
45
+ });
46
+ });
@@ -0,0 +1,130 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('multiple-methods', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/multiple-methods');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Multiple Methods');
10
+ });
11
+
12
+ test('should call the on-ready card element hook', async ({ page }) => {
13
+ await expect(page.locator('#events-card-onReady-true')).toBeAttached();
14
+ });
15
+
16
+ test('should init with payment-card method by default', async ({ page }) => {
17
+ await expect(page.locator('#events-card-onReady-true')).toBeAttached();
18
+ await expect(page.locator('#events-bankAccountType-onReady-false')).toBeAttached();
19
+ await expect(page.locator('#events-bankAccountNumber-onReady-false')).toBeAttached();
20
+ await expect(page.locator('#events-bankRoutingNumber-onReady-false')).toBeAttached();
21
+ await expect(page.locator('#events-iban-onReady-false')).toBeAttached();
22
+ });
23
+
24
+ test('should load other methods', async ({ page }) => {
25
+ await expect(page.locator('#events-card-onReady-true')).toBeAttached();
26
+
27
+ await page.locator('#set-active-element-bank').click();
28
+
29
+ // check other methods are disabled
30
+ await expect(page.locator('#events-card-onReady-false')).toBeAttached();
31
+ await expect(page.locator('#events-iban-onReady-false')).toBeAttached();
32
+
33
+ // check bank is loaded
34
+ await expect(page.locator('#events-bankAccountNumber-onReady-true')).toBeAttached();
35
+ await expect(page.locator('#events-bankAccountType-onReady-true')).toBeAttached();
36
+ await expect(page.locator('#events-bankRoutingNumber-onReady-true')).toBeAttached();
37
+
38
+ // load IBAN
39
+ await page.locator('#set-active-element-iban').click();
40
+
41
+ // check other methods are disabled
42
+ await expect(page.locator('#events-card-onReady-false')).toBeAttached();
43
+ await expect(page.locator('#events-bankAccountType-onReady-false')).toBeAttached();
44
+ await expect(page.locator('#events-bankAccountNumber-onReady-false')).toBeAttached();
45
+ await expect(page.locator('#events-bankRoutingNumber-onReady-false')).toBeAttached();
46
+
47
+ // check IBAN is loaded
48
+ await expect(page.locator('#events-iban-onReady-true')).toBeAttached();
49
+
50
+ // load Google Pay
51
+ await page.locator('#set-active-element-googlepay').click();
52
+
53
+ // check other methods are disabled
54
+ await expect(page.locator('#events-card-onReady-false')).toBeAttached();
55
+ await expect(page.locator('#events-bankAccountType-onReady-false')).toBeAttached();
56
+ await expect(page.locator('#events-bankAccountNumber-onReady-false')).toBeAttached();
57
+ await expect(page.locator('#events-bankRoutingNumber-onReady-false')).toBeAttached();
58
+ await expect(page.locator('#events-iban-onReady-false')).toBeAttached();
59
+
60
+ // check Google Pay is loaded
61
+ await expect(page.locator('iframe#googlePay')).toBeVisible();
62
+ });
63
+
64
+ test('should generate the card token', async ({ page }) => {
65
+ await expect(page.locator('#events-card-onReady-true')).toBeAttached();
66
+
67
+ const now = new Date();
68
+ const month = String('0' + (now.getMonth() + 1)).slice(-2);
69
+ const year = String(now.getFullYear()).slice(-2);
70
+ const expiry = month + year;
71
+
72
+ const cardFrame = page.frameLocator('iframe#card');
73
+ await cardFrame.getByTestId('cardnumber').fill('4111111111111111');
74
+ await cardFrame.getByTestId('exp-date').fill(expiry);
75
+ await cardFrame.getByTestId('cvv').fill('123');
76
+
77
+ await page.locator('#submit').click();
78
+
79
+ await expect(page.locator('#events-card-onChange-valid-true')).toBeAttached();
80
+ await expect(page.locator('#events-card-onChange-source-card')).toBeAttached();
81
+ await expect(page.locator('#token-error-false')).toBeAttached();
82
+ await expect(page.locator('#token-data-method-payment-card')).toBeAttached();
83
+ await expect(page.locator('#token-data-paymentInstrument-brand-Visa')).toBeAttached();
84
+ });
85
+
86
+ test('should generate the bank token', async ({ page }) => {
87
+ await page.locator('#set-active-element-bank').click();
88
+
89
+ await expect(page.locator('#events-bankAccountType-onReady-true')).toBeAttached();
90
+ await expect(page.locator('#events-bankAccountNumber-onReady-true')).toBeAttached();
91
+ await expect(page.locator('#events-bankRoutingNumber-onReady-true')).toBeAttached();
92
+
93
+ await page.frameLocator('iframe#bbanAccountType')
94
+ .getByTestId('savings')
95
+ .click();
96
+ await page.frameLocator('iframe#bbanAccountNumber')
97
+ .getByTestId('bbanAccountNumber')
98
+ .fill('22222222');
99
+ await page.frameLocator('iframe#bbanRoutingNumber')
100
+ .getByTestId('bbanRoutingNumber')
101
+ .fill('11111111');
102
+
103
+ await page.locator('#submit').click();
104
+
105
+ await expect(page.locator('#events-bankAccountNumber-onChange-valid-true')).toBeAttached();
106
+ await expect(page.locator('#events-bankAccountNumber-onChange-source-bankAccountNumber')).toBeAttached();
107
+ await expect(page.locator('#events-bankRoutingNumber-onChange-valid-true')).toBeAttached();
108
+ await expect(page.locator('#events-bankRoutingNumber-onChange-source-bankRoutingNumber')).toBeAttached();
109
+ await expect(page.locator('#events-bankAccountType-onChange-valid-true')).toBeAttached();
110
+ await expect(page.locator('#events-bankAccountType-onChange-source-bankAccountType')).toBeAttached();
111
+ await expect(page.locator('#token-error-false')).toBeAttached();
112
+ await expect(page.locator('#token-data-method-ach')).toBeAttached();
113
+ });
114
+
115
+ test('should generate the iban token', async ({ page }) => {
116
+ await page.locator('#set-active-element-iban').click();
117
+
118
+ await expect(page.locator('#events-iban-onReady-true')).toBeAttached();
119
+
120
+ await page.frameLocator('iframe#iban')
121
+ .getByTestId('iban')
122
+ .fill('DE89 3704 0044 0532 0130 00');
123
+
124
+ await page.locator('#submit').click();
125
+
126
+ await expect(page.locator('#events-iban-onChange-valid-true')).toBeAttached();
127
+ await expect(page.locator('#token-error-false')).toBeAttached();
128
+ await expect(page.locator('#token-data-method-ach')).toBeAttached();
129
+ });
130
+ });
@@ -0,0 +1,15 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('paypal', () => {
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('/paypal');
6
+ });
7
+
8
+ test('should load the page', async ({ page }) => {
9
+ await expect(page).toHaveTitle('Test Paypal');
10
+ });
11
+
12
+ test('should inject the PayPal iframe into the page', async ({ page }) => {
13
+ await expect(page.locator('iframe[title="PayPal-paypal"]:not(.invisible)')).toBeVisible();
14
+ });
15
+ });
@@ -0,0 +1,10 @@
1
+ import { test, expect } from '@playwright/test';
2
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
3
+ const pkg = require('../../../package.json');
4
+ const expectedVersion = process.env.REACT_VERSION ?? pkg.devDependencies.react.slice(1);
5
+
6
+ test(`should render with correct react version (${expectedVersion})`, async ({ page }) => {
7
+ await page.goto('/');
8
+ const versionRegex = new RegExp(`^${expectedVersion}`);
9
+ await expect(page.locator('#react-version')).toHaveText(versionRegex);
10
+ });
@@ -15,7 +15,7 @@ const lockfilePath = '../../../pnpm-lock.yaml';
15
15
  const lockfileBackupPath = '../../../pnpm-lock.yaml.backup';
16
16
 
17
17
  function runInstallCommand() {
18
- execSync('pnpm install', { stdio: 'inherit' });
18
+ execSync('pnpm install --no-frozen-lockfile', { stdio: 'inherit' });
19
19
  }
20
20
 
21
21
  function backupFiles() {
@@ -1,2 +0,0 @@
1
- import '@testing-library/cypress/add-commands';
2
- import 'cypress-iframe';
@@ -1 +0,0 @@
1
- ///<reference types="cypress-iframe" />
@@ -1,27 +0,0 @@
1
- describe('bank-separate', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/bank-separate' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Bank Page Separate Fields');
8
- });
9
-
10
- it('should inject the bank iframes into the page', () => {
11
- cy.get('iframe#bbanAccountType');
12
- cy.get('iframe#bbanAccountNumber');
13
- cy.get('iframe#bbanRoutingNumber');
14
- });
15
-
16
- it('should call the on-ready BankAccountType element hook', () => {
17
- cy.get('#events-bankAccountType-onReady-true');
18
- });
19
-
20
- it('should call the on-ready BankAccountNumber element hook', () => {
21
- cy.get('#events-bankAccountNumber-onReady-true');
22
- });
23
-
24
- it('should call the on-ready BankRoutingNumber element hook', () => {
25
- cy.get('#events-bankRoutingNumber-onReady-true');
26
- });
27
- });
@@ -1,68 +0,0 @@
1
- describe('card-separate-brands', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/card-separate-brands' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should(
8
- 'eq',
9
- 'Test Card Page Separate Fields allowed Brands',
10
- );
11
- });
12
-
13
- it('should inject the card iframes into the page', () => {
14
- cy.get('iframe#cardNumber');
15
- cy.get('iframe#cardCvv');
16
- cy.get('iframe#cardExpiration');
17
- });
18
-
19
- it('should be call the on-ready card element hook', () => {
20
- cy.get('#events-number-onReady-true');
21
- });
22
-
23
- it('should be call the on-ready cvv element hook', () => {
24
- cy.get('#events-cvv-onReady-true');
25
- });
26
-
27
- it('should be call the on-ready expiry element hook', () => {
28
- cy.get('#events-expiry-onReady-true');
29
- });
30
-
31
- it('should decline the MasterCard by default', () => {
32
- cy.get('#events-number-onReady-true');
33
-
34
- cy.iframe('iframe#cardNumber')
35
- .findByTestId('cardnumber')
36
- .type('4111 1111 1111 1111');
37
-
38
- cy.get('#events-number-onChange-error-code-unavailable-card-brand');
39
- });
40
-
41
- it('should allow the Visa after update and decline after restore', () => {
42
- cy.iframe('iframe#cardNumber')
43
- .findByTestId('cardnumber')
44
- .type('4111 1111 1111 1111');
45
-
46
- cy.iframe('iframe#cardCvv').findByTestId('cvv').type('123');
47
-
48
- cy.iframe('iframe#cardExpiration').within(() => {
49
- const expiry =
50
- String('0' + (new Date().getMonth() + 1)).substr(-2) +
51
- String(new Date().getFullYear()).substr(-2);
52
-
53
- cy.findByTestId('exp-date').type(expiry);
54
- });
55
-
56
- cy.get('#events-number-onChange-error-code-unavailable-card-brand');
57
-
58
- cy.get('#btn-update').click();
59
-
60
- cy.get(
61
- '#events-number-onChange-error-code-unavailable-card-brand',
62
- ).should('not.exist');
63
-
64
- cy.get('#btn-restore').click();
65
-
66
- cy.get('#events-number-onChange-error-code-unavailable-card-brand');
67
- });
68
- });
@@ -1,27 +0,0 @@
1
- describe('card-separate', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/card-separate' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Card Page Separate Fields');
8
- });
9
-
10
- it('should inject the card iframes into the page', () => {
11
- cy.get('iframe#cardNumber');
12
- cy.get('iframe#cardCvv');
13
- cy.get('iframe#cardExpiration');
14
- });
15
-
16
- it('should be call the on-ready card element hook', () => {
17
- cy.get('#events-number-onReady-true');
18
- });
19
-
20
- it('should be call the on-ready cvv element hook', () => {
21
- cy.get('#events-cvv-onReady-true');
22
- });
23
-
24
- it('should be call the on-ready expiry element hook', () => {
25
- cy.get('#events-expiry-onReady-true');
26
- });
27
- });
@@ -1,24 +0,0 @@
1
- describe('checkout-combined', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/checkout-combined' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Checkout Page Combined Field');
8
- });
9
-
10
- it('should inject the card iframe into the page', () => {
11
- cy.get('iframe#card');
12
- });
13
-
14
- it('should be call the on-ready hook', () => {
15
- cy.get('#events-onReady-true');
16
- });
17
-
18
- it('should call the on-change hook', () => {
19
- cy.get('#events-onReady-true');
20
- cy.get('#submit').click();
21
- cy.get('#key-onChange');
22
- cy.get('#token-data-code-invalid-payment-card');
23
- });
24
- });
@@ -1,13 +0,0 @@
1
- describe('google-pay', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/google-pay' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Google Pay');
8
- });
9
-
10
- it('should inject the Google pay iframe into the page', () => {
11
- cy.get('iframe#googlePay');
12
- });
13
- });
@@ -1,17 +0,0 @@
1
- describe('iban', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/iban' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test IBAN Field');
8
- });
9
-
10
- it('should inject the card iframe into the page', () => {
11
- cy.get('iframe#iban');
12
- });
13
-
14
- it('should call the on-ready iban element hook', () => {
15
- cy.get('#events-iban-onReady-true');
16
- });
17
- });
@@ -1,48 +0,0 @@
1
- describe('checkout-combined', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/inject-metadata' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Inject Metadata');
8
- });
9
-
10
- it('should inject the card iframe into the page', () => {
11
- cy.get('iframe#card');
12
- });
13
-
14
- it('should be call the on-ready hook', () => {
15
- cy.get('#events-onReady-true');
16
- });
17
-
18
- it('should call the on-change hook', () => {
19
- cy.get('#events-onReady-true');
20
- cy.get('#submit').click();
21
- cy.get('#key-onChange');
22
- cy.get('#token-data-code-invalid-payment-card');
23
- });
24
-
25
- it('should show provided data in token', () => {
26
- cy.get('#events-onReady-true');
27
-
28
- cy.iframe('iframe#card').within(() => {
29
- const cardNumber = '4111111111111111';
30
- const expiry =
31
- String('0' + (new Date().getMonth() + 1)).substr(-2) +
32
- String(new Date().getFullYear()).substr(-2);
33
- const cvv = '123';
34
-
35
- cy.findByTestId('cardnumber').type(cardNumber);
36
- cy.findByTestId('exp-date').type(expiry);
37
- cy.findByTestId('cvv').type(cvv);
38
- });
39
-
40
- cy.get('#submit').click();
41
-
42
- cy.get('#token-data-fingerprint')
43
- .invoke('text')
44
- .should((fingerprint) => {
45
- expect(fingerprint).to.equal('fingerprint123');
46
- });
47
- });
48
- });
@@ -1,128 +0,0 @@
1
- describe('multiple-methods', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/multiple-methods' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Multiple Methods');
8
- });
9
-
10
- it('should call the on-ready card element hook', () => {
11
- cy.get('#events-card-onReady-true');
12
- });
13
-
14
- it('should init with payment-card method by default', () => {
15
- cy.get('#events-card-onReady-true');
16
- cy.get('#events-bankAccountType-onReady-false');
17
- cy.get('#events-bankAccountNumber-onReady-false');
18
- cy.get('#events-bankRoutingNumber-onReady-false');
19
- cy.get('#events-iban-onReady-false');
20
- });
21
-
22
- it('should load other methods', () => {
23
- cy.get('#events-card-onReady-true');
24
-
25
- cy.get('#set-active-element-bank').click();
26
-
27
- // check other methods are disabled
28
- cy.get('#events-card-onReady-false');
29
- cy.get('#events-iban-onReady-false');
30
-
31
- // check bank is loaded
32
- cy.get('#events-bankAccountNumber-onReady-true');
33
- cy.get('#events-bankAccountType-onReady-true');
34
- cy.get('#events-bankRoutingNumber-onReady-true');
35
-
36
- // load IBAN
37
- cy.get('#set-active-element-iban').click();
38
-
39
- // check other methods are disabled
40
- cy.get('#events-card-onReady-false');
41
- cy.get('#events-bankAccountType-onReady-false');
42
- cy.get('#events-bankAccountNumber-onReady-false');
43
- cy.get('#events-bankRoutingNumber-onReady-false');
44
-
45
- // check IBAN is loaded
46
- cy.get('#events-iban-onReady-true');
47
-
48
- // load Google Pay
49
- cy.get('#set-active-element-googlepay').click();
50
-
51
- // check other methods are disabled
52
- cy.get('#events-card-onReady-false');
53
- cy.get('#events-bankAccountType-onReady-false');
54
- cy.get('#events-bankAccountNumber-onReady-false');
55
- cy.get('#events-bankRoutingNumber-onReady-false');
56
- cy.get('#events-iban-onReady-false');
57
-
58
- // check Google Pay is loaded
59
- cy.iframe('#googlePay');
60
- });
61
-
62
- it('should generate the card token', () => {
63
- cy.get('#events-card-onReady-true');
64
-
65
- cy.iframe('iframe#card').within(() => {
66
- const cardNumber = '4111111111111111';
67
- const expiry =
68
- String('0' + (new Date().getMonth() + 1)).substr(-2) +
69
- String(new Date().getFullYear()).substr(-2);
70
- const cvv = '123';
71
-
72
- cy.findByTestId('cardnumber').type(cardNumber);
73
- cy.findByTestId('exp-date').type(expiry);
74
- cy.findByTestId('cvv').type(cvv);
75
- });
76
-
77
- cy.get('#submit').click();
78
-
79
- cy.get('#events-card-onChange-valid-true');
80
- cy.get('#events-card-onChange-source-card');
81
- cy.get('#token-error-false');
82
- cy.get('#token-data-method-payment-card');
83
- cy.get('#token-data-paymentInstrument-brand-Visa');
84
- });
85
-
86
- it('should generate the bank token', () => {
87
- cy.get('#set-active-element-bank').click();
88
-
89
- cy.get('#events-bankAccountType-onReady-true');
90
- cy.get('#events-bankAccountNumber-onReady-true');
91
- cy.get('#events-bankRoutingNumber-onReady-true');
92
-
93
- cy.iframe('iframe#bbanAccountType').findByTestId('savings').click();
94
- cy.iframe('iframe#bbanAccountNumber')
95
- .findByTestId('bbanAccountNumber')
96
- .type('22222222');
97
- cy.iframe('iframe#bbanRoutingNumber')
98
- .findByTestId('bbanRoutingNumber')
99
- .type('11111111');
100
-
101
- cy.get('#submit').click();
102
-
103
- cy.get('#events-bankAccountNumber-onChange-valid-true');
104
- cy.get('#events-bankAccountNumber-onChange-source-bankAccountNumber');
105
- cy.get('#events-bankRoutingNumber-onChange-valid-true');
106
- cy.get('#events-bankRoutingNumber-onChange-source-bankRoutingNumber');
107
- cy.get('#events-bankAccountType-onChange-valid-true');
108
- cy.get('#events-bankAccountType-onChange-source-bankAccountType');
109
- cy.get('#token-error-false');
110
- cy.get('#token-data-method-ach');
111
- });
112
-
113
- it('should generate the iban token', () => {
114
- cy.get('#set-active-element-iban').click();
115
-
116
- cy.get('#events-iban-onReady-true');
117
-
118
- cy.iframe('iframe#iban')
119
- .findByTestId('iban')
120
- .type('DE89 3704 0044 0532 0130 00');
121
-
122
- cy.get('#submit').click();
123
-
124
- cy.get('#events-iban-onChange-valid-true');
125
- cy.get('#token-error-false');
126
- cy.get('#token-data-method-ach');
127
- });
128
- });
@@ -1,13 +0,0 @@
1
- describe('paypal', () => {
2
- beforeEach(() => {
3
- cy.visit({ url: '/paypal' });
4
- });
5
-
6
- it('should load the page', () => {
7
- cy.title().should('eq', 'Test Paypal');
8
- });
9
-
10
- it('should inject the PayPal iframe into the page', () => {
11
- cy.get('iframe[title="PayPal-paypal"]');
12
- });
13
- });
@@ -1,13 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-require-imports
2
- const pkg = require('../../../package.json');
3
- const expectedVersion =
4
- Cypress.env('REACT_VERSION') ?? pkg.devDependencies.react.slice(1);
5
-
6
- it(`should render with correct react version (${expectedVersion})`, () => {
7
- cy.visit('/');
8
- cy.get('#react-version')
9
- .invoke('text')
10
- .should((actualVersion) => {
11
- expect(actualVersion.startsWith(expectedVersion)).to.be.true;
12
- });
13
- });
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["es5", "dom"],
5
- "types": ["cypress", "@testing-library/cypress"]
6
- },
7
- "include": ["**/*.ts", "./cypress.d.ts"]
8
- }