-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate testsuite from test prompt file (#4)
* implemented quick selector tool * implement test prompt file (#2) * Create npm-publish.yml * Update npm-publish.yml * Update npm-publish.yml * fix workflow: use pnpm * fix workflow: add set version to release tag * workflow: add checkout fetch-depth: 0 * 1.0.2 * 1.0.3 * patch 1.0.2 * fix src import * 1.0.3 * wip generate test from test prompt file * working testsuite generator * move testsuite generator to new directory * refactor cli * update project tests * Tidy test file mode (#3) * tidy cli code * make gen command output steps json * update README and package.json
- Loading branch information
1 parent
89e4f40
commit a4c911f
Showing
31 changed files
with
774 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,4 @@ screenshot.png | |
.gen/** | ||
app.test.ts | ||
gen.test.ts | ||
*.test.ts |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<testsuite> | ||
<name>Todo Website Test</name> | ||
<output>todo.testsuite.test.ts</output> | ||
<language>typescript</language> | ||
<translator>puppeteer</translator> | ||
<provider>openai</provider> | ||
<model>gpt-4o-mini</model> | ||
<testcases> | ||
<testcase> | ||
<name>Should add a todo</name> | ||
<prompt> | ||
1. go to https://microsoftedge.github.io/Demos/demo-to-do/ | ||
2. add a todo "Cook Dinner" | ||
3. expected added todo "Cook Dinner" in the list | ||
</prompt> | ||
</testcase> | ||
<testcase> | ||
<name>Should remove a todo</name> | ||
<prompt> | ||
1. go to https://microsoftedge.github.io/Demos/demo-to-do/ | ||
2. add a todo "Cook Dinner" | ||
3. expected added todo "Cook Dinner" in the list | ||
4. remove added to do | ||
5. expected empty to do list | ||
</prompt> | ||
</testcase> | ||
</testcases> | ||
</testsuite> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Command, createCommand } from "commander"; | ||
import { GenCommand } from "./gen.ts"; | ||
import { addGenericOptions } from "../helpers/cli.ts"; | ||
import { PromptCommand } from "./prompt.ts"; | ||
import { TestCommand } from "./test.ts"; | ||
|
||
export async function main() { | ||
const program = new Command(); | ||
|
||
program.description( | ||
`A command-line tool that leverages AI to automatically generate test cases from natural language prompts. | ||
This tool helps developers quickly create comprehensive test suites by describing what they want to test in plain English.`, | ||
); | ||
|
||
const promptCommand = new PromptCommand(); | ||
program.addCommand(promptCommand); | ||
|
||
const genCommand = new GenCommand(); | ||
program.addCommand(genCommand); | ||
|
||
const testCommand = new TestCommand(); | ||
program.addCommand(testCommand); | ||
|
||
program.parse(); | ||
|
||
switch (program.args[0]) { | ||
case "prompt": | ||
promptCommand.parse(); | ||
promptCommand.run(); | ||
break; | ||
case "test": | ||
testCommand.run(); | ||
break; | ||
case "gen": | ||
genCommand.parse(); | ||
genCommand.run(); | ||
break; | ||
default: | ||
console.log("Unknown args:", program.args[0]); | ||
process.exit(1); | ||
} | ||
} |
Oops, something went wrong.