Skip to content

Commit 20b18ce

Browse files
committed
Add E2E tests
1 parent c840fbf commit 20b18ce

File tree

4 files changed

+59
-11
lines changed

4 files changed

+59
-11
lines changed

e2e/tests/adyen-giving.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-check
2+
const { test, expect } = require('@playwright/test');
3+
4+
5+
6+
test('load Giving', async ({ page }) => {
7+
await page.goto('/');
8+
9+
await expect(page).toHaveTitle(/API Flows/);
10+
11+
await page.getByRole('button', { name: 'Try out the Adyen Giving workflow' }).click();
12+
await page.getByRole('button', { name: 'GO' }).click();
13+
14+
// click on workflow
15+
await page.getByRole('button', { name: 'giving' }).click();
16+
17+
await page.getByRole('tab', { name: 'Info' }).click();
18+
await page.getByRole('button', { name: 'Errors (0)' }).click();
19+
});
20+

e2e/tests/adyen-recurring.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-check
2+
const { test, expect } = require('@playwright/test');
3+
4+
5+
6+
test('load Adyen Recurring example', async ({ page }) => {
7+
await page.goto('/');
8+
9+
await expect(page).toHaveTitle(/API Flows/);
10+
11+
await page.getByRole('button', { name: 'Try out the Adyen Make Recurring Payments workflow' }).click();
12+
await page.getByRole('button', { name: 'GO' }).click();
13+
14+
// click on workflow
15+
await page.getByRole('button', { name: 'tokenization' }).click();
16+
17+
await page.getByRole('tab', { name: 'Info' }).click();
18+
await page.getByRole('button', { name: 'Errors (0)' }).click();
19+
});
20+

e2e/tests/arazzo.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
const { test, expect } = require('@playwright/test');
3+
4+
5+
test('load Arazzo example', async ({ page }) => {
6+
await page.goto('/');
7+
8+
await expect(page).toHaveTitle(/API Flows/);
9+
10+
await page.getByRole('button', { name: 'Try out the Arazzo example \'Petstore - Apply Coupons\'' }).click();
11+
await page.getByRole('button', { name: 'GO' }).click();
12+
13+
// click on workflow
14+
await page.getByRole('button', { name: 'apply-coupon' }).click();
15+
16+
await page.getByRole('tab', { name: 'Info' }).click();
17+
await page.getByRole('button', { name: 'Errors (0)' }).click();
18+
});
19+

e2e/tests/home.spec.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,5 @@ test('home', async ({ page }) => {
77
await expect(page).toHaveTitle(/API Flows/);
88
});
99

10-
test('load Giving', async ({ page }) => {
11-
await page.goto('/');
12-
13-
await expect(page).toHaveTitle(/API Flows/);
1410

15-
await page.getByRole('button', { name: 'Try out the Adyen Giving workflow' }).click();
16-
await page.getByRole('button', { name: 'GO' }).click();
17-
18-
await page.getByRole('button', { name: 'giving' }).click();
19-
await page.getByRole('tab', { name: 'Info' }).click();
20-
await page.getByRole('button', { name: 'Errors (0)' }).click();
21-
});
2211

0 commit comments

Comments
 (0)