We are building a TypeScript Playwright test automation framework for a Shopify development store. The framework runs locally using Microsoft Edge and will run unattended through Bitbucket Pipelines.
The store uses Shopify New Customer Accounts. We need to automate an actual logged-in customer checkout, including:
- Creating or selecting a dedicated test customer.
- Authenticating Playwright as that customer.
- Creating a cart and associating it with the authenticated customer.
- Opening Shopify’s hosted checkout.
- Confirming checkout recognizes the logged-in customer.
- Selecting a delivery method.
- Completing payment through Shopify’s test payment gateway.
- Verifying the resulting order through the Admin API.
We have access to:
- Shopify Admin GraphQL API
- Shopify Storefront GraphQL API
- Shopify Customer Account API
- Playwright with TypeScript
New Customer Accounts uses passwordless email authentication with an OTP. Manually entering OTP codes and maintaining manually generated Playwright storageState files is not suitable for reliable, unattended CI execution.
What is Shopify’s officially supported approach for implementing this test using Playwright?
Specifically:
- Can a dedicated automation customer be authenticated programmatically without manually retrieving an OTP?
- Can a Customer Account API OAuth token be supplied to Playwright or associated with a Storefront API cart so hosted checkout recognizes the customer?
- Does Shopify provide a test-only authentication mechanism for New Customer Accounts?
- Is there an API-to-browser handoff recommended for Playwright checkout automation?
- Can Multipass be used with New Customer Accounts for this purpose, or is it limited to legacy customer accounts or particular Shopify plans?
- What is the recommended way to run this test unattended in CI?
- If logged-in checkout cannot be automated on a standard development store, which Shopify store type or test environment should be used?
We can use Playwright API fixtures for setup, the browser for hosted checkout, and the Admin API for post-checkout verification.
We are not looking for an Admin API orderCreate solution because a backend-created order does not exercise the customer login, cart, delivery, payment, or hosted-checkout journey.