Learn how to run end-to-end tests against your deployment in your CI/CD workflow by creating an authentication bypass token.
Step 1: Generate the authentication bypass tokenAnchor link to section titled "Step 1: Generate the authentication bypass token"
Generate a Hydrogen deployment token in the Shopify admin.
Modify your CI/CD file to include the deploy command.
- The command outputs a file named
h2_deploy_log.json, which contains the deployment URL and the authentication bypass token that you can feed into your end-to-end testing system. Each token remains valid for two hours.
Example GitHub workflowAnchor link to section titled "Example GitHub workflow"
If you're using GitHub workflow files, then edit the deploy step per the following example. If you're using another CI/CD system, then refer to these example workflows.
Step 2: Embed the authentication bypass token in the request headerAnchor link to section titled "Step 2: Embed the authentication bypass token in the request header"
Your end-to-end testing system must embed the token within the header before navigating to the deployment URL.