Skip to content

bennykl/super-qa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super QA Automation Agent

Overview

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.

Features

  • Browser Automation: Uses Playwright to initialize a headless browser and navigate to specified URLs.
  • HTML Analysis: Extracts existing data-testid attributes 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.

Installation

  1. Clone the repository:

    git clone https://github.com/bennykl/super-qa.git
    cd super-qa
  2. Install dependencies:

    npm install
  3. Set up your OpenAI API key by creating a .env file based on .env.example.

Usage

Run the main script to start the QA automation process:

node index.js

Configuration

  • OpenAI API Key: Set your OpenAI API key in the .env file.
  • URL: Modify the URL in index.js to specify the target web page for analysis.

Dependencies

  • Playwright: For browser automation.
  • OpenAI: For intelligent analysis.
  • Node-HTML-Parser: For HTML parsing and modification.
  • Dotenv: For managing environment variables.

Contributing

Feel free to contribute by opening issues or submitting pull requests.

License

This project is licensed under the ISC License.


For more details, refer to the source code and comments within the files.

Example Output: Generated Test Scripts

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors