The Super QA Automation Agent is a comprehensive tool designed to automate the QA process for web applications. It leverages Playwright for browser automation and OpenAI for intelligent analysis to generate test IDs, create test scripts, and provide detailed test plans.
- Browser Automation: Uses Playwright to initialize a headless browser and navigate to specified URLs.
- HTML Analysis: Extracts existing
data-testidattributes and generates new ones for elements without them. - OpenAI Integration: Sends HTML structure and test IDs to OpenAI for detailed test plan generation.
- Test Script Generation: Creates Playwright test scripts based on the analysis and saves them to files.
- Result Logging: Logs results and saves generated test IDs to a JSON file.
-
Clone the repository:
git clone https://github.com/bennykl/super-qa.git cd super-qa -
Install dependencies:
npm install
-
Set up your OpenAI API key by creating a
.envfile based on.env.example.
Run the main script to start the QA automation process:
node index.js- OpenAI API Key: Set your OpenAI API key in the
.envfile. - URL: Modify the URL in
index.jsto specify the target web page for analysis.
- Playwright: For browser automation.
- OpenAI: For intelligent analysis.
- Node-HTML-Parser: For HTML parsing and modification.
- Dotenv: For managing environment variables.
Feel free to contribute by opening issues or submitting pull requests.
This project is licensed under the ISC License.
For more details, refer to the source code and comments within the files.
Below is an example of the test scripts generated by the Super QA Automation Agent:
test("Login Page UI Elements Verification", async ({ page }) => {
await page.goto("https://example.com");
await expect(page).tobeVisible('[data-testid="login-title"]');
await expect(page).tobeVisible('[data-testid="login-subtitle"]');
await expect(page).tobeVisible('[data-testid="input-email"]');
await expect(page).tobeVisible('[data-testid="input-password"]');
await expect(page).tobeVisible('[data-testid="button-login"]');
await expect(page).tobeVisible('[data-testid="button-login-google"]');
});
test("Verify Functionality of Login Input Fields", async ({ page }) => {
await page.goto("https://example.com");
await page.type('[data-testid="input-email"]', "example@email.com");
await page.type('[data-testid="input-password"]', "Password123");
const emailValue = await page.getAttribute(
'[data-testid="input-email"]',
"value"
);
const passwordValue = await page.getAttribute(
'[data-testid="input-password"]',
"value"
);
expect(emailValue).toBe("example@email.com");
expect(passwordValue).toBe("Password123");
});
test("Verify Login Functionality", async ({ page }) => {
await page.goto("https://example.com");
await page.click('[data-testid="button-login"]');
// Add verification for successful login
});
test("Verify Login with Google Functionality", async ({ page }) => {
await page.goto("https://example.com");
await page.click('[data-testid="button-login-google"]');
// Add verification for Google authentication process initiation
});These scripts demonstrate the automation of UI element verification, input field functionality, and login process verification for a web application.