The Testing Academy · AI for QA · Project

Jira to Playwright:
An AI QA Pipeline with RAG and a Human Gate

A LangChain project from the AI Tester Blueprint: fetch Jira stories, ground them on 5,000 existing test cases, let Groq write a typed test plan, review it, then watch a DeepSeek agent run the automatable cases in a real browser and post the verdict. One CLI, one multi-story UI, and a demo you can try right here.

Try the demo (simulation) Source on GitHub LangChain Playwright RAG Jira

One Jira story in, a verdict out. This project chains three agents and a local RAG into a QA pipeline you can read in one sitting, then scales it to many stories with a small web UI.

qa_

Jira to Playwright

An AI QA pipeline in LangChain, from story to verdict

Give it Jira stories. It pulls similar cases from a local RAG, writes a typed test plan, waits for you, then runs the automatable cases in Chromium and posts the verdict.

📚

Local RAG

BM25 over 5,000 cases, no vector DB

🧩

Typed plans

Pydantic TestPlan from Groq

🎭

32 Playwright tools

DeepSeek drives the browser

✋

Human gate

Nothing runs until you tick it

How the pipeline works

1. Fetch
Get the story
fetch_issue("VWO-49")

Jira REST v3, fixture fallback

2. Retrieve
Find similar cases
retrieve(ticket)

Top 5 distinct by BM25

3. Plan
Typed test plan
response_format=TestPlan

Groq, 4 to 8 cases

Gate
Human gate
Run selected

Tick what may run

4. Execute
Browser agent
click_by_role(...)

One case at a time

5. Report
Verdict out
slack_post_message

Verdict computed in code

Stories are planned in parallel; cases run one by one because the tools share one browser.

Multi-Story QA PipelineIllustration

What it reads

Jira REST v3keys, JQL
vwo_5000_test_cases.csv5,000
fixtures/offline
PLAYWRIGHT_TOOLS32
slack_outbox.jsonldummy

Planner

openai/gpt-oss-120b▾

Executor

deepseek-chatt=0

Fetch › Retrieve › Plan › Review

VWO-49, VWO-150
PipelineReview gate
  • Fetched 2 stories from Jira
  • Retrieved 5 similar cases per story
  • Planned both stories in parallel
  • VWO-49: SSO and passkey logins kept manual
  • Waiting for you before any browser opens

Grounded on

[1]RAGVWO-1271 SSO rendering212.32
[2]RAGVWO-5956 SSO login207.36
[3]JiraVWO-49 descriptionstory
Run selected↑

What ships in the folder

jira_client.py

Jira REST v3

playwright_tools.py

32 browser tools

15_E2E_QA_pipeline.py

five-stage CLI

16_Multi_Story_...

multi-story UI

fixtures/

offline tickets

reports/

plans, outbox, runs

Key capabilities

  • Keys, browse URLs or JQL in
  • Grounding on your existing cases
  • Typed plans with an automatable flag
  • Real Chromium runs with screenshots
  • Verdicts computed in code
  • Dry run, no-RAG and CI flags

Quickstart (local)

# 1. plan only, no browser
python 15_E2E_QA_pipeline.py VWO-49 --dry-run

# 2. many stories in a UI
python 16_Multi_Story_QA_Pipeline_UI.py

# 3. in CI, no gates
python 15_E2E_QA_pipeline.py VWO-49 --yes

Why it matters for QA

The slow parts of test design (finding old cases, drafting steps, running the obvious checks) move to agents, while you keep the two decisions that matter: which plan to trust and which cases may touch a browser.

5stages
3agents
5,000library cases
32Playwright tools
2human gates

What it actually is

FetchJira storyRetrieveRAG: 5,000casesPlanGroq TestPlanReviewhuman gateExecuteDeepSeek +PlaywrightReportSlack +Markdown
Five stages and a review gate: story in, verdict out

Why a QA engineer should care

Writing cases by handread the storysearch old cases yourselfwrite steps from scratchrun each one manuallypost results by handWith the pipelinestory fetched from Jira5 similar cases retrievedtyped plan in secondsagent runs automatable casesverdict posted from codeVS
The pipeline does the legwork; you keep the judgment
StageWhat runsModel or toolGate
1. Fetchjira_client.fetch_issue, fixture fallbackJira REST v3
2. RetrieveBM25 over the test-case libraryPlain PythonHuman gate
3. Plancreate_agent(response_format=TestPlan)Groq
4. ExecutePlaywright agent, one case at a timeDeepSeek + 32 toolsHuman gate
5. ReportReporter agent, dummy Slack MCP toolGroq
Want to see it first? The interactive demo replays real plans from this pipeline in your browser, with simulated Playwright runs. No keys needed.

