write_e2e_test

Generate structured guidance for writing authgear-server e2e tests in YAML.

2.0k|126|Updated Jun 16, 2020
One-click install
npx skills add https://github.com/authgear/authgear-server --skill write-e2e-test-authgear
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write_e2e_test
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/write_e2e_test
Command: npx skills add https://github.com/authgear/authgear-server --skill write-e2e-test-authgear

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authgear-server e2e validation requires precise environment resets, YAML structure, and matcher expectations, so this guide consolidates the operational knowledge needed to write deterministic, discoverable tests without missing required steps.

Core Features & Use Cases

  • Maintain a fresh test ecosystem by running make teardown and make setup (or the gmake shim) before executing the go test runner, ensuring migrations and binaries match the code under test.
  • Organize each scenario as a YAML file under e2e/tests/<feature>/, naming it *.test.yaml, describing steps with actions like create, input, query, audit_query, http_request, admin_api_graphql, and sleep, and adding optional before hooks or authgear.yaml overrides.
  • Apply template variables such as {{ .AppID }}, {{ .prev }}, OTP helpers, nodeID encoding, plus Sprig functions, matcher patterns like [[string]]/[[array]]/[[ignore]], and audit-aware SQL tips to assert dynamic results reliably.
  • Use this workflow to validate flows such as signup with OTP delivery, fraud protection decisions recorded in the audit log, HTTP token issuance, and admin mutations while keeping commands sequential in the same shell when daemons die on exit.

Quick Start

Request an e2e YAML test case that validates the signup flow for authgear-server.

Frequently Asked Questions about write_e2e_test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write e2e tests for authgear-server signup and OTP verification flows?

Writing e2e tests for authgear-server involves creating a YAML file under e2e/tests/<feature>/ that describes sequential steps using actions like create, input, and query to validate signup and OTP verification flows.

What is the correct way to set up the environment for authgear e2e test automation?

Setting up the authgear e2e test environment requires running make teardown and make setup to refresh migrations and binaries, ensuring the test runner executes against the correct codebase state.

How do I handle dynamic values when asserting results in authgear YAML e2e tests?

Handling dynamic values in authgear YAML e2e tests requires using template variables like {{ .AppID }} and {{ .prev }}, alongside matcher patterns such as [[string]], [[array]], and [[ignore]] for reliable assertions.

Can I use admin API GraphQL mutations and audit queries in authgear e2e test scenarios?

You can use admin API GraphQL mutations and audit queries in authgear e2e tests by specifying admin_api_graphql and audit_query actions within your YAML test scenarios to validate administrative operations and audit logs.

Why do my authgear e2e tests fail when run in a new shell session?

Authgear e2e tests fail in new shell sessions because background daemons die on exit, requiring you to keep commands sequential in the same shell when executing the go test ./pkg/testrunner command.