Building a High-Performance SpringBoot + layui API Automation Platform from Scratch

This article details the design and implementation of a SpringBoot‑based API automation platform with a layui front‑end, covering architecture choices, permission management, hierarchical data design, test case handling, test set execution, result reporting, and future enhancements such as scheduling, email notifications, and multithreading.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
Building a High-Performance SpringBoot + layui API Automation Platform from Scratch

Preface

Interface automation has lower maintenance cost and more precise result verification than UI automation. Existing solutions like TestNG or JMeter have limitations, so a custom platform was built over two months using SpringBoot, Mybatis, MySQL, Redis, jQuery, and layui.

Overview

Technology Stack

Backend: SpringBoot + Mybatis + MySQL + Redis

Frontend: jQuery + layui (recommended for beginners, with future migration to Vue)

Features

Extreme simplicity: clean UI, easy interaction

Visual data management: convenient addition and maintenance of data

Hierarchical design: projects, modules, interfaces, cases, and test suites are organized to ensure consistency and reduce redundancy

Single‑point debugging: online execution of test cases with detailed request/response info

Workflow assembly: combine multiple cases into a test suite with business‑logic flow

Details

Permission Management Design

Classic tree‑structured role control is used, with additional group permissions for the automation module.

Tree role permission
Tree role permission

Group permissions allow assigning or removing users and projects per group.

Assign users to group
Assign users to group
Assign projects to group
Assign projects to group

Platform Entry

The login page uses a Spring theme; registration is disabled and users are added by an administrator.

Add user page
Add user page

Redis stores token information with configurable expiration and encryption rules.

redis:
  host: localhost
  port: 6379
  timeout: 10s
  lettuce:
    pool:
      min-idle: 0
      max-idle: 8
      max-active: 8
      max-wait: -1ms
  password:

token:
  expire:
    seconds: 72000
  jwtSecret: (XIAO:)_$^11244^%$_(WEI:)_@@++--(LAO:)_++++_.sds_(SHI:)

Hierarchical Design

Data is divided into five layers: Project Management, Interface List, Case Management, Test Suite, and Test Result.

Hierarchical design diagram
Hierarchical design diagram

Project Management

Defines the basic framework of the system, e.g., platform: Sina News, project: Sports, module: La Liga.

Platform: Sina News

Project: Sports

Module: La Liga

IP address: omitted

Project management view
Project management view

Project modules enforce data consistency by requiring interfaces to be created under existing modules.

Each project usually has its own IP address; modules inherit the IP.

Interface List

After creating a project module, interfaces can be added under it.

Interface list
Interface list

Key rules:

Defines basic interface info (path, method, etc.) without detailed parameters.

Each interface must be unique; duplicate paths are prevented.

Platform, project, and module are selected from existing project management data.

Add interface
Add interface

Case Management

Cases describe interfaces in detail and are the core module.

Case management
Case management

Key points:

Cases depend on interfaces; they inherit IP and path.

Multiple cases per interface with different parameter values.

Case types: standard, normal, abnormal. Only one standard case per interface, which can be copied for convenience.

Execute button sends a request using the case data; edit and detail buttons allow modification and inspection.

Basic Information

Displays descriptive information automatically read from the associated platform, project, module, interface, etc.

Basic info
Basic info

Request Parameters

Includes request headers and body.

Request parameters
Request parameters

Associated Extraction

Used for test suites when later interfaces depend on values from previous responses, e.g., extracting a token after login.

Associated extraction
Associated extraction

Variable name: name of the temporary variable.

Path expression: JSON path, same syntax as JMeter’s JSON Extractor.

Default value: used when extraction fails.

Result Assertion

Supports regular assertions (contains, equals, JSON) and Beanshell assertions.

Result assertions
Result assertions

Contains: response includes expected value.

Equals: response exactly matches expected value.

JSON: extracts a field via path expression and compares it to expected value.

Result Example

Shows a sample response returned by an interface.

Result example
Result example

Test Suite

Combines multiple interface cases into a business‑logic workflow.

Test suite
Test suite

Editing a test suite involves adding/removing cases and ordering them.

Edit test suite
Edit test suite
Add cases
Add cases
Case list in suite
Case list in suite

One‑click execution runs all cases sequentially; future plans include project‑level execution and multithreading.

Test Result

After execution, results are persisted and can be viewed in detail.

Test result overview
Test result overview
Result details
Result details

Double‑click a row to view the raw response.

Response content
Response content

Challenges and Optimization List

Implementation of Associations

During test suite execution, a map (association pool) is created in memory. Each case’s extraction rules are applied to its response; extracted values are stored in the pool. When a case parameter uses the ${param} syntax, the value is fetched from the pool. This enables dynamic sharing of values across cases and simplifies updates.

Association implementation diagram
Association implementation diagram

Pending Optimizations

Scheduled tasks: visual editor for timed jobs.

Email notifications: decide format for sending test results.

Multithreading: execute suites per project with thread pools.

Preconditions: cases may depend on prerequisite conditions.

Retry strategy: automatic retries for failed cases with configurable count.

Request parameters: support JSON body format.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend DevelopmentAPI automationSpringBootpermission managementtest casesLayui
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.