Skip to content

Conversation

@mgascam
Copy link
Contributor

@mgascam mgascam commented Oct 7, 2025

Fixes #WOOPMNT-5347

This PR builds on #11071.

It completes the migration of all WooCommerce Subscriptions E2E tests to the QIT framework and removes environment-based skip flags in favor of Playwright's native tag-based filtering system.

Changes proposed in this Pull Request

  • Migrates 9 subscription specs (3 merchant + 6 shopper)
  • Subscription products XML import setup
  • Skip flag removal from all QIT specs
  • goToActionScheduler utility function
  • WooCommerce Subscriptions plugin integration in QIT bootstrap

Tag-Based Filtering

Removed environment-based skip flags from all QIT specs:

// ❌ REMOVED: Legacy skip pattern
const shouldRunSubscriptionsTests = process.env.SKIP_WC_SUBSCRIPTIONS_TESTS !== '1';
test.skip(!shouldRunSubscriptionsTests, 'Subscriptions tests are disabled');

Now using Playwright tags:

// ✅ NEW: Tag-based filtering
test.describe(
    'Subscriptions > Feature',
    { tag: ['@critical', '@subscriptions', '@merchant'] },
    () => { ... }
);

Benefits:

  • Filter at runtime: npm run test:qit-e2e -- --tag=subscriptions
  • Combine tags: --tag="critical & subscriptions"
  • No inline skip logic
  • Aligns with Playwright best practices

Testing instructions

# Run all subscription tests
npm run test:qit-e2e -- tests/qit/e2e/specs/subscriptions/

# Run specific test groups
npm run test:qit-e2e -- --tag=@subscriptions
npm run test:qit-e2e -- --tag="@critical & @subscriptions"

  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

- Introduced WP-CLI commands for QIT setup and status checks to assist in development environments.
- Created a new class `WP_CLI_QIT_Dev_Command` for handling Jetpack connection setup and account data refresh.
- Added E2E test runner script and configuration for QIT, including basic tests for WooCommerce Payments functionality.
- Updated package.json to include a new script for running QIT E2E tests.
- Enhanced default environment configuration for QIT testing with necessary credentials.
- Implemented setup script for WooCommerce Payments E2E tests to configure products, customers, and Jetpack connections.
- Added ESLint configuration for E2E tests to accommodate Playwright testing framework.
- Created initial E2E test cases to verify basic functionality and plugin activation.
…nce setup functions, and add connection validation tests
- Add .github/workflows/qit-e2e.yml with comprehensive CI setup
- Support multiple WooCommerce and PHP version combinations
- Enable manual workflow dispatch with custom parameters
- Update e2e-runner.sh to handle CI environment options
- Add CI.md documentation explaining workflow usage and setup

The workflow runs on PR, push to main branches, scheduled, and manual dispatch.
Includes proper authentication and environment variable handling for CI context.
Security improvements:
- Add GitHub Actions log masking for all sensitive tokens
- Use environment variables instead of command-line arguments in WP-CLI
- Update WP_CLI_QIT_Dev_Command to prioritize env vars over CLI args
- Remove tokens from command-line to prevent exposure in process lists
- Add comprehensive security documentation and best practices

This prevents token leakage through:
- Process lists (ps aux)
- Command history
- GitHub Actions logs
- Error output and debugging info

All tests continue to pass with enhanced security measures.
@mgascam mgascam changed the title [WIP] [E2E][QIT] Migrate subscriptions e2e specs [E2E][QIT] Migrate subscriptions e2e specs Oct 8, 2025
@mgascam mgascam marked this pull request as ready for review October 8, 2025 09:47
@mgascam mgascam requested a review from a team October 8, 2025 09:47
@mgascam mgascam force-pushed the dev/qit-e2e-merchant-specs-migration branch from cc5ba36 to 37b73dd Compare November 11, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants