GitHub Copilot Prompts for QA Engineers
QA engineers need help turning requirements into test cases, writing clear bug reports, and building or fixing automated tests for web and API flows. These GitHub Copilot prompts start from that: fill in your situation once and reuse it. The worked example below is a testing task, one of the most common for qa engineers.
I'm a qa engineer and need help with [task, e.g. test case writing]. What I have: - [the material involved: code, draft, notes or data] What a good result looks like: - [the outcome and its format] Ask me one clarifying question if something important is missing, then give the result. About my work - Feature and acceptance criteria: [e.g. checkout with saved cards, paste the ticket] - Test tools: [e.g. Playwright with TypeScript, Postman, pytest] - Environments and data: [e.g. staging, test accounts with and without saved cards] Context - Files involved: [list the files, or reference them in the chat] - How I build and test: [e.g. npm test]
How to use this prompt
- 1
Open GitHub Copilot
Open Copilot Chat in your editor and paste the prompt.
- 2
Give it context
Select the relevant code first, or reference files in the chat, so Copilot answers about your code rather than in general.
- 3
Review and iterate
Ask follow-ups in the same thread, and copy or insert the suggestion only after you have read it.
- 4
Save what you repeat
Keep repository-wide guidance in a .github/copilot-instructions.md file so it applies to every chat in that repo.
Working in GitHub Copilot
- •Inline suggestions only see the file you are in. Use Copilot Chat for anything that spans several files.
- •Copilot Chat has built-in slash commands such as /explain, /fix and /tests. The prompt here gives more control when you need a specific format.
- •Short, concrete requests work best: name the function, the input and the expected result.
Example task: Testing
What you give it
Language and framework: JavaScript with Vitest
export function slugify(text) {
return text.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
}
What it should do: turn a title into a URL slug with single hyphens and no leading or trailing hyphens.
Edge cases: punctuation, extra spaces, symbols only.What a good answer looks like (shortened)
import { describe, it, expect } from "vitest";
import { slugify } from "./slugify";
describe("slugify", () => {
it("lowercases and joins words with hyphens", () => {
expect(slugify("Hello World")).toBe("hello-world");
});
it("collapses punctuation runs into one hyphen", () => {
expect(slugify("Rock & Roll!!")).toBe("rock-roll");
});
it("strips leading and trailing hyphens", () => {
expect(slugify(" --Draft-- ")).toBe("draft");
});
it("returns an empty string for symbols only", () => {
expect(slugify("!!!")).toBe("");
});
});
Not tested: accented letters are dropped, so "Café" becomes "caf". Confirm whether that is acceptable before I add a test.Tips for better results
- •Paste the acceptance criteria word for word and ask for test cases mapped to each criterion. Gaps in the mapping usually reveal gaps in the requirements.
- •Select the relevant code first, or reference files in the chat, so Copilot answers about your code rather than in general.
- •Check this before you use the output: check that generated tests actually assert on outcomes and use selectors that exist in your app, since a test that never fails gives false confidence.
Check before you use it: Check that generated tests actually assert on outcomes and use selectors that exist in your app, since a test that never fails gives false confidence.
Get the free prompt pack
Our best coding prompts in one Markdown file, delivered by email. The templates here stay free either way — the pack just saves you the copying.
Variations
Task
Testing: Replace the first line with: Write tests for the code below.
Integration tests
Replace Coverage I want with: Test [module] together with a real [database or HTTP layer], and include setup and teardown.
Second task
Change the task line to: [Bug reports].
Save it as a Retext snippet
Retext is a free text expander for Mac. Save this prompt once, then type ;qa-copilot in any app (ChatGPT, Claude, your editor, a browser tab) and the full prompt is pasted in.
- Click Add to Retext. The prompt installs as a snippet with the trigger ;qa-copilot.
- Change the trigger in Retext if you prefer a different one.
- Type the trigger wherever you want the prompt, then fill in the brackets.
Frequently asked questions
Can AI write automated tests that do not break constantly?
It can, if you tell it to use stable selectors like test IDs or roles and avoid fixed waits. Paste a working test from your suite so it follows your existing patterns.
Does this prompt work with inline suggestions or only chat?
Use it in Copilot Chat. Inline suggestions complete code as you type and don't take long instructions like this.
How do I give Copilot project conventions once?
Add them to .github/copilot-instructions.md in the repository. Copilot Chat includes that file with your requests in that repo.
How do I reuse this prompt without copying it every time?
Click Add to Retext to save it as a snippet. Then type ;qa-copilot in any Mac app, including your AI tool, and the full prompt is pasted in.
Related Templates
Get the free prompt pack
Our best coding prompts in one Markdown file, delivered by email. The templates here stay free either way — the pack just saves you the copying.