All projects

Project

2025

Test Automation Code Generator

Internship project at Brightest: A tool that extracts Page Object Models (POM) from GitHub repositories and generates test code.

ReactNext.jsMongoDBTypeScript

Overview

During my internship at Brightest, a company specialising in test automation, I developed a tool to simplify writing test scripts — particularly for employees with less technical background.

While existing frameworks like Playwright and Selenium offer code generation, this tool specifically focuses on extracting methods from Page Object Models (POM) stored in GitHub repositories and generating reusable code compatible with Brightest's internal test framework.

Approach

The project began with a research phase into existing solutions and the technical feasibility of extracting POM data from JavaScript, TypeScript and C# code files. I collaborated with a fellow student (known from the Atlas Copco project).

After a successful proof-of-concept, we built a Next.js web application with MongoDB for configuration storage and Microsoft Authentication (MSAL) for login via the Brightest environment.

PomExtractor.ts
export class PomExtractor {
  static extractMethodsFromTs(fileContent: string): PomMethod[] {
    const methods: PomMethod[] = [];
    const methodRegex = /(?:async\s+)?(\w+)\s*\(([^)]*)\)\s*{/g;
    let match;

    while ((match = methodRegex.exec(fileContent)) !== null) {
      const methodName = match[1];
      const paramsString = match[2].trim();

      if (methodName === 'constructor' || methodName.startsWith('_')) continue;

      const params = paramsString
        ? paramsString.split(',').map(param => {
            const [name, type] = param.trim().split(':').map(p => p.trim());
            return { name, type: type || 'any' };
          })
        : [];

      methods.push({ name: methodName, parameters: params, returnType: 'void' });
    }

    return methods;
  }
}

Features

The end-to-end flow:

  1. 1.
    Login. Users sign in with their Microsoft account (MSAL).
  2. 2.
    Repository configuration. Provide a GitHub URL and a personal access token.
  3. 3.
    File selection. Pick relevant code files. A custom extractor parses JS, TS and C#.
  4. 4.
    Test case creation. Compose tests by selecting extracted methods and adding parameters.
  5. 5.
    Code generation. The app outputs test code, ready to paste into a test environment.

Key technical aspects: React Context API for state management, custom services, and clean backend API endpoints inside Next.js.

Challenges

This was my first experience in a professional development environment, which required adapting to new workflows and expectations.

Specific challenges included:

  • ·Deeply understanding the Page Object Model concept itself
  • ·Communicating clearly with the project manager and internal stakeholders to clarify requirements
  • ·Working with MSAL authentication in a corporate context
  • ·Designing a robust architecture for code extraction and generation

Valuable experience with modern web development in a professional context — and a meaningful step up in designing complex system architectures.