Next, tab 2 follows a story from Jira into the RAG and shows exactly how the similar cases are picked.

Stage 1 gets the story. Stage 2 finds the five most similar test cases you already have. Neither stage needs a model.

Fetch: Jira REST v3 with a fallback

Keys or JQLVWO-49, or a queryresolve_inputkeys vs JQLREST v3issue or search/jqladf_to_textADF to plain textTicketfixture if Jirafails
Fetch: one client, two input styles, an offline fallback
Trap. A bad API token does not always return 401. On issue and search endpoints Jira Cloud can answer as an anonymous user, so a real ticket comes back as 404 and a search returns nothing. Call /rest/api/3/myself first: a 401 there means the credentials, not the ticket.

Retrieve: BM25 over 5,000 test cases

Tokenizesummary + description, stop words outScorerare words x frequent words (idf x tf)Damplong cases do not win by size (b = 0.75)Keep 5one per summary, five different ideas
BM25 retrieval in four moves, no vector database
StoryTop hitWhy it matched
VWO-49: Passkey and SSO login optionsVWO-1271 [User Management] UI/UX: validate rendering of SSO loginShares the rare words sso, login, rendering
VWO-148: TTACart valid login and logoutVWO-2353 [User Management] Functional: verify SSO loginThe library is VWO only, so the closest it has are generic login cases
Read the second row twice. Retrieval is only as good as the library. A TTACart story pulls VWO login cases because that is all the library holds. Add your own product's cases before trusting the grounding.
# run only stages 1 to 3, no browser
python 15_E2E_QA_pipeline.py VWO-49 --dry-run

# the same, without retrieval, to see what grounding is worth
python 15_E2E_QA_pipeline.py VWO-49 --dry-run --no-rag

Next, tab 3 turns the story and these hits into a typed test plan.

The planner is a LangChain agent with a Pydantic response format. It returns a typed object, not prose, and it decides which cases a browser agent can run today.

A typed TestPlan through Groq

Ticketsummary + descriptionRAG hits5 similar casesPlanner agentGroq, temperature 0TestPlan4 to 8 typed cases
Structured output: the agent must return a TestPlan object
PlannedCase fieldTypeUsed for
id, titlestrTC-01 style ids, report rows
priorityHigh, Medium or LowOrdering and review
preconditions, stepslist of strThe browser agent's task
expected_resultstrWhat the agent must verify
automatable, reasonbool, strWhich cases are sent to the browser, and why
grounded_onlist of strLibrary keys the case reused

The automatable rule

  1. Automatable. A browser agent can run it with only the Application URL plus what the ticket gives. Test credentials written in the ticket count. Checking what a public page shows (buttons, labels, order, error text, layout) needs nothing else.
  2. Manual. It needs an SSO identity provider, passkey hardware, an email inbox, or credentials the ticket does not contain.
  3. Never invent. The prompt forbids inventing URLs, credentials or page text, and forbids citing a library key that was not provided.
ManualSSO identity providerpasskey hardwareemail inboxsecrets not in the ticketAutomatableURL plus ticket datademo credentials in the ticketvisible text and buttonsclient-side validationVS
The automatable rule decides what reaches the browser
Trap we hit. The first version of the rule said "no account". The planner then marked every TTACart case manual, because the ticket had demo credentials. Rewording it to "nothing the ticket does not give" fixed that, but the planner then marked the VWO button check manual too, since that ticket has no URL in its text. Naming the Application URL in the rule fixed both. Prompt rules are tested like code.

In our VWO-49 run the plan had 7 cases: 2 automatable (button visibility and order, responsive layout) and 5 manual (real SSO and passkey logins). Next, tab 4 runs the automatable ones.

A second agent drives a real Chromium browser through 32 Playwright tools. It sees the page through snapshots, acts through roles and labels, and is told to verify each step with an assertion.

The agent and its 32 tools

