-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update/deprecating-sofort-from-checkout
- Loading branch information
Showing
23 changed files
with
809 additions
and
889 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
changelog/dev-10067-convert-shopper-multi-currency-widget-spec
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,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert shopper-multi-currency-widget spec from Puppeteer to Playwright |
4 changes: 4 additions & 0 deletions
4
changelog/dev-10086-playwright-migration-shopper-subscriptions-purchase-free-trial
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,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Migrate shopper subscription free-trial purchase E2E test to Playwright |
4 changes: 4 additions & 0 deletions
4
changelog/dev-10088-playwright-migration-shopper-subscriptions-no-sign-up-fee
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,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Migrate shopper subscriptions - No signup fee E2E test to Playwright |
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,5 @@ | ||
Significance: patch | ||
Type: dev | ||
Comment: Convert merchant-orders-full-refund spec from Puppeteer to Playwright | ||
|
||
|
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,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert merchant-orders-partial-refund spec from Puppeteer to Playwright. |
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,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix incorrect payment method logos used on WooPayment Settings |
119 changes: 119 additions & 0 deletions
119
tests/e2e-pw/specs/merchant/merchant-orders-full-refund.spec.ts
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,119 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect, Page } from '@playwright/test'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { getMerchant, getShopper } from '../../utils/helpers'; | ||
import { | ||
deactivateMulticurrency, | ||
isMulticurrencyEnabled, | ||
} from '../../utils/merchant'; | ||
import * as shopper from '../../utils/shopper'; | ||
import { goToOrder, goToPaymentDetails } from '../../utils/merchant-navigation'; | ||
|
||
test.describe( 'WooCommerce Payments - Full Refund', () => { | ||
let merchantPage: Page; | ||
let shopperPage: Page; | ||
let orderId: string; | ||
let orderAmount: string; | ||
|
||
test.beforeAll( async ( { browser } ) => { | ||
merchantPage = ( await getMerchant( browser ) ).merchantPage; | ||
shopperPage = ( await getShopper( browser ) ).shopperPage; | ||
|
||
// Disable multi-currency in the merchant settings. This step is important because local environment setups | ||
// might have multi-currency enabled. We need to ensure a consistent environment for the test. | ||
if ( await isMulticurrencyEnabled( merchantPage ) ) { | ||
await deactivateMulticurrency( merchantPage ); | ||
} | ||
} ); | ||
|
||
test( 'should process a full refund for an order', async () => { | ||
// Place an order to refund later and get the order ID so we can open it in the merchant view | ||
orderId = await shopper.placeOrderWithCurrency( shopperPage, 'USD' ); | ||
|
||
// Get the order total so we can verify the refund amount | ||
orderAmount = await shopperPage | ||
.locator( | ||
'.woocommerce-order-overview__total .woocommerce-Price-amount' | ||
) | ||
.textContent(); | ||
|
||
// Open the order | ||
await goToOrder( merchantPage, orderId ); | ||
|
||
// Click refund button | ||
await merchantPage | ||
.getByRole( 'button', { | ||
name: 'Refund', | ||
} ) | ||
.click(); | ||
|
||
// Fill refund details | ||
await merchantPage.getByLabel( 'Refund amount' ).fill( orderAmount ); | ||
// await merchantPage.fill( '.refund_line_total', orderAmount ); | ||
await merchantPage | ||
.getByLabel( 'Reason for refund' ) | ||
.fill( 'No longer wanted' ); | ||
|
||
const refundButton = await merchantPage.getByRole( 'button', { | ||
name: `Refund ${ orderAmount } via WooPayments`, | ||
} ); | ||
|
||
await expect( refundButton ).toBeVisible(); | ||
|
||
// TODO: This visual regression test is not flaky, but we should revisit the approach. | ||
// await expect( merchantPage ).toHaveScreenshot(); | ||
|
||
// Click refund and handle confirmation dialog | ||
merchantPage.on( 'dialog', ( dialog ) => dialog.accept() ); | ||
await refundButton.click(); | ||
|
||
// Wait for refund to process | ||
await merchantPage.waitForLoadState( 'networkidle' ); | ||
|
||
// Verify refund details | ||
await expect( | ||
merchantPage.getByRole( 'cell', { | ||
name: `-${ orderAmount }`, | ||
} ) | ||
).toHaveCount( 2 ); | ||
await expect( | ||
merchantPage.getByText( | ||
`A refund of ${ orderAmount } was successfully processed using WooPayments. Reason: No longer wanted` | ||
) | ||
).toBeVisible(); | ||
|
||
// TODO: This visual regression test is not flaky, but we should revisit the approach. | ||
// await expect( merchantPage ).toHaveScreenshot(); | ||
} ); | ||
|
||
test( 'should be able to view a refunded transaction', async () => { | ||
// Get and navigate to payment details | ||
const paymentIntentId = await merchantPage | ||
.locator( '#order_data' ) | ||
.getByRole( 'link', { | ||
name: /pi_/, | ||
} ) | ||
.innerText(); | ||
|
||
await goToPaymentDetails( merchantPage, paymentIntentId ); | ||
|
||
// Verify timeline events | ||
await expect( | ||
merchantPage.getByText( | ||
`A payment of ${ orderAmount } was successfully refunded.` | ||
) | ||
).toBeVisible(); | ||
|
||
await expect( | ||
merchantPage.getByText( 'Payment status changed to Refunded.' ) | ||
).toBeVisible(); | ||
|
||
// TODO: This visual regression test is not flaky, but we should revisit the approach. | ||
// await expect( merchantPage ).toHaveScreenshot(); | ||
} ); | ||
} ); |
Oops, something went wrong.