This Chrome extension uses GPT-3.5 Turbo to generate test cases based on selected defect descriptions. The extension adds a context menu item to generate test cases when text is selected on a web page.
- Generate test cases based on selected defect descriptions
- Display generated test cases in a popup
- Clear generated test cases
Check out the demo video of the Test Case Generator Chrome extension in action. Please note that there is a 20-second waiting period for GPT to complete the test case generation.
Demo video Link
-
Clone this repository
-
Navigate to the project directory:
cd GPT-testCase-chromeExtension
-
Install required Python packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add your OpenAI API or Azure key:
- if use openai api
OPENAI_API_KEY = xxxxxx
- if use azure openai api
AZURE_API_KEY = xxxxxx
- Run the Flask server:
- openai endpoint
python server.py
- azure endpoint (need to replace default endpoint to your own endpoint)
openai.api_base = "https://YourOwn-OpenAI-EndPoint.openai.azure.com/"
python server-azure.py
-
If your Flask server is not hosted on port 5000, add the Flask hosting URL to the host_permissions in the manifest.json file
-
Load the Chrome extension:
- Open the Chrome browser and navigate to
chrome://extensions/
. - Enable "Developer mode" using the toggle in the top right corner.
- Click "Load unpacked" and select the project directory.
- Open the Chrome browser and navigate to
-
Select a defect description text on a web page.
-
Right-click the selected text and choose "Generate Test Case" from the context menu.
-
The generated test case will be displayed in a popup.
-
Click the "Clear Test Case" button to clear the displayed test case.
- GPT-3.5 Turbo API
- Flask (for the server-side component)
MIT License