We might be able to salvage this PR and bring it over to Subscriptions Core, however, this PR was based on a PR that added e2e tests to the PayPal Checkout repo which was based on an older version of WC core setting up their e2e environment. I'm sure there have been some updates to setting up the WC e2e environment, but also I'm imagining there are some differences between how WC Core sets up their e2e env and other repos like WCPay.
Part of tackling this issue will be looking at other similar repositories/projects for inspiration and aligning on how to set up e2e env in a standard/familiar way in subscriptions core.
Requirements
Able to setup e2e env in Github checks/workflows
Able to setup e2e env locally
Implementation
Playwright - Tests will be written in Playwright rather than the typical Jest + Puppeteer
Reason: WP and WC are moving to Playwright so we should probably start there
wp-env will be used to boot up the e2e environment with active plugins:
Latest WooCommerce installed/activated
Latest WC Payments gateway and dev tools installed/activated (not
e2e tests in subscriptions-core
Even though Subscriptions Core is a library, and on its own doesn't provide functionality without other plugins initializing it (WCPay) or extending it (WCS), we can still write e2e tests to test parts of subscriptions core that are fundamental to the core subscriptions library.
Because Subscriptions Core is designed to only work WC Payments, we should have WC Payments installed/activated in the e2e environment for better coverage.
Duplicate subscriptions e2e tests in WC Subscriptions and WCPay
E2E testing subscriptions functionality in 3 places is completely fine and is to be expected. We want to test subscriptions-core on its own and in the end products that use/extend it. So having three e2e tests in different repositories for creating a subscription product is a good thing.
Part of #32
Background
Before the
subscriptions-core
codebase was split from WC Subscriptions, we had an open PR that introduced a few basic e2e tests and set up the e2e environment, see https://github.com/woocommerce/woocommerce-subscriptions/pull/3746.We might be able to salvage this PR and bring it over to Subscriptions Core, however, this PR was based on a PR that added e2e tests to the PayPal Checkout repo which was based on an older version of WC core setting up their e2e environment. I'm sure there have been some updates to setting up the WC e2e environment, but also I'm imagining there are some differences between how WC Core sets up their e2e env and other repos like WCPay.
Part of tackling this issue will be looking at other similar repositories/projects for inspiration and aligning on how to set up e2e env in a standard/familiar way in subscriptions core.
Requirements
Implementation
wp-env
will be used to boot up the e2e environment with active plugins:e2e tests in
subscriptions-core
Even though Subscriptions Core is a library, and on its own doesn't provide functionality without other plugins initializing it (WCPay) or extending it (WCS), we can still write e2e tests to test parts of subscriptions core that are fundamental to the core subscriptions library.
Because Subscriptions Core is designed to only work WC Payments, we should have WC Payments installed/activated in the e2e environment for better coverage.
Duplicate subscriptions e2e tests in WC Subscriptions and WCPay
E2E testing subscriptions functionality in 3 places is completely fine and is to be expected. We want to test subscriptions-core on its own and in the end products that use/extend it. So having three e2e tests in different repositories for creating a subscription product is a good thing.