-
Notifications
You must be signed in to change notification settings - Fork 74
[E2E][QIT] Add remaining merchant E2E test specs to QIT test-package #11221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 84 commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
5940c8a
[E2E][QIT] Migrate remaining shopper specs
mgascam 8832b55
Add changelog entry
mgascam 774085a
Fix Alipay and pay-for-order test failures
mgascam 7977468
Skip Alipay tests due to QIT environment limitation
mgascam 61d20ed
Skip cardTestingPreventionEnabled: true case in pay-for-order test
mgascam 1de9aa1
Merge branch 'develop' into dev/qit-e2e-shopper-remaining-specs
mgascam 698a093
Remove unused emptyCart import
mgascam 1b5c186
add test package
5a5874e
remove development files
c21f5c9
fix failing tests
33c7a61
chore: update woocommerce/qit-cli to dev-trunk and add .gitignore for…
mgascam f65a0fa
rename tests folder
mgascam ca9195a
Rename parent folder
mgascam 698ac2f
feat: add .nvmrc file and update setup script for WooPayments E2E tests
mgascam 4ee499e
feat: update test configuration and add shopper subpackage for WooPay…
mgascam 9626216
fix: update home page test to verify visibility of site title
mgascam de9cfaa
chore: remove outdated migration guide for QIT test packages
mgascam d147c6d
fix: update QIT test package path and clean up environment configuration
mgascam 3d95523
fix: update plugin entries in QIT test package configuration
mgascam 5696698
feat: add QIT test package configuration and E2E test scripts
mgascam 0c525a2
Move wc blocks tests
mgascam 4efa989
Remove QIT custom E2E configuration.
mgascam a0f8100
fix: improve reliability of save payment method interaction in WC Blo…
mgascam 92e4117
docs: update README for WooPayments QIT tests setup and execution ins…
mgascam a3f67df
remove comment
mgascam f3580e4
revert qit-cli to stable version for CI compatibility
mgascam 0831dbe
Remove comment
mgascam 5b19283
docs: add note about dev version of qit-cli requirement for E2E tests
mgascam 1d9a361
Fix internal dependencies comment
mgascam 0b6d0b8
Remove migration readme
mgascam c8ff3a6
Amend test instructions
mgascam beebe58
refactor: simplify E2E test command and update README instructions
mgascam 3597932
fix: update test directory path for shopper project in Playwright config
mgascam 7355c44
Migrate remaining shopper tests
mgascam dfccf99
Merge branch 'develop' into dev/qit-use-test-packages
mgascam c3d144c
update: change version of woocommerce/qit-cli to dev-trunk in compose…
mgascam 9db1b35
update: add package-lock.json for QIT dependency management
mgascam 776edb0
refactor: move user data to a separate users.ts file and remove users…
mgascam 6bf1fa4
update: rename project from 'chromium' to 'default' in Playwright config
mgascam 1561fd6
Merge branch 'develop' into dev/qit-use-test-packages
mgascam 6b838ed
update: enhance E2E testing setup with troubleshooting guidance and c…
mgascam 7c8994f
update: improve reliability of payment method setup and card details …
mgascam aa71d84
update: specify qit-cli version in composer files and enhance E2E tes…
mgascam cae9695
update: include tests/qit/e2e directory in ESLint ignore file
mgascam 5b98fe3
refactor: remove obsolete e2e tests for payment methods and multi-cur…
mgascam 2af0f5f
Add changelog
mgascam e0fd01f
update: modify Jest config to adjust module path ignore patterns for …
mgascam c1d9c17
update: allow installation of qit-cli and other dependencies without …
mgascam 315353a
Merge branch 'develop' into dev/qit-use-test-packages
mgascam 92c1d4b
update: modify composer install command to exclude development depend…
mgascam ce5e467
Merge branch 'develop' into dev/qit-use-test-packages
mgascam eaf26a3
Merge branch 'develop' into dev/qit-use-test-packages
mgascam 6157a4f
Merge branch 'develop' into dev/qit-use-test-packages
mgascam 164660b
Merge branch 'develop' into dev/qit-use-test-packages
mgascam d87fba1
fix: update plugins format in qit-test.json
mgascam 7902f44
fix: add package name for qit-helpers in package-lock.json
mgascam 6180954
feat: add merchant subpackage to QIT test-package infrastructure
mgascam 8d0b840
feat: add instructions for running specific E2E test projects in READ…
mgascam ae2c051
fix: update TODO comments to include issue references for merchant ac…
mgascam fa4cda3
Add 12 additional merchant E2E test specs to QIT test-package
mgascam 73bcd90
fix: resolve strict mode violation for duplicate snackbars
mgascam 8fb584a
fix: use exact match for 'Complete' text in wp-admin access test
mgascam cfeeb63
fix: add stability wait for dispute challenge form state
mgascam 683c5e5
Merge branch 'develop' into dev/qit-use-test-packages
mgascam 5f1f7e4
fix: remove redundant form state sanity-check in dispute test
mgascam 875acec
fix: rewrite dialog handler to properly await async operations
mgascam 9653d8f
fix: remove mandatory dialog assertion in refund failure tests
mgascam f9acd28
fix: add delay after dispute evidence save for Stripe API
mgascam 446cf62
docs: enhance README with detailed instructions for retrieving Jetpac…
mgascam 0b1edb8
docs: update README with tip for exporting environment variables in s…
mgascam 19d7372
Merge remote-tracking branch 'origin/develop' into dev/qit-use-test-p…
mgascam 61e0077
Merge branch 'dev/qit-use-test-packages' into dev/qit-merchant-tests
mgascam da7670f
fix: update tags for account balance test to reflect implementation s…
mgascam 4ab2030
fix: simplify order processing click logic in ensureOrderIsProcessed …
mgascam 9b49e32
fix: use constant for default theme fallback in getActiveThemeSlug fu…
mgascam 24083ed
Merge remote-tracking branch 'origin' into dev/qit-merchant-tests
mgascam fee4df2
Add changelog
mgascam 8c54a93
Merge branch 'develop' into dev/qit-merchant-tests
mgascam 15cdf8d
refactor: remove multi-currency checks from full refund test for cons…
mgascam 3cc78e5
refactor: streamline dialog handling in refund failure tests
mgascam 623bc90
Merge branch 'develop' into dev/qit-merchant-tests
mgascam 5278ad0
docs: add troubleshooting section for GitHub token errors during comp…
mgascam f174752
Merge dev/qit-merchant-tests into dev/qit-merchant-tests-pr3
mgascam 0b814fd
refactor: enhance refund message verification with regex and improve …
mgascam 5af7a6c
Merge remote-tracking branch 'origin' into dev/qit-merchant-tests-pr3
mgascam 002f9d5
fix: remove unnecessary flag from rate limiter option update
mgascam 4c01d5f
refactor: simplify ensureOrderIsProcessed function and remove orderId…
mgascam 3678c11
refactor: update ensureOrderIsProcessed to use direct PHP eval for sy…
mgascam c9f4bd7
refactor: simplify retry mechanism for analytics data check
mgascam 24bad97
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam d53c341
add changelog
mgascam 60ce4b1
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam 8301878
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam 58ad3af
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam 401890a
Merge branch 'develop' into dev/qit-merchant-tests-pr3
frosso 0459ae9
Fix missing await
mgascam 151b186
fix: update expected text for admin page access test
mgascam 913074a
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam cb7fe65
Merge branch 'develop' into dev/qit-merchant-tests-pr3
mgascam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
| Significance: patch | ||
| Type: dev | ||
| Comment: Migration of merchant E2E tests to QIT Test Packages feature. No production code is affected. |
This file contains hidden or 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 hidden or 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 hidden or 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
137 changes: 137 additions & 0 deletions
137
tests/qit/test-package/tests/woopayments/merchant/merchant-admin-account-balance.spec.ts
This file contains hidden or 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,137 @@ | ||
| /** | ||
| * External dependencies | ||
| */ | ||
| import { test, expect } from '../../../fixtures/auth'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { goToPaymentsOverview, dataHasLoaded } from '../../../utils/merchant'; | ||
|
|
||
| // Optional currency symbol, followed by one or more digits, decimal separator, or comma. | ||
| const formattedCurrencyRegex = /[^\d.,]*[\d.,]+/; | ||
|
|
||
| test.describe( | ||
| 'Merchant account balance overview', | ||
| { tag: '@merchant' }, | ||
| () => { | ||
| test( | ||
| 'View the total and available account balance for a single deposit currency', | ||
| { | ||
| tag: '@critical', | ||
| }, | ||
| async ( { adminPage } ) => { | ||
| await test.step( | ||
| 'Navigate to the Payments Overview screen', | ||
| async () => { | ||
| await goToPaymentsOverview( adminPage ); | ||
| await dataHasLoaded( adminPage ); | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the total account balance, ensuring it has a formatted currency value', | ||
| async () => { | ||
| const totalBalanceValue = adminPage.getByLabel( | ||
| 'Total balance', | ||
| { | ||
| exact: true, | ||
| } | ||
| ); | ||
|
|
||
| await expect( totalBalanceValue ).toHaveText( | ||
| formattedCurrencyRegex | ||
| ); | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the available account balance, ensuring it has a formatted currency value', | ||
| async () => { | ||
| const availableFundsValue = adminPage.getByLabel( | ||
| 'Available funds', | ||
| { | ||
| exact: true, | ||
| } | ||
| ); | ||
|
|
||
| await expect( availableFundsValue ).toHaveText( | ||
| formattedCurrencyRegex | ||
| ); | ||
| } | ||
| ); | ||
| } | ||
| ); | ||
|
|
||
| // @critical tag intentionally omitted until test is fully implemented. | ||
| // Unimplemented tests should not be marked critical as they provide false confidence in coverage. | ||
| test( | ||
| 'View the total and available account balance for multiple deposit currencies', | ||
| { | ||
| tag: '@todo', | ||
| annotation: [ | ||
| { | ||
| type: 'issue', | ||
| description: | ||
| 'https://github.com/Automattic/woocommerce-payments/issues/9188', | ||
| }, | ||
| { | ||
| type: 'description', | ||
| description: | ||
| 'Test requirements not yet met: A merchant account with multiple deposit currencies must be available in our e2e environment', | ||
| }, | ||
| ], | ||
| }, | ||
| async () => { | ||
| await test.step( | ||
| 'Navigate to the Payments Overview screen', | ||
| () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Select a deposit currency using the currency select input', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the total account balance for the selected currency, ensuring it is correctly formatted with the currency symbol', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the available account balance the selected currency, ensuring it is correctly formatted with the currency symbol', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Select a second deposit currency using the currency select input', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the total account balance for the selected currency, ensuring it is correctly formatted with the currency symbol', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
|
|
||
| await test.step( | ||
| 'Observe the available account balance the selected currency, ensuring it is correctly formatted with the currency symbol', | ||
| async () => { | ||
| // @todo https://github.com/Automattic/woocommerce-payments/issues/9188 | ||
| } | ||
| ); | ||
| } | ||
| ); | ||
| } | ||
| ); |
117 changes: 117 additions & 0 deletions
117
tests/qit/test-package/tests/woopayments/merchant/merchant-admin-analytics.spec.ts
This file contains hidden or 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,117 @@ | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { test, expect } from '../../../fixtures/auth'; | ||
| import { | ||
| activateMulticurrency, | ||
| ensureOrderIsProcessed, | ||
| isMulticurrencyEnabled, | ||
| tableDataHasLoaded, | ||
| waitAndSkipTourComponent, | ||
| goToOrderAnalytics, | ||
| } from '../../../utils/merchant'; | ||
| import { placeOrderWithCurrency } from '../../../utils/shopper'; | ||
|
|
||
| test.describe( 'Admin order analytics', { tag: '@merchant' }, () => { | ||
| let orderId: string; | ||
|
|
||
| // Extend timeout for the entire test suite to allow order processing | ||
| test.setTimeout( 120000 ); | ||
|
|
||
| test.beforeAll( async ( { adminPage, customerPage } ) => { | ||
| // Set explicit timeout for this beforeAll hook | ||
| test.setTimeout( 120000 ); | ||
|
|
||
| // Ensure multi-currency is enabled for the analytics tests | ||
| if ( false === ( await isMulticurrencyEnabled( adminPage ) ) ) { | ||
| await activateMulticurrency( adminPage ); | ||
| } | ||
|
|
||
| // Place an order to ensure the analytics data is correct | ||
| orderId = await placeOrderWithCurrency( customerPage, 'USD' ); | ||
| await ensureOrderIsProcessed( adminPage, orderId ); | ||
|
|
||
| // Give analytics more time to process the order data | ||
| await adminPage.waitForTimeout( 2000 ); | ||
| } ); | ||
|
|
||
| test( 'should load without any errors', async ( { adminPage } ) => { | ||
| await goToOrderAnalytics( adminPage ); | ||
| await tableDataHasLoaded( adminPage ); | ||
| await waitAndSkipTourComponent( | ||
| adminPage, | ||
| '.woocommerce-revenue-report-date-tour' | ||
| ); | ||
|
|
||
| const ordersTitle = adminPage.getByRole( 'heading', { | ||
| name: 'Orders', | ||
| level: 1, | ||
| exact: true, | ||
| } ); | ||
| await expect( ordersTitle ).toBeVisible(); | ||
|
|
||
| // Check for analytics data with retry mechanism | ||
| let hasData = false; | ||
| let attempts = 0; | ||
| const maxAttempts = 3; | ||
|
|
||
| while ( ! hasData && attempts < maxAttempts ) { | ||
| const noDataText = adminPage.getByText( 'No data to display' ); | ||
| const noDataCount = await noDataText.count(); | ||
|
|
||
| if ( noDataCount === 0 ) { | ||
| hasData = true; | ||
mgascam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| break; | ||
| } | ||
|
|
||
| // If no data on first check, try refreshing | ||
| if ( attempts < maxAttempts - 1 ) { | ||
| await adminPage.reload(); | ||
| await tableDataHasLoaded( adminPage ); | ||
| await waitAndSkipTourComponent( | ||
| adminPage, | ||
| '.woocommerce-revenue-report-date-tour' | ||
| ); | ||
| // Wait a bit more for data to load after refresh | ||
| await adminPage.waitForTimeout( 2000 ); | ||
| } | ||
|
|
||
| attempts++; | ||
| } | ||
|
|
||
| // Verify that we have analytics data from the order created in beforeAll | ||
| const finalNoDataText = adminPage.getByText( 'No data to display' ); | ||
| await expect( finalNoDataText ).toHaveCount( 0 ); | ||
|
|
||
mgascam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // TODO: This visual regression test is flaky, we should revisit the approach. | ||
| // await expect( adminPage ).toHaveScreenshot(); | ||
| } ); | ||
|
|
||
| test( 'orders table should have the customer currency column', async ( { | ||
| adminPage, | ||
| } ) => { | ||
| await goToOrderAnalytics( adminPage ); | ||
| await tableDataHasLoaded( adminPage ); | ||
| await waitAndSkipTourComponent( | ||
| adminPage, | ||
| '.woocommerce-revenue-report-date-tour' | ||
| ); | ||
|
|
||
| const columnToggle = adminPage.getByTitle( | ||
| 'Choose which values to display' | ||
| ); | ||
| await columnToggle.click(); | ||
| const customerCurrencyToggle = adminPage.getByRole( | ||
| 'menuitemcheckbox', | ||
| { | ||
| name: 'Customer Currency', | ||
| } | ||
| ); | ||
| await expect( customerCurrencyToggle ).toBeVisible(); | ||
| await customerCurrencyToggle.click(); | ||
| const customerCurrencyColumn = adminPage.getByRole( 'columnheader', { | ||
| name: 'Customer Currency', | ||
| } ); | ||
| await expect( customerCurrencyColumn ).toBeVisible(); | ||
| } ); | ||
| } ); | ||
60 changes: 60 additions & 0 deletions
60
tests/qit/test-package/tests/woopayments/merchant/merchant-admin-deposits.spec.ts
This file contains hidden or 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,60 @@ | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { test, expect } from '../../../fixtures/auth'; | ||
|
|
||
| test.describe( 'Merchant deposits', { tag: '@merchant' }, () => { | ||
| test( 'Load the deposits list page', async ( { adminPage } ) => { | ||
| await adminPage.goto( | ||
| '/wp-admin/admin.php?page=wc-admin&path=/payments/payouts' | ||
| ); | ||
|
|
||
| // Wait for the deposits table to load. | ||
| await adminPage | ||
| .locator( '.woocommerce-table__table.is-loading' ) | ||
| .waitFor( { state: 'hidden' } ); | ||
|
|
||
| expect( | ||
| adminPage.getByRole( 'heading', { | ||
| name: 'Payout history', | ||
| } ) | ||
| ).toBeVisible(); | ||
mgascam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } ); | ||
|
|
||
| test( 'Select deposits list advanced filters', async ( { adminPage } ) => { | ||
| await adminPage.goto( | ||
| '/wp-admin/admin.php?page=wc-admin&path=/payments/payouts' | ||
| ); | ||
|
|
||
| // Wait for the deposits table to load. | ||
| await adminPage | ||
| .locator( '.woocommerce-table__table.is-loading' ) | ||
| .waitFor( { state: 'hidden' } ); | ||
|
|
||
| // Open the advanced filters. | ||
| await adminPage.getByRole( 'button', { name: 'All payouts' } ).click(); | ||
| await adminPage | ||
| .getByRole( 'button', { name: 'Advanced filters' } ) | ||
| .click(); | ||
|
|
||
| // Select a filter | ||
| await adminPage.getByRole( 'button', { name: 'Add a Filter' } ).click(); | ||
| await adminPage.getByRole( 'button', { name: 'Status' } ).click(); | ||
|
|
||
| // Select a filter option | ||
| await adminPage | ||
| .getByLabel( 'Select a payout status', { | ||
| exact: true, | ||
| } ) | ||
| .selectOption( 'Pending' ); | ||
|
|
||
| // Scroll to the top to ensure the sticky header doesn't cover the filters. | ||
| await adminPage.evaluate( () => { | ||
| window.scrollTo( 0, 0 ); | ||
| } ); | ||
| // TODO: This visual regression test is not flaky, but we should revisit the approach. | ||
| // await expect( | ||
| // adminPage.locator( '.woocommerce-filters' ).last() | ||
| // ).toHaveScreenshot(); | ||
| } ); | ||
| } ); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.