Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
86 stars 32 forks source link

Set up e2e environment so we can run e2e tests (just a basic hello world test to start) #134

Open mattallan opened 2 years ago

mattallan commented 2 years ago

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


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.

haszari commented 1 year ago

This would be fantastic to have in place.

See also @brucealdridge mega issue for various automated checks: