name: db-setup-and-verify
config:
postgres:
dsn: postgres://postgres:password@localhost:5433/postgres
steps:
- name: create-table
type: db
query: |
CREATE TABLE IF NOT EXISTS test_orders (
id SERIAL PRIMARY KEY,
customer_email TEXT,
total NUMERIC
);
- name: insert-order
type: db
query: |
INSERT INTO test_orders (customer_email, total)
VALUES ('qa@example.com', 99.99)
RETURNING id;
extract:
order_id: $[0].id
- name: verify-insert
type: db
query: "SELECT * FROM test_orders WHERE id = {{ order_id }}"
assert:
- ["$[0].customer_email", "eq", "qa@example.com"]
- ["$[0].total", "eq", 99.99]