diff --git a/tests/advanced-checkout/ideal.spec.js b/tests/advanced-checkout/ideal.spec.js.txt similarity index 50% rename from tests/advanced-checkout/ideal.spec.js rename to tests/advanced-checkout/ideal.spec.js.txt index cfcbce3..9551508 100644 --- a/tests/advanced-checkout/ideal.spec.js +++ b/tests/advanced-checkout/ideal.spec.js.txt @@ -1,6 +1,7 @@ // @ts-check const { test, expect } = require('@playwright/test'); +// test for iDEAL2 test('iDEAL', async ({ page }) => { await page.goto('/'); @@ -10,27 +11,26 @@ test('iDEAL', async ({ page }) => { // Select "iDEAL" await page.getByRole('link', { name: 'iDEAL' }).click(); await expect(page.locator('text="Cart"')).toBeVisible(); - + // Click "Continue to checkout" await page.getByRole('link', { name: 'Continue to checkout' }).click(); + // Click "Continue to iDEAL" + await page.getByRole('button', { name: 'Continue to iDEAL' }).click(); + await expect(page.locator('text="Scan with your banking app to pay"')).toBeVisible(); + // Click "Select your bank" - const selectButton = await page.getByTitle('Select your bank'); - if (await selectButton.count() === 0) { - // Click radio button for > Adyen-Web 5.53.x or higher - await page.getByPlaceholder('Search...').click(); - } else { - await selectButton.click(); - } + await page.getByRole('button', { name: 'Select your bank' }).click(); - // Choose "Test Issuer" - await page.getByText('Test Issuer', { exact: true }).click(); + // Click "TESTNL2A" + await page.getByRole('button', { name: 'TESTNL2A' }).click(); + await expect(page.locator('text="Which test simulation to run?"')).toBeVisible(); - // Click "Continue to Test Issuer" - await page.getByRole('button', { name: 'Continue to Test Issuer' }).click(); - await expect(page.locator('text="iDEAL Issuer Simulation"')).toBeVisible(); + // Click "Success" + await page.getByRole('button', { name: 'Success' }).click(); // Click "Continue" - await page.getByRole('button', { name: 'Continue' }).click(); await page.getByRole('link', { name: 'Return Home' }).click(); + }); + diff --git a/tests/checkout/ideal.spec.js b/tests/checkout/ideal.spec.js deleted file mode 100644 index 321aa19..0000000 --- a/tests/checkout/ideal.spec.js +++ /dev/null @@ -1,30 +0,0 @@ -// @ts-check -const { test, expect } = require('@playwright/test'); - -test('iDEAL', async ({ page }) => { - await page.goto('/'); - - await expect(page).toHaveTitle(/Checkout Demo/); - await expect(page.locator('text="Select a demo"')).toBeVisible(); - - // Select "iDEAL" - await page.getByRole('link', { name: 'iDEAL' }).click(); - await expect(page.locator('text="Cart"')).toBeVisible(); - - // Click "Continue to checkout" - await page.getByRole('link', { name: 'Continue to checkout' }).click(); - - // Click "Select your bank" - await page.getByPlaceholder('Search...').click(); - - // Choose "Test Issuer" - await page.getByText('Test Issuer', { exact: true }).click(); - - // Click "Continue to Test Issuer" - await page.getByRole('button', { name: 'Continue to Test Issuer' }).click(); - await expect(page.locator('text="iDEAL Issuer Simulation"')).toBeVisible(); - - // Click "Continue" - await page.getByRole('button', { name: 'Continue' }).click(); - await page.getByRole('link', { name: 'Return Home' }).click(); -}); diff --git a/tests/checkout/ideal.spec.js.txt b/tests/checkout/ideal.spec.js.txt new file mode 100644 index 0000000..9551508 --- /dev/null +++ b/tests/checkout/ideal.spec.js.txt @@ -0,0 +1,36 @@ +// @ts-check +const { test, expect } = require('@playwright/test'); + +// test for iDEAL2 +test('iDEAL', async ({ page }) => { + await page.goto('/'); + + await expect(page).toHaveTitle(/Checkout Demo Advanced/); + await expect(page.locator('text="Select a demo"')).toBeVisible(); + + // Select "iDEAL" + await page.getByRole('link', { name: 'iDEAL' }).click(); + await expect(page.locator('text="Cart"')).toBeVisible(); + + // Click "Continue to checkout" + await page.getByRole('link', { name: 'Continue to checkout' }).click(); + + // Click "Continue to iDEAL" + await page.getByRole('button', { name: 'Continue to iDEAL' }).click(); + await expect(page.locator('text="Scan with your banking app to pay"')).toBeVisible(); + + // Click "Select your bank" + await page.getByRole('button', { name: 'Select your bank' }).click(); + + // Click "TESTNL2A" + await page.getByRole('button', { name: 'TESTNL2A' }).click(); + await expect(page.locator('text="Which test simulation to run?"')).toBeVisible(); + + // Click "Success" + await page.getByRole('button', { name: 'Success' }).click(); + + // Click "Continue" + await page.getByRole('link', { name: 'Return Home' }).click(); + +}); +