-
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.
Convert the Progressive Onboarding spec to Playwright (#10130)
- Loading branch information
1 parent
b763f99
commit 67ec4c7
Showing
5 changed files
with
107 additions
and
96 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/dev-9968-convert-merchant-progressive-onboarding-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 | ||
|
||
Converted E2E merchant-progressive-onboarding spec from Puppeteer to Playwright. |
68 changes: 68 additions & 0 deletions
68
tests/e2e-pw/specs/merchant/merchant-progressive-onboarding.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,68 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { useMerchant } from '../../utils/helpers'; | ||
import * as devtools from '../../utils/devtools'; | ||
import { goToConnect } from '../../utils/merchant-navigation'; | ||
|
||
test.describe( 'Admin merchant progressive onboarding', () => { | ||
useMerchant(); | ||
|
||
test.beforeAll( async ( { browser } ) => { | ||
const page = await browser.newPage(); | ||
await devtools.enableActAsDisconnectedFromWCPay( page ); | ||
} ); | ||
|
||
test.afterAll( async ( { browser } ) => { | ||
const page = await browser.newPage(); | ||
await devtools.disableActAsDisconnectedFromWCPay( page ); | ||
} ); | ||
|
||
test( 'should pass merchant flow without any errors', async ( { | ||
page, | ||
} ) => { | ||
// Open connect account page and click the primary CTA to start onboarding. | ||
await goToConnect( page ); | ||
// Start onboarding process | ||
await page | ||
.getByRole( 'button', { name: 'Verify business details' } ) | ||
.click(); | ||
// Pick Individual business entity | ||
await page | ||
.getByRole( 'button', { | ||
name: 'What type of legal entity is', | ||
} ) | ||
.click(); | ||
await page.getByRole( 'option', { name: 'Individual' } ).click(); | ||
// Pick Software MCC | ||
await page.getByLabel( 'Select an option' ).click(); | ||
await page.getByText( 'Software' ).click(); | ||
// Accept terms and conditions | ||
await page.getByRole( 'button', { name: 'Continue' } ).click(); | ||
// Pick annual revenue | ||
await page | ||
.getByRole( 'button', { | ||
name: 'What is your estimated annual', | ||
} ) | ||
.click(); | ||
await page.getByRole( 'option', { name: 'Less than $250k' } ).click(); | ||
// Pick estimated time to launch | ||
await page | ||
.getByRole( 'button', { name: 'What is the estimated timeline' } ) | ||
.click(); | ||
await page.getByRole( 'option', { name: 'Within 1 month' } ).click(); | ||
await page.getByRole( 'button', { name: 'Continue' } ).click(); | ||
|
||
// Check that Stripe Embedded KYC iframe is loaded. | ||
await expect( | ||
page.locator( | ||
'iframe[data-testid="stripe-connect-ui-layer-stripe-connect-account-onboarding"]' | ||
) | ||
).toBeAttached(); | ||
} ); | ||
} ); |
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
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
96 changes: 0 additions & 96 deletions
96
tests/e2e/specs/wcpay/merchant/merchant-progressive-onboarding.spec.js
This file was deleted.
Oops, something went wrong.