snapshot_pagesee roles and namesactclick_by_role, type_by_labelassertvisible, text, countnext step
Every step: look, act, prove
# what one agent turn amounts to, written as Playwright
await page.goto("https://app.thetestingacademy.com/playwright/ttacart/")
await page.get_by_label("Username").fill("locked_out_user")
await page.get_by_label("Password").fill("tta_secret")
await page.get_by_role("button", name="Login").click()
await expect(page.get_by_text("Epic sadface: Sorry, this user has been locked out.")).to_be_visible()

One case at a time, always cleaned up

  1. Sequential on purpose. The tools share one module-level browser, so cases run one after another, never in parallel.
  2. A fresh task per case. Each case becomes its own task: URL, title, preconditions, numbered steps, expected result, and a screenshot name like VWO-49_TC-01.png.
  3. A step budget. recursion_limit is 100, so a confused agent stops instead of looping forever.
  4. Always close. close_browser runs in a finally block, so a crash in one case never leaves a browser open for the next.
  5. Read the verdict. The last TEST PASSED or TEST FAILED in the reply wins; none means UNKNOWN, an exception means ERROR.
launch_browserfresh ChromiumStepsfrom the planEvidenceconsole +screenshotclose_browseralways, in finallyVerdictlast TESTPASSED/FAILED
One case, start to finish, cleaned up every time
Watch the tool, not just the verdict. In one TTACart run, type_by_label("First Name") filled the wrong field. The agent noticed the form error, switched to the #first-name selector and still passed. The run log showed it; the verdict alone would not have.

Next, tab 5 turns these results into one honest verdict and a Slack post.

The last stage is the smallest and the easiest to get wrong. Code decides the verdict; an agent only writes the message.

The verdict is computed, not asked for

Model decidessees an empty result listwrites Verdict: PASSEDnothing actually ranCode decidesno cases: NOT RUNall passed: PASSEDanything else: FAILEDVS
Never let the reporter judge the run it reports on

A dummy Slack MCP tool

Resultsper case statusVerdictcomputed in codeReporter agentGroq formats itslack_post_messagedummy MCP toolOutbox + .mdreports/ folder
Report: facts first, then words
----- Slack #qa-results (dummy) -----
*Ticket*: VWO-49 - [VWO] Add Passkey and SSO Login Options to VWO Login Page
*Overall Verdict*: PASSED
*Counts*: Passed: 2, Failed: 0, Other: 0
*Manual cases remaining*: 5
Reuse the pattern. Any time an agent reports on work, compute the facts first and pass them in. The agent formats; it does not judge.

Next, tab 6 runs all five stages for many stories at once from a browser UI.

Version 16 wraps the same stage functions in a small web app: enter several stories, review every plan on one screen, run what you tick, and browse the RAG library in its own tab.

The multi-story flow

  1. Fetch and plan. Enter keys or JQL. Every story is fetched, retrieved and planned, and the stories are planned in parallel with asyncio.gather over asyncio.to_thread.
  2. Right target per story. Each story runs against the first URL in its description, else the VWO login page, so a TTACart story is never run against VWO.
  3. Review is the gate. Automatable cases arrive pre-ticked. Nothing opens a browser until you press Run selected.
  4. Run and report. Ticked cases run one by one with live results per row, then one dummy Slack post and one Markdown report per story, plus a combined run report.
Storieskeys or JQLPlan in parallelasyncio.gatherReviewtick the casesRun in sequenceone shared browserReportper story +combined
Many stories: parallel where it is safe, sequential where it is not

What is inside

React pagePipeline, RAG library, How it worksstdlib HTTP serverport 8016, polling APILong-lived event loopevery run scheduled onto itStage functionsimported from 15, not copied
Version 16 is a thin UI over the version 15 pipeline
Trap we hit. The first server called asyncio.run() once per run. The second run failed instantly with "Event loop is closed": the LLM client's pooled connections belonged to the first run's loop. The fix is one long-lived event loop for the life of the server, with every run scheduled onto it.
# start the UI, then open http://localhost:8016
python 16_Multi_Story_QA_Pipeline_UI.py

In our run, VWO-49 plus VWO-150 executed 4 cases, all passed. Next, tab 7 lets you try the same flow without installing anything.

Try the multi-story pipeline right here. The demo is a simulation: it replays plans the real pipeline produced and turns each step into the tool call and Playwright code the agent would use.

