Skip to content

Commit a77413a

Browse files
authored
Convert merchant admin transactions E2E tests to Playwright (#10174)
1 parent 30e1c14 commit a77413a

File tree

5 files changed

+45
-40
lines changed

5 files changed

+45
-40
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: dev
3+
4+
Convert merchant admin transactions E2E test to Playwright
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* External dependencies
3+
*/
4+
import test, { expect } from '@playwright/test';
5+
6+
/**
7+
* Internal dependencies
8+
*/
9+
import { shouldRunSubscriptionsTests } from '../../utils/constants';
10+
import { getMerchant } from '../../utils/helpers';
11+
import { goToTransactions } from '../../utils/merchant-navigation';
12+
13+
test.describe( 'Admin transactions', () => {
14+
test( 'page should load without errors', async ( { browser } ) => {
15+
const { merchantPage } = await getMerchant( browser );
16+
await goToTransactions( merchantPage );
17+
await expect(
18+
merchantPage
19+
.getByLabel( 'Transactions', { exact: true } )
20+
.getByRole( 'heading', { name: 'Transactions' } )
21+
).toBeVisible();
22+
23+
if ( shouldRunSubscriptionsTests ) {
24+
await expect(
25+
merchantPage.getByRole( 'columnheader', {
26+
name: 'Subscription number',
27+
} )
28+
).toBeVisible();
29+
}
30+
31+
await expect( merchantPage ).toHaveScreenshot();
32+
} );
33+
} );

tests/e2e-pw/utils/merchant-navigation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ export const goToOrderAnalytics = async ( page: Page ) => {
6060
await dataHasLoaded( page );
6161
};
6262

63+
export const goToTransactions = async ( page: Page ) => {
64+
await page.goto(
65+
'/wp-admin/admin.php?page=wc-admin&path=%2Fpayments%2Ftransactions',
66+
{ waitUntil: 'load' }
67+
);
68+
await dataHasLoaded( page );
69+
};
70+
6371
export const goToMultiCurrencySettings = async ( page: Page ) => {
6472
await page.goto(
6573
'/wp-admin/admin.php?page=wc-settings&tab=wcpay_multi_currency',

tests/e2e/specs/wcpay/merchant/merchant-admin-transactions.spec.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)