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.
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.
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.
BM25 over 5,000 cases, no vector DB
Pydantic TestPlan from Groq
DeepSeek drives the browser
Nothing runs until you tick it
How the pipeline works
fetch_issue("VWO-49")Jira REST v3, fixture fallback
retrieve(ticket)Top 5 distinct by BM25
response_format=TestPlanGroq, 4 to 8 cases
Run selectedTick what may run
click_by_role(...)One case at a time
slack_post_messageVerdict computed in code
Stories are planned in parallel; cases run one by one because the tools share one browser.
What it reads
Jira REST v3keys, JQLvwo_5000_test_cases.csv5,000fixtures/offlinePLAYWRIGHT_TOOLS32slack_outbox.jsonldummyPlanner
Executor
Fetch › Retrieve › Plan › Review
Grounded on
VWO-1271 SSO rendering212.32VWO-5956 SSO login207.36VWO-49 descriptionstoryWhat ships in the folder
jira_client.pyJira REST v3
playwright_tools.py32 browser tools
15_E2E_QA_pipeline.pyfive-stage CLI
16_Multi_Story_...multi-story UI
fixtures/offline tickets
reports/plans, outbox, runs
Key capabilities
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
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.
15_E2E_QA_pipeline.py takes one ticket key and runs five stages: fetch, retrieve, plan, execute, report.16_Multi_Story_QA_Pipeline_UI.py reuses those exact stage functions for many stories at once, with a review screen as the human gate.--yes skips both for CI.| Stage | What runs | Model or tool | Gate |
|---|---|---|---|
| 1. Fetch | jira_client.fetch_issue, fixture fallback | Jira REST v3 | |
| 2. Retrieve | BM25 over the test-case library | Plain Python | Human gate |
| 3. Plan | create_agent(response_format=TestPlan) | Groq | |
| 4. Execute | Playwright agent, one case at a time | DeepSeek + 32 tools | Human gate |
| 5. Report | Reporter agent, dummy Slack MCP tool | Groq |
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.
jira_client.py reads JIRA_URL, JIRA_EMAIL and JIRA_API_TOKEN from .env.resolve_input treats the text as keys when every token is an issue key or browse URL, otherwise as JQL. JQL follows nextPageToken and stops at 50 tickets.adf_to_text flattens paragraphs, list items and hard breaks into plain text the planner can read.fixtures/<KEY>.json, so a class demo survives a dead token or no network./rest/api/3/myself first: a 401 there means the credentials, not the ticket.vwo_5000_test_cases.csv from chapter 14: 5,000 rows across 17 components, with summary, preconditions, steps, expected result, browser and device.k1 = 1.5, b = 0.75). A word scores higher when it is rare across the library and frequent in the case, and long cases are damped so they do not win by size.| Story | Top hit | Why it matched |
|---|---|---|
| VWO-49: Passkey and SSO login options | VWO-1271 [User Management] UI/UX: validate rendering of SSO login | Shares the rare words sso, login, rendering |
| VWO-148: TTACart valid login and logout | VWO-2353 [User Management] Functional: verify SSO login | The library is VWO only, so the closest it has are generic login cases |
# 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.
ChatGroq with the model from LLM_MODEL (default openai/gpt-oss-120b) at temperature 0.create_agent(model=llm, system_prompt=PLANNER_PROMPT, response_format=TestPlan), then read result["structured_response"]. Same pattern as the structured-output lesson earlier in the chapter.TestPlan holds scope, out of scope, risks and 4 to 8 PlannedCase objects.| PlannedCase field | Type | Used for |
|---|---|---|
id, title | str | TC-01 style ids, report rows |
priority | High, Medium or Low | Ordering and review |
preconditions, steps | list of str | The browser agent's task |
expected_result | str | What the agent must verify |
automatable, reason | bool, str | Which cases are sent to the browser, and why |
grounded_on | list of str | Library keys the case reused |
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.
ChatDeepSeek, model from DEEPSEEK_MODEL (default deepseek-chat), key from DEEPSEEK_API, temperature 0.snapshot_page returns every role and name on the page, so the agent never guesses a selector. get_page_info, get_text, get_all_texts read the rest.click_by_role and type_by_label first, raw CSS (click_element, type_text) only when needed. Plus hover, keys, dropdowns, checkboxes, uploads, drag and drop, viewport.assert_visible, assert_text_contains, count_elements, then get_console_errors, get_failed_requests and take_screenshot before closing.# 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()
VWO-49_TC-01.png.recursion_limit is 100, so a confused agent stops instead of looping forever.close_browser runs in a finally block, so a crash in one case never leaves a browser open for the next.TEST PASSED or TEST FAILED in the reply wins; none means UNKNOWN, an exception means ERROR.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.
slack_post_message(channel, text) mirrors the Slack MCP server's tool, so the reporter agent is written against the real interface.reports/slack_outbox.jsonl and prints the message. Swap in the real MCP tool later without touching the agent.#qa-results, under 20 lines, reporting only what the data says.reports/pipeline_<KEY>_<stamp>.md holds the RAG hits, the full plan, and each executed case's log.----- 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
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.
asyncio.gather over asyncio.to_thread.ThreadingHTTPServer on port 8016 serves a React page loaded from a CDN, with no build step.15_E2E_QA_pipeline.py by path and calls its fetch_ticket, retrieve, plan, execute and report. A fix in 15 fixes 16.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.
| Part | In the real pipeline | In the demo |
|---|---|---|
| Stories | Any key, browse URL or JQL from Jira | Four sample stories, fetched once and embedded |
| RAG | BM25 over 5,000 cases in Python | The real hits per story, and BM25 in JavaScript over a 300-case sample |
| Plan | Groq, generated per run | Plans the real pipeline generated, replayed |
| Browser | Real Chromium driven by DeepSeek | Generated tool calls and Playwright lines, illustrated browser |
| Slack | Dummy MCP tool writing a JSON line | A Slack-style card in the page |
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.
chapter_17_AI_Agent_LangChain.langchain, langgraph, langchain-groq, langchain-deepseek, playwright, python-dotenv, requests and pydantic, then the Chromium browser..env.example to .env and fill GROQ_API_KEY, LLM_MODEL, DEEPSEEK_API, DEEPSEEK_MODEL, JIRA_URL, JIRA_EMAIL, JIRA_API_TOKEN.# ---- 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
e2e lets one JQL pick the runnable stories: project = VWO AND labels = e2e.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.