Try it

  1. Pick stories. Four sample stories are loaded: VWO-49 (Passkey and SSO), VWO-150 (locked out user), VWO-146 (end-to-end purchase), VWO-148 (login and logout).
  2. Fetch and plan. Watch the stages advance, the RAG hits appear and each plan land.
  3. Review. Tick or untick cases. Manual cases stay unticked for a reason, read it in the row.
  4. Run. The terminal streams each agent tool call with the matching Playwright line, and an illustrated browser follows along. Tick "Inject a bug" to watch a case fail.
  5. Report. One Slack-style post per story, and a combined Markdown report you can download.

Open the demo full screen →

Pick stories4 samplesFetch and planreal plans replayedTick casesthe gateRuntool calls +PlaywrightReportSlack card + .md
The demo walks the same five stages

Real pipeline vs this demo

Real pipelinelive Jira and any JQLGroq plans each runreal Chromium, real verdictsneeds keys and setupBrowser demofour sample storiesrecorded real plansillustrated browserno keys, opens instantlyVS
Same shape, different engine
PartIn the real pipelineIn the demo
StoriesAny key, browse URL or JQL from JiraFour sample stories, fetched once and embedded
RAGBM25 over 5,000 cases in PythonThe real hits per story, and BM25 in JavaScript over a 300-case sample
PlanGroq, generated per runPlans the real pipeline generated, replayed
BrowserReal Chromium driven by DeepSeekGenerated tool calls and Playwright lines, illustrated browser
SlackDummy MCP tool writing a JSON lineA Slack-style card in the page
Use it to teach. The demo shows the shape of the run, step by step, without keys or setup. To see a model make real decisions, run the code in tab 8.

Next, tab 8 is the end-to-end workflow for running it on your own stories.

From a clean machine to a verdict on your own stories. Every command here comes from the project folder.

Set it up

  1. Get the code. Clone the repo and open chapter_17_AI_Agent_LangChain.
  2. Install. A virtual environment with langchain, langgraph, langchain-groq, langchain-deepseek, playwright, python-dotenv, requests and pydantic, then the Chromium browser.
  3. Configure. Copy .env.example to .env and fill GROQ_API_KEY, LLM_MODEL, DEEPSEEK_API, DEEPSEEK_MODEL, JIRA_URL, JIRA_EMAIL, JIRA_API_TOKEN.
  4. Dry run first. Stages 1 to 3 only, no browser, to check Jira, retrieval and the plan.
# ---- in your shell ----
git clone https://github.com/PramodDutta/AITesterBlueprint4x
cd AITesterBlueprint4x/chapter_17_AI_Agent_LangChain
python -m venv .venv
pip install langchain langgraph langchain-groq langchain-deepseek playwright python-dotenv requests pydantic
playwright install chromium

# ---- check the plan, no browser ----
python 15_E2E_QA_pipeline.py VWO-49 --dry-run

# ---- full run with both gates ----
python 15_E2E_QA_pipeline.py VWO-49

# ---- CI: no gates, no window, at most 2 cases ----
python 15_E2E_QA_pipeline.py VWO-49 --yes --headless --max-cases 2
Clonechapter 17Installvenv + Chromium.envGroq, DeepSeek,Jira--dry-runcheck the planFull rungates on
Setup to first verdict

The QA workflow, end to end

  1. Write stories the agent can run. Put the site URL and any test credentials in the description, and write steps with VERIFY lines and exact expected text.
  2. Label them. A label such as e2e lets one JQL pick the runnable stories: project = VWO AND labels = e2e.
  3. Plan in the UI. Start version 16, paste the keys or the JQL, and read every plan. Check the automatable flags and the reasons.
  4. Run what you trust. Tick, run, and watch each row. Open the run log for any failure before blaming the app.
  5. Triage. A FAILED case with a clean log is a bug to file. A FAILED case with a confused log is a story or prompt to fix. Rerun after either.
Write storyURL, creds, VERIFYPlan + reviewread the reasonsRunwatch the logTriagebug or story fixrerun after a fix
The QA loop around the pipeline
Before you rely on it. Seed the RAG library with your own product's test cases, keep the review gate on outside CI, and treat UNKNOWN as a failure until you have read the log.

The source for every file on this page is in the AITesterBlueprint4x repo. Start with the demo, then run tab 8 on one of your own stories.