-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port merchant subscription settings spec to Playwright (#10155)
Co-authored-by: Eric Jinks <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
25 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/dev-10083-playwright-migration-merchant-subscriptions-settings
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 merchant subscription settings spec to Playwright |
30 changes: 30 additions & 0 deletions
30
tests/e2e-pw/specs/merchant/merchant-subscriptions-settings.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,30 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import test, { expect } from 'playwright/test'; | ||
import { describeif, useMerchant } from '../../utils/helpers'; | ||
import { shouldRunSubscriptionsTests } from '../../utils/constants'; | ||
import { goToWooCommerceSettings } from '../../utils/merchant-navigation'; | ||
|
||
describeif( shouldRunSubscriptionsTests )( | ||
'WooCommerce > Settings > Subscriptions', | ||
() => { | ||
useMerchant(); | ||
test( 'Merchant should be able to load WooCommerce Subscriptions settings tab', async ( { | ||
page, | ||
} ) => { | ||
await goToWooCommerceSettings( page, 'subscriptions' ); | ||
const menuItem = page.getByRole( 'main' ).getByRole( 'link', { | ||
name: 'Subscriptions', | ||
exact: true, | ||
} ); | ||
await expect( menuItem ).toBeVisible(); | ||
|
||
// An alternative way to verify the subscriptions menu page is active, avoiding the active tab classname. | ||
const heading = await page.getByRole( 'heading', { | ||
name: 'Subscriptions', | ||
} ); | ||
await expect( heading ).toBeVisible(); | ||
} ); | ||
} | ||
); |
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
25 changes: 0 additions & 25 deletions
25
tests/e2e/specs/subscriptions/merchant/merchant-subscriptions-settings.spec.js
This file was deleted.
Oops, something went wrong.