-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E test workshop advanced flow (#95)
Co-authored-by: kwokhe <[email protected]>
- Loading branch information
1 parent
072b0d5
commit 5b94006
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// @ts-check | ||
const { test, expect } = require('@playwright/test'); | ||
const utilities = require('../utilities'); | ||
|
||
test('Workshop - Advanced Flow Payment', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
// Select "Drop-in" | ||
await expect(page.locator('text="Start shopping"')).toBeVisible(); | ||
await page.getByRole('link', { name: 'Start shopping' }).click(); | ||
|
||
// Click "Continue to checkout" | ||
await page.getByRole('link', { name: 'Continue to checkout' }).click(); | ||
|
||
// Wait for load event | ||
await page.waitForLoadState('load'); | ||
|
||
// Assert that "Credit or debit card" is visible | ||
await expect(page.locator('text="Credit or debit card"')).toBeVisible(); | ||
|
||
// Click "Credit or debit card" | ||
const radioButton = await page.getByRole('radio', { name: 'Credit or debit card' }); | ||
await radioButton.click(); | ||
|
||
// Wait for load event | ||
await page.waitForLoadState('load'); | ||
|
||
// Fill card details | ||
await utilities.fillDropinCardDetails(page); | ||
|
||
// Click "Pay" button | ||
const payButton = page.locator('.adyen-checkout__button__text >> visible=true'); | ||
await expect(payButton).toBeVisible(); | ||
await payButton.click(); | ||
|
||
await expect(page.locator('text="Return Home"')).toBeVisible(); | ||
